From 73a8cf8f8ee635defc56acd349ae218129b78685 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:27:49 +1100 Subject: [PATCH] Remove WinAPI primitive types from 4J.Profile --- 4J.Profile/4J_Profile.cpp | 31 +++++++++++---------- 4J.Profile/4J_Profile.h | 31 +++++++++++---------- Minecraft.Client/Platform/Extrax64Stubs.cpp | 16 +++++------ 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/4J.Profile/4J_Profile.cpp b/4J.Profile/4J_Profile.cpp index d71426de2..08322cf8d 100644 --- a/4J.Profile/4J_Profile.cpp +++ b/4J.Profile/4J_Profile.cpp @@ -5,10 +5,12 @@ C_4JProfile ProfileManager; static void* s_profileData[4] = {}; -void C_4JProfile::Initialise(DWORD dwTitleID, DWORD dwOfferID, +void C_4JProfile::Initialise(std::uint32_t dwTitleID, + std::uint32_t dwOfferID, unsigned short usProfileVersion, - UINT uiProfileValuesC, UINT uiProfileSettingsC, - DWORD* pdwProfileSettingsA, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + std::uint32_t* pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int* puiGameDefinedDataChangedBitmask) { for (int i = 0; i < 4; i++) { @@ -25,22 +27,21 @@ void C_4JProfile::SetLockedProfile(int iProf) {} bool C_4JProfile::IsSignedIn(int iQuadrant) { return iQuadrant == 0; } bool C_4JProfile::IsSignedInLive(int iProf) { return false; } bool C_4JProfile::IsGuest(int iQuadrant) { return false; } -UINT C_4JProfile::RequestSignInUI(bool bFromInvite, bool bLocalGame, - bool bNoGuestsAllowed, - bool bMultiplayerSignIn, bool bAddUser, - int (*Func)(void*, const bool, - const int iPad), - void* lpParam, int iQuadrant) { +unsigned int C_4JProfile::RequestSignInUI( + bool bFromInvite, bool bLocalGame, bool bNoGuestsAllowed, + bool bMultiplayerSignIn, bool bAddUser, + int (*Func)(void*, const bool, const int iPad), void* lpParam, + int iQuadrant) { return 0; } -UINT C_4JProfile::DisplayOfflineProfile(int (*Func)(void*, const bool, - const int iPad), - void* lpParam, int iQuadrant) { +unsigned int C_4JProfile::DisplayOfflineProfile( + int (*Func)(void*, const bool, const int iPad), void* lpParam, + int iQuadrant) { return 0; } -UINT C_4JProfile::RequestConvertOfflineToGuestUI(int (*Func)(void*, const bool, - const int iPad), - void* lpParam, int iQuadrant) { +unsigned int C_4JProfile::RequestConvertOfflineToGuestUI( + int (*Func)(void*, const bool, const int iPad), void* lpParam, + int iQuadrant) { return 0; } void C_4JProfile::SetPrimaryPlayerChanged(bool bVal) {} diff --git a/4J.Profile/4J_Profile.h b/4J.Profile/4J_Profile.h index 0bd8a4b9e..baadff82f 100644 --- a/4J.Profile/4J_Profile.h +++ b/4J.Profile/4J_Profile.h @@ -36,9 +36,11 @@ public: // 4 players have game defined data, puiGameDefinedDataChangedBitmask needs // to be checked by the game side to see if there's an update needed - it'll // have the bits set for players to be updated - void Initialise(DWORD dwTitleID, DWORD dwOfferID, - unsigned short usProfileVersion, UINT uiProfileValuesC, - UINT uiProfileSettingsC, DWORD* pdwProfileSettingsA, + void Initialise(std::uint32_t dwTitleID, std::uint32_t dwOfferID, + unsigned short usProfileVersion, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + std::uint32_t* pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int* puiGameDefinedDataChangedBitmask); void SetTrialTextStringTable(CXuiStringTable* pStringTable, int iAccept, @@ -50,17 +52,18 @@ public: bool IsSignedIn(int iQuadrant); bool IsSignedInLive(int iProf); bool IsGuest(int iQuadrant); - UINT RequestSignInUI(bool bFromInvite, bool bLocalGame, - bool bNoGuestsAllowed, bool bMultiplayerSignIn, - bool bAddUser, - int (*Func)(void*, const bool, const int iPad), - void* lpParam, int iQuadrant = XUSER_INDEX_ANY); - UINT DisplayOfflineProfile(int (*Func)(void*, const bool, const int iPad), - void* lpParam, int iQuadrant = XUSER_INDEX_ANY); - UINT RequestConvertOfflineToGuestUI(int (*Func)(void*, const bool, - const int iPad), - void* lpParam, - int iQuadrant = XUSER_INDEX_ANY); + unsigned int RequestSignInUI(bool bFromInvite, bool bLocalGame, + bool bNoGuestsAllowed, + bool bMultiplayerSignIn, bool bAddUser, + int (*Func)(void*, const bool, const int iPad), + void* lpParam, + int iQuadrant = XUSER_INDEX_ANY); + unsigned int DisplayOfflineProfile( + int (*Func)(void*, const bool, const int iPad), void* lpParam, + int iQuadrant = XUSER_INDEX_ANY); + unsigned int RequestConvertOfflineToGuestUI( + int (*Func)(void*, const bool, const int iPad), void* lpParam, + int iQuadrant = XUSER_INDEX_ANY); void SetPrimaryPlayerChanged(bool bVal); bool QuerySigninStatus(void); void GetXUID(int iPad, PlayerUID* pXuid, bool bOnlineXuid); diff --git a/Minecraft.Client/Platform/Extrax64Stubs.cpp b/Minecraft.Client/Platform/Extrax64Stubs.cpp index 683ef6f94..d462efd35 100644 --- a/Minecraft.Client/Platform/Extrax64Stubs.cpp +++ b/Minecraft.Client/Platform/Extrax64Stubs.cpp @@ -395,12 +395,12 @@ DWORD XEnableGuestSignin(BOOL fEnable) { return 0; } #ifdef _WINDOWS64 static void *profileData[4]; static bool s_bProfileIsFullVersion; -void C_4JProfile::Initialise( DWORD dwTitleID, - DWORD dwOfferID, +void C_4JProfile::Initialise( std::uint32_t dwTitleID, + std::uint32_t dwOfferID, unsigned short usProfileVersion, - UINT uiProfileValuesC, - UINT uiProfileSettingsC, - DWORD *pdwProfileSettingsA, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + std::uint32_t *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask) { @@ -467,9 +467,9 @@ void C_4JProfile::SetLockedProfile(int iProf) {} bool C_4JProfile::IsSignedIn(int iQuadrant) { return ( iQuadrant == 0); } bool C_4JProfile::IsSignedInLive(int iProf) { return true; } bool C_4JProfile::IsGuest(int iQuadrant) { return false; } -UINT C_4JProfile::RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } -UINT C_4JProfile::DisplayOfflineProfile(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } -UINT C_4JProfile::RequestConvertOfflineToGuestUI(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } +unsigned int C_4JProfile::RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } +unsigned int C_4JProfile::DisplayOfflineProfile(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } +unsigned int C_4JProfile::RequestConvertOfflineToGuestUI(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } void C_4JProfile::SetPrimaryPlayerChanged(bool bVal) {} bool C_4JProfile::QuerySigninStatus(void) { return true; } void C_4JProfile::GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid) {*pXuid = 0xe000d45248242f2e; }