From 665230c2b283fb04f928fb6f214bf9c6f6a12028 Mon Sep 17 00:00:00 2001 From: Trsdy <914137150@qq.com> Date: Sun, 7 May 2023 18:43:50 +0800 Subject: [PATCH] Move all ALIAS mess from StaticInits back to Unsorted Now I finally know what this file is used for. Thank you ChatGPT --- EventClass.h | 2 +- StaticInits.cpp | 115 -------------------------- Unsorted.h | 211 ++++++++++++++++++++++++------------------------ YRCom.h | 6 +- 4 files changed, 111 insertions(+), 223 deletions(-) diff --git a/EventClass.h b/EventClass.h index 76981318..482f4524 100644 --- a/EventClass.h +++ b/EventClass.h @@ -187,7 +187,7 @@ class EventClass OutList->List[OutList->Tail] = event; - OutList->Timings[OutList->Tail] = static_cast(Imports::TimeGetTime()); + OutList->Timings[OutList->Tail] = static_cast(Imports::TimeGetTime()()); ++OutList->Count; OutList->Tail = (OutList->Tail + 1) & 127; diff --git a/StaticInits.cpp b/StaticInits.cpp index 36265131..3c977bad 100644 --- a/StaticInits.cpp +++ b/StaticInits.cpp @@ -2,121 +2,6 @@ #include -#define ALIAS(Type, Obj, Addr) \ - Type &Obj = *reinterpret_cast(Addr); - -ALIAS(Imports::FP_OleSaveToStream, Imports::OleSaveToStream, 0x7E15F4); -ALIAS(Imports::FP_OleLoadFromStream, Imports::OleLoadFromStream, 0x7E15F8); -ALIAS(Imports::FP_CoRegisterClassObject, Imports::CoRegisterClassObject, 0x7E15D8); -ALIAS(Imports::FP_CoRevokeClassObject, Imports::CoRevokeClassObject, 0x7E15CC); - -ALIAS(Imports::FP_TimeGetTime, Imports::TimeGetTime, 0x7E1530); - -ALIAS(Imports::FP_DefWindowProcA, Imports::DefWindowProcA, 0x7E1394); -ALIAS(Imports::FP_MoveWindow, Imports::MoveWindow, 0x7E1398); -ALIAS(Imports::FP_GetUpdateRect, Imports::GetUpdateRect, 0x7E139C); -ALIAS(Imports::FP_GetFocus, Imports::GetFocus, 0x7E13A0); -ALIAS(Imports::FP_GetDC, Imports::GetDC, 0x7E13A4); -ALIAS(Imports::FP_GetKeyState, Imports::GetKeyState, 0x7E13A8); -ALIAS(Imports::FP_GetActiveWindow, Imports::GetActiveWindow, 0x7E13AC); -ALIAS(Imports::FP_GetCapture, Imports::GetCapture, 0x7E13B0); -ALIAS(Imports::FP_GetDlgCtrlID, Imports::GetDlgCtrlID, 0x7E13B4); -ALIAS(Imports::FP_ChildWindowFromPointEx, Imports::ChildWindowFromPointEx, 0x7E13B8); -ALIAS(Imports::FP_GetWindowRect, Imports::GetWindowRect, 0x7E13BC); -ALIAS(Imports::FP_GetCursorPos, Imports::GetCursorPos, 0x7E13C0); -ALIAS(Imports::FP_CloseWindow, Imports::CloseWindow, 0x7E13C4); -ALIAS(Imports::FP_EndDialog, Imports::EndDialog, 0x7E13C8); -ALIAS(Imports::FP_SetFocus, Imports::SetFocus, 0x7E13CC); -ALIAS(Imports::FP_SetDlgItemTextA, Imports::SetDlgItemTextA, 0x7E13D0); -ALIAS(Imports::FP_DialogBoxParamA, Imports::DialogBoxParamA, 0x7E13D4); -#ifdef _MSVC -ALIAS(Imports::FP_DialogBoxIndirectParamA, Imports::DialogBoxIndirectParamA, 0x7E13D8); -#endif -ALIAS(Imports::FP_ShowCursor, Imports::ShowCursor, 0x7E13DC); -ALIAS(Imports::FP_GetAsyncKeyState, Imports::GetAsyncKeyState, 0x7E13E0); -ALIAS(Imports::FP_ToAscii, Imports::ToAscii, 0x7E13E4); -ALIAS(Imports::FP_MapVirtualKeyA, Imports::MapVirtualKeyA, 0x7E13E8); -ALIAS(Imports::FP_GetSystemMetrics, Imports::GetSystemMetrics, 0x7E13EC); -ALIAS(Imports::FP_SetWindowPos, Imports::SetWindowPos, 0x7E13F0); -ALIAS(Imports::FP_DestroyWindow, Imports::DestroyWindow, 0x7E13F4); -ALIAS(Imports::FP_ReleaseCapture, Imports::ReleaseCapture, 0x7E13F8); -ALIAS(Imports::FP_SetCapture, Imports::SetCapture, 0x7E13FC); -ALIAS(Imports::FP_AdjustWindowRectEx, Imports::AdjustWindowRectEx, 0x7E1400); -ALIAS(Imports::FP_GetMenu, Imports::GetMenu, 0x7E1404); -ALIAS(Imports::FP_AdjustWindowRect, Imports::AdjustWindowRect, 0x7E1408); -ALIAS(Imports::FP_GetSysColor, Imports::GetSysColor, 0x7E140C); -ALIAS(Imports::FP_IsDlgButtonChecked, Imports::IsDlgButtonChecked, 0x7E1410); -ALIAS(Imports::FP_CheckDlgButton, Imports::CheckDlgButton, 0x7E1414); -ALIAS(Imports::FP_WaitForInputIdle, Imports::WaitForInputIdle, 0x7E1418); -ALIAS(Imports::FP_GetTopWindow, Imports::GetTopWindow, 0x7E141C); -ALIAS(Imports::FP_GetForegroundWindow, Imports::GetForegroundWindow, 0x7E1420); -ALIAS(Imports::FP_LoadIconA, Imports::LoadIconA, 0x7E1424); -ALIAS(Imports::FP_SetActiveWindow, Imports::SetActiveWindow, 0x7E1428); -ALIAS(Imports::FP_RedrawWindow, Imports::RedrawWindow, 0x7E142C); -ALIAS(Imports::FP_GetWindowContextHelpId, Imports::GetWindowContextHelpId, 0x7E1430); -ALIAS(Imports::FP_WinHelpA, Imports::WinHelpA, 0x7E1434); -ALIAS(Imports::FP_ChildWindowFromPoint, Imports::ChildWindowFromPoint, 0x7E1438); -ALIAS(Imports::FP_LoadCursorA, Imports::LoadCursorA, 0x7E143C); -ALIAS(Imports::FP_SetCursor, Imports::SetCursor, 0x7E1440); -ALIAS(Imports::FP_PostQuitMessage, Imports::PostQuitMessage, 0x7E1444); -ALIAS(Imports::FP_FindWindowA, Imports::FindWindowA, 0x7E1448); -ALIAS(Imports::FP_SetCursorPos, Imports::SetCursorPos, 0x7E144C); -#ifdef _MSVC -ALIAS(Imports::FP_CreateDialogIndirectParamA, Imports::CreateDialogIndirectParamA, 0x7E1450); -#endif -ALIAS(Imports::FP_GetKeyNameTextA, Imports::GetKeyNameTextA, 0x7E1454); -ALIAS(Imports::FP_ScreenToClient, Imports::ScreenToClient, 0x7E1458); -ALIAS(Imports::FP_LockWindowUpdate, Imports::LockWindowUpdate, 0x7E145C); -ALIAS(Imports::FP_MessageBoxA, Imports::MessageBoxA, 0x7E1460); -ALIAS(Imports::FP_ReleaseDC, Imports::ReleaseDC, 0x7E1464); -ALIAS(Imports::FP_WindowFromPoint, Imports::WindowFromPoint, 0x7E1468); -ALIAS(Imports::FP_UpdateWindow, Imports::UpdateWindow, 0x7E146C); -ALIAS(Imports::FP_SetWindowLongA, Imports::SetWindowLongA, 0x7E1470); -ALIAS(Imports::FP_GetWindowLongA, Imports::GetWindowLongA, 0x7E1474); -ALIAS(Imports::FP_ValidateRect, Imports::ValidateRect, 0x7E1478); -ALIAS(Imports::FP_IntersectRect, Imports::IntersectRect, 0x7E147C); -ALIAS(Imports::FP_MessageBoxIndirectA, Imports::MessageBoxIndirectA, 0x7E1480); -ALIAS(Imports::FP_PeekMessageA, Imports::PeekMessageA, 0x7E1484); -ALIAS(Imports::FP_CallWindowProcA, Imports::CallWindowProcA, 0x7E1488); -ALIAS(Imports::FP_KillTimer, Imports::KillTimer, 0x7E148C); -ALIAS(Imports::FP_SendDlgItemMessageA, Imports::SendDlgItemMessageA, 0x7E1490); -ALIAS(Imports::FP_SetTimer, Imports::SetTimer, 0x7E1494); -ALIAS(Imports::FP_ShowWindow, Imports::ShowWindow, 0x7E1498); -ALIAS(Imports::FP_InvalidateRect, Imports::InvalidateRect, 0x7E149C); -ALIAS(Imports::FP_EnableWindow, Imports::EnableWindow, 0x7E14A0); -ALIAS(Imports::FP_SendMessageA, Imports::SendMessageA, 0x7E14A4); -ALIAS(Imports::FP_GetDlgItem, Imports::GetDlgItem, 0x7E14A8); -ALIAS(Imports::FP_PostMessageA, Imports::PostMessageA, 0x7E14AC); -ALIAS(Imports::FP_wsprintfA, Imports::wsprintfA, 0x7E14B0); -ALIAS(Imports::FP_SetRect, Imports::SetRect, 0x7E14B4); -ALIAS(Imports::FP_ClientToScreen, Imports::ClientToScreen, 0x7E14B8); -ALIAS(Imports::FP_TranslateMessage, Imports::TranslateMessage, 0x7E14BC); -ALIAS(Imports::FP_DispatchMessageA, Imports::DispatchMessageA, 0x7E14C0); -ALIAS(Imports::FP_GetClientRect, Imports::GetClientRect, 0x7E14C4); -ALIAS(Imports::FP_GetWindow, Imports::GetWindow, 0x7E14C8); -ALIAS(Imports::FP_BringWindowToTop, Imports::BringWindowToTop, 0x7E14CC); -ALIAS(Imports::FP_SetForegroundWindow, Imports::SetForegroundWindow, 0x7E14D0); -ALIAS(Imports::FP_CreateWindowExA, Imports::CreateWindowExA, 0x7E14D4); -ALIAS(Imports::FP_RegisterClassA, Imports::RegisterClassA, 0x7E14D8); -ALIAS(Imports::FP_GetClassNameA, Imports::GetClassNameA, 0x7E14DC); -ALIAS(Imports::FP_IsWindowVisible, Imports::IsWindowVisible, 0x7E14E0); -ALIAS(Imports::FP_EnumChildWindows, Imports::EnumChildWindows, 0x7E14E4); -ALIAS(Imports::FP_IsWindowEnabled, Imports::IsWindowEnabled, 0x7E14E8); -ALIAS(Imports::FP_GetParent, Imports::GetParent, 0x7E14EC); -ALIAS(Imports::FP_GetNextDlgTabItem, Imports::GetNextDlgTabItem, 0x7E14F0); -ALIAS(Imports::FP_IsDialogMessageA, Imports::IsDialogMessageA, 0x7E14F4); -ALIAS(Imports::FP_TranslateAcceleratorA, Imports::TranslateAcceleratorA, 0x7E14F8); -ALIAS(Imports::FP_CharToOemBuffA, Imports::CharToOemBuffA, 0x7E14FC); -ALIAS(Imports::FP_BeginPaint, Imports::BeginPaint, 0x7E1500); -ALIAS(Imports::FP_EndPaint, Imports::EndPaint, 0x7E1504); -ALIAS(Imports::FP_CreateDialogParamA, Imports::CreateDialogParamA, 0x7E1508); -ALIAS(Imports::FP_GetWindowTextA, Imports::GetWindowTextA, 0x7E150C); -ALIAS(Imports::FP_RegisterHotKey, Imports::RegisterHotKey, 0x7E1510); -ALIAS(Imports::FP_InterlockedIncrement, Imports::InterlockedIncrement, 0x7E11C8); -ALIAS(Imports::FP_InterlockedDecrement, Imports::InterlockedDecrement, 0x7E11CC); - -#undef ALIAS - void SlaveManagerClass::ZeroOutSlaves() { for(const auto& pNode : this->SlaveNodes) { if(auto pSlave = pNode->Slave) { diff --git a/Unsorted.h b/Unsorted.h index d891552f..20416af8 100644 --- a/Unsorted.h +++ b/Unsorted.h @@ -169,322 +169,325 @@ class IIDs { // this class links to functions gamemd imports // to avoid having to link to their DLLs ourselves class Imports { +#define ALIAS(Obj, Addr)\ +static constexpr reference const Obj{} + public: // OleLoadFromStream typedef HRESULT(__stdcall* FP_OleSaveToStream)(LPPERSISTSTREAM pPStm, LPSTREAM pStm); - static FP_OleSaveToStream& OleSaveToStream; + ALIAS(OleSaveToStream, 0x7E15F4); typedef HRESULT (__stdcall * FP_OleLoadFromStream)(LPSTREAM pStm, const IID *const iidInterface, LPVOID *ppvObj); - static FP_OleLoadFromStream &OleLoadFromStream; + ALIAS(OleLoadFromStream, 0x7E15F8); typedef HRESULT(__stdcall* FP_CoRegisterClassObject)(const IID& rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister); - static FP_CoRegisterClassObject& CoRegisterClassObject; + ALIAS(CoRegisterClassObject, 0x7E15D8); typedef HRESULT(__stdcall* FP_CoRevokeClassObject)(DWORD dwRegister); - static FP_CoRevokeClassObject& CoRevokeClassObject; + ALIAS(CoRevokeClassObject, 0x7E15CC); typedef DWORD (* FP_TimeGetTime)(); - static FP_TimeGetTime &TimeGetTime; + ALIAS(TimeGetTime, 0x7E1530); /* user32.dll */ typedef LRESULT ( __stdcall * FP_DefWindowProcA)(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); - static FP_DefWindowProcA &DefWindowProcA; + ALIAS(DefWindowProcA, 0x7E1394); typedef BOOL ( __stdcall * FP_MoveWindow)(HWND hWnd, int X, int Y, int nWidth, int nHeight, BOOL bRepaint); - static FP_MoveWindow &MoveWindow; + ALIAS(MoveWindow, 0x7E1398); typedef BOOL ( __stdcall * FP_GetUpdateRect)(HWND hWnd, LPRECT lpRect, BOOL bErase); - static FP_GetUpdateRect &GetUpdateRect; + ALIAS(GetUpdateRect, 0x7E139C); typedef HWND ( * FP_GetFocus)(void); - static FP_GetFocus &GetFocus; + ALIAS(GetFocus, 0x7E13A0); typedef HDC ( __stdcall * FP_GetDC)(HWND hWnd); - static FP_GetDC &GetDC; + ALIAS(GetDC, 0x7E13A4); typedef SHORT ( __stdcall * FP_GetKeyState)(int nVirtKey); - static FP_GetKeyState &GetKeyState; + ALIAS(GetKeyState, 0x7E13A8); typedef HWND ( * FP_GetActiveWindow)(void); - static FP_GetActiveWindow &GetActiveWindow; + ALIAS(GetActiveWindow, 0x7E13AC); typedef HWND ( * FP_GetCapture)(void); - static FP_GetCapture &GetCapture; + ALIAS(GetCapture, 0x7E13B0); typedef int ( __stdcall * FP_GetDlgCtrlID)(HWND hWnd); - static FP_GetDlgCtrlID &GetDlgCtrlID; + ALIAS(GetDlgCtrlID, 0x7E13B4); typedef HWND ( __stdcall * FP_ChildWindowFromPointEx)(HWND, POINT, UINT); - static FP_ChildWindowFromPointEx &ChildWindowFromPointEx; + ALIAS(ChildWindowFromPointEx, 0x7E13B8); typedef BOOL ( __stdcall * FP_GetWindowRect)(HWND hWnd, LPRECT lpRect); - static FP_GetWindowRect &GetWindowRect; + ALIAS(GetWindowRect, 0x7E13BC); typedef BOOL ( __stdcall * FP_GetCursorPos)(LPPOINT lpPoint); - static FP_GetCursorPos &GetCursorPos; + ALIAS(GetCursorPos, 0x7E13C0); typedef BOOL ( __stdcall * FP_CloseWindow)(HWND hWnd); - static FP_CloseWindow &CloseWindow; + ALIAS(CloseWindow, 0x7E13C4); typedef BOOL ( __stdcall * FP_EndDialog)(HWND hDlg, int nResult); - static FP_EndDialog &EndDialog; + ALIAS(EndDialog, 0x7E13C8); typedef HWND ( __stdcall * FP_SetFocus)(HWND hWnd); - static FP_SetFocus &SetFocus; + ALIAS(SetFocus, 0x7E13CC); typedef BOOL ( __stdcall * FP_SetDlgItemTextA)(HWND hDlg, int nIDDlgItem, LPCSTR lpString); - static FP_SetDlgItemTextA &SetDlgItemTextA; + ALIAS(SetDlgItemTextA, 0x7E13D0); typedef int ( __stdcall * FP_DialogBoxParamA)(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); - static FP_DialogBoxParamA &DialogBoxParamA; + ALIAS(DialogBoxParamA, 0x7E13D4); #ifdef _MSVC typedef int ( __stdcall * FP_DialogBoxIndirectParamA)(HINSTANCE hInstance, LPCDLGTEMPLATEA hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); - static FP_DialogBoxIndirectParamA &DialogBoxIndirectParamA; + ALIAS(DialogBoxIndirectParamA, 0x7E13D8); #endif typedef int ( __stdcall * FP_ShowCursor)(BOOL bShow); - static FP_ShowCursor &ShowCursor; + ALIAS(ShowCursor, 0x7E13DC); typedef SHORT ( __stdcall * FP_GetAsyncKeyState)(int vKey); - static FP_GetAsyncKeyState &GetAsyncKeyState; + ALIAS(GetAsyncKeyState, 0x7E13E0); typedef int ( __stdcall * FP_ToAscii)(UINT uVirtKey, UINT uScanCode, PBYTE lpKeyState, LPWORD lpChar, UINT uFlags); - static FP_ToAscii &ToAscii; + ALIAS(ToAscii, 0x7E13E4); typedef UINT ( __stdcall * FP_MapVirtualKeyA)(UINT uCode, UINT uMapType); - static FP_MapVirtualKeyA &MapVirtualKeyA; + ALIAS(MapVirtualKeyA, 0x7E13E8); typedef int ( __stdcall * FP_GetSystemMetrics)(int nIndex); - static FP_GetSystemMetrics &GetSystemMetrics; + ALIAS(GetSystemMetrics, 0x7E13EC); typedef BOOL ( __stdcall * FP_SetWindowPos)(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags); - static FP_SetWindowPos &SetWindowPos; + ALIAS(SetWindowPos, 0x7E13F0); typedef BOOL ( __stdcall * FP_DestroyWindow)(HWND hWnd); - static FP_DestroyWindow &DestroyWindow; + ALIAS(DestroyWindow, 0x7E13F4); typedef BOOL ( * FP_ReleaseCapture)(void); - static FP_ReleaseCapture &ReleaseCapture; + ALIAS(ReleaseCapture, 0x7E13F8); typedef HWND ( __stdcall * FP_SetCapture)(HWND hWnd); - static FP_SetCapture &SetCapture; + ALIAS(SetCapture, 0x7E13FC); typedef BOOL ( __stdcall * FP_AdjustWindowRectEx)(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle); - static FP_AdjustWindowRectEx &AdjustWindowRectEx; + ALIAS(AdjustWindowRectEx, 0x7E1400); typedef HMENU ( __stdcall * FP_GetMenu)(HWND hWnd); - static FP_GetMenu &GetMenu; + ALIAS(GetMenu, 0x7E1404); typedef BOOL ( __stdcall * FP_AdjustWindowRect)(LPRECT lpRect, DWORD dwStyle, BOOL bMenu); - static FP_AdjustWindowRect &AdjustWindowRect; + ALIAS(AdjustWindowRect, 0x7E1408); typedef DWORD ( __stdcall * FP_GetSysColor)(int nIndex); - static FP_GetSysColor &GetSysColor; + ALIAS(GetSysColor, 0x7E140C); typedef UINT ( __stdcall * FP_IsDlgButtonChecked)(HWND hDlg, int nIDButton); - static FP_IsDlgButtonChecked &IsDlgButtonChecked; + ALIAS(IsDlgButtonChecked, 0x7E1410); typedef BOOL ( __stdcall * FP_CheckDlgButton)(HWND hDlg, int nIDButton, UINT uCheck); - static FP_CheckDlgButton &CheckDlgButton; + ALIAS(CheckDlgButton, 0x7E1414); typedef DWORD ( __stdcall * FP_WaitForInputIdle)(HANDLE hProcess, DWORD dwMilliseconds); - static FP_WaitForInputIdle &WaitForInputIdle; + ALIAS(WaitForInputIdle, 0x7E1418); typedef HWND ( __stdcall * FP_GetTopWindow)(HWND hWnd); - static FP_GetTopWindow &GetTopWindow; + ALIAS(GetTopWindow, 0x7E141C); typedef HWND ( * FP_GetForegroundWindow)(void); - static FP_GetForegroundWindow &GetForegroundWindow; + ALIAS(GetForegroundWindow, 0x7E1420); typedef HICON ( __stdcall * FP_LoadIconA)(HINSTANCE hInstance, LPCSTR lpIconName); - static FP_LoadIconA &LoadIconA; + ALIAS(LoadIconA, 0x7E1424); typedef HWND ( __stdcall * FP_SetActiveWindow)(HWND hWnd); - static FP_SetActiveWindow &SetActiveWindow; + ALIAS(SetActiveWindow, 0x7E1428); typedef BOOL ( __stdcall * FP_RedrawWindow)(HWND hWnd, const RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags); - static FP_RedrawWindow &RedrawWindow; + ALIAS(RedrawWindow, 0x7E142C); typedef DWORD ( __stdcall * FP_GetWindowContextHelpId)(HWND); - static FP_GetWindowContextHelpId &GetWindowContextHelpId; + ALIAS(GetWindowContextHelpId, 0x7E1430); typedef BOOL ( __stdcall * FP_WinHelpA)(HWND hWndMain, LPCSTR lpszHelp, UINT uCommand, DWORD dwData); - static FP_WinHelpA &WinHelpA; + ALIAS(WinHelpA, 0x7E1434); typedef HWND ( __stdcall * FP_ChildWindowFromPoint)(HWND hWndParent, POINT Point); - static FP_ChildWindowFromPoint &ChildWindowFromPoint; + ALIAS(ChildWindowFromPoint, 0x7E1438); typedef HCURSOR ( __stdcall * FP_LoadCursorA)(HINSTANCE hInstance, LPCSTR lpCursorName); - static FP_LoadCursorA &LoadCursorA; + ALIAS(LoadCursorA, 0x7E143C); typedef HCURSOR ( __stdcall * FP_SetCursor)(HCURSOR hCursor); - static FP_SetCursor &SetCursor; + ALIAS(SetCursor, 0x7E1440); typedef void ( __stdcall * FP_PostQuitMessage)(int nExitCode); - static FP_PostQuitMessage &PostQuitMessage; + ALIAS(PostQuitMessage, 0x7E1444); typedef HWND ( __stdcall * FP_FindWindowA)(LPCSTR lpClassName, LPCSTR lpWindowName); - static FP_FindWindowA &FindWindowA; + ALIAS(FindWindowA, 0x7E1448); typedef BOOL ( __stdcall * FP_SetCursorPos)(int X, int Y); - static FP_SetCursorPos &SetCursorPos; + ALIAS(SetCursorPos, 0x7E144C); #ifdef _MSVC typedef HWND ( __stdcall * FP_CreateDialogIndirectParamA)(HINSTANCE hInstance, LPCDLGTEMPLATEA lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); - static FP_CreateDialogIndirectParamA &CreateDialogIndirectParamA; + ALIAS(CreateDialogIndirectParamA, 0x7E1450); #endif typedef int ( __stdcall * FP_GetKeyNameTextA)(LONG lParam, LPSTR lpString, int nSize); - static FP_GetKeyNameTextA &GetKeyNameTextA; + ALIAS(GetKeyNameTextA, 0x7E1454); typedef BOOL ( __stdcall * FP_ScreenToClient)(HWND hWnd, LPPOINT lpPoint); - static FP_ScreenToClient &ScreenToClient; + ALIAS(ScreenToClient, 0x7E1458); typedef BOOL ( __stdcall * FP_LockWindowUpdate)(HWND hWndLock); - static FP_LockWindowUpdate &LockWindowUpdate; + ALIAS(LockWindowUpdate, 0x7E145C); typedef int ( __stdcall * FP_MessageBoxA)(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType); - static FP_MessageBoxA &MessageBoxA; + ALIAS(MessageBoxA, 0x7E1460); typedef int ( __stdcall * FP_ReleaseDC)(HWND hWnd, HDC hDC); - static FP_ReleaseDC &ReleaseDC; + ALIAS(ReleaseDC, 0x7E1464); typedef HWND ( __stdcall * FP_WindowFromPoint)(POINT Point); - static FP_WindowFromPoint &WindowFromPoint; + ALIAS(WindowFromPoint, 0x7E1468); typedef BOOL ( __stdcall * FP_UpdateWindow)(HWND hWnd); - static FP_UpdateWindow &UpdateWindow; + ALIAS(UpdateWindow, 0x7E146C); typedef LONG ( __stdcall * FP_SetWindowLongA)(HWND hWnd, int nIndex, LONG dwNewLong); - static FP_SetWindowLongA &SetWindowLongA; + ALIAS(SetWindowLongA, 0x7E1470); typedef LONG ( __stdcall * FP_GetWindowLongA)(HWND hWnd, int nIndex); - static FP_GetWindowLongA &GetWindowLongA; + ALIAS(GetWindowLongA, 0x7E1474); typedef BOOL ( __stdcall * FP_ValidateRect)(HWND hWnd, const RECT *lpRect); - static FP_ValidateRect &ValidateRect; + ALIAS(ValidateRect, 0x7E1478); typedef BOOL ( __stdcall * FP_IntersectRect)(LPRECT lprcDst, const RECT *lprcSrc1, const RECT *lprcSrc2); - static FP_IntersectRect &IntersectRect; + ALIAS(IntersectRect, 0x7E147C); typedef int ( __stdcall * FP_MessageBoxIndirectA)(LPMSGBOXPARAMSA); - static FP_MessageBoxIndirectA &MessageBoxIndirectA; + ALIAS(MessageBoxIndirectA, 0x7E1480); typedef BOOL ( __stdcall * FP_PeekMessageA)(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg); - static FP_PeekMessageA &PeekMessageA; + ALIAS(PeekMessageA, 0x7E1484); typedef LRESULT ( __stdcall * FP_CallWindowProcA)(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); - static FP_CallWindowProcA &CallWindowProcA; + ALIAS(CallWindowProcA, 0x7E1488); typedef BOOL ( __stdcall * FP_KillTimer)(HWND hWnd, UINT uIDEvent); - static FP_KillTimer &KillTimer; + ALIAS(KillTimer, 0x7E148C); typedef LONG ( __stdcall * FP_SendDlgItemMessageA)(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam); - static FP_SendDlgItemMessageA &SendDlgItemMessageA; + ALIAS(SendDlgItemMessageA, 0x7E1490); typedef UINT ( __stdcall * FP_SetTimer)(HWND hWnd, UINT nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc); - static FP_SetTimer &SetTimer; + ALIAS(SetTimer, 0x7E1494); typedef BOOL ( __stdcall * FP_ShowWindow)(HWND hWnd, int nCmdShow); - static FP_ShowWindow &ShowWindow; + ALIAS(ShowWindow, 0x7E1498); typedef BOOL ( __stdcall * FP_InvalidateRect)(HWND hWnd, const RECT *lpRect, BOOL bErase); - static FP_InvalidateRect &InvalidateRect; + ALIAS(InvalidateRect, 0x7E149C); typedef BOOL ( __stdcall * FP_EnableWindow)(HWND hWnd, BOOL bEnable); - static FP_EnableWindow &EnableWindow; + ALIAS(EnableWindow, 0x7E14A0); typedef LRESULT ( __stdcall * FP_SendMessageA)(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); - static FP_SendMessageA &SendMessageA; + ALIAS(SendMessageA, 0x7E14A4); typedef HWND ( __stdcall * FP_GetDlgItem)(HWND hDlg, int nIDDlgItem); - static FP_GetDlgItem &GetDlgItem; + ALIAS(GetDlgItem, 0x7E14A8); typedef BOOL ( __stdcall * FP_PostMessageA)(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); - static FP_PostMessageA &PostMessageA; + ALIAS(PostMessageA, 0x7E14AC); typedef int ( * FP_wsprintfA)(LPSTR, LPCSTR, ...); - static FP_wsprintfA &wsprintfA; + ALIAS(wsprintfA, 0x7E14B0); typedef BOOL ( __stdcall * FP_SetRect)(LPRECT lprc, int xLeft, int yTop, int xRight, int yBottom); - static FP_SetRect &SetRect; + ALIAS(SetRect, 0x7E14B4); typedef BOOL ( __stdcall * FP_ClientToScreen)(HWND hWnd, LPPOINT lpPoint); - static FP_ClientToScreen &ClientToScreen; + ALIAS(ClientToScreen, 0x7E14B8); typedef BOOL ( __stdcall * FP_TranslateMessage)(const MSG *lpMsg); - static FP_TranslateMessage &TranslateMessage; + ALIAS(TranslateMessage, 0x7E14BC); typedef LONG ( __stdcall * FP_DispatchMessageA)(const MSG *lpMsg); - static FP_DispatchMessageA &DispatchMessageA; + ALIAS(DispatchMessageA, 0x7E14C0); typedef BOOL ( __stdcall * FP_GetClientRect)(HWND hWnd, LPRECT lpRect); - static FP_GetClientRect &GetClientRect; + ALIAS(GetClientRect, 0x7E14C4); typedef HWND ( __stdcall * FP_GetWindow)(HWND hWnd, UINT uCmd); - static FP_GetWindow &GetWindow; + ALIAS(GetWindow, 0x7E14C8); typedef BOOL ( __stdcall * FP_BringWindowToTop)(HWND hWnd); - static FP_BringWindowToTop &BringWindowToTop; + ALIAS(BringWindowToTop, 0x7E14CC); typedef BOOL ( __stdcall * FP_SetForegroundWindow)(HWND hWnd); - static FP_SetForegroundWindow &SetForegroundWindow; + ALIAS(SetForegroundWindow, 0x7E14D0); typedef HWND ( __stdcall * FP_CreateWindowExA)(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam); - static FP_CreateWindowExA &CreateWindowExA; + ALIAS(CreateWindowExA, 0x7E14D4); typedef ATOM ( __stdcall * FP_RegisterClassA)(const WNDCLASSA *lpWndClass); - static FP_RegisterClassA &RegisterClassA; + ALIAS(RegisterClassA, 0x7E14D8); typedef int ( __stdcall * FP_GetClassNameA)(HWND hWnd, LPSTR lpClassName, int nMaxCount); - static FP_GetClassNameA &GetClassNameA; + ALIAS(GetClassNameA, 0x7E14DC); typedef BOOL ( __stdcall * FP_IsWindowVisible)(HWND hWnd); - static FP_IsWindowVisible &IsWindowVisible; + ALIAS(IsWindowVisible, 0x7E14E0); typedef BOOL ( __stdcall * FP_EnumChildWindows)(HWND hWndParent, WNDENUMPROC lpEnumFunc, LPARAM lParam); - static FP_EnumChildWindows &EnumChildWindows; + ALIAS(EnumChildWindows, 0x7E14E4); typedef BOOL ( __stdcall * FP_IsWindowEnabled)(HWND hWnd); - static FP_IsWindowEnabled &IsWindowEnabled; + ALIAS(IsWindowEnabled, 0x7E14E8); typedef HWND ( __stdcall * FP_GetParent)(HWND hWnd); - static FP_GetParent &GetParent; + ALIAS(GetParent, 0x7E14EC); typedef HWND ( __stdcall * FP_GetNextDlgTabItem)(HWND hDlg, HWND hCtl, BOOL bPrevious); - static FP_GetNextDlgTabItem &GetNextDlgTabItem; + ALIAS(GetNextDlgTabItem, 0x7E14F0); typedef BOOL ( __stdcall * FP_IsDialogMessageA)(HWND hDlg, LPMSG lpMsg); - static FP_IsDialogMessageA &IsDialogMessageA; + ALIAS(IsDialogMessageA, 0x7E14F4); typedef int ( __stdcall * FP_TranslateAcceleratorA)(HWND hWnd, HACCEL hAccTable, LPMSG lpMsg); - static FP_TranslateAcceleratorA &TranslateAcceleratorA; + ALIAS(TranslateAcceleratorA, 0x7E14F8); typedef BOOL ( __stdcall * FP_CharToOemBuffA)(LPCSTR lpszSrc, LPSTR lpszDst, DWORD cchDstLength); - static FP_CharToOemBuffA &CharToOemBuffA; + ALIAS(CharToOemBuffA, 0x7E14FC); typedef HDC ( __stdcall * FP_BeginPaint)(HWND hWnd, LPPAINTSTRUCT lpPaint); - static FP_BeginPaint &BeginPaint; + ALIAS(BeginPaint, 0x7E1500); typedef BOOL ( __stdcall * FP_EndPaint)(HWND hWnd, const PAINTSTRUCT *lpPaint); - static FP_EndPaint &EndPaint; + ALIAS(EndPaint, 0x7E1504); typedef HWND ( __stdcall * FP_CreateDialogParamA)(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); - static FP_CreateDialogParamA &CreateDialogParamA; + ALIAS(CreateDialogParamA, 0x7E1508); typedef int ( __stdcall * FP_GetWindowTextA)(HWND hWnd, LPSTR lpString, int nMaxCount); - static FP_GetWindowTextA &GetWindowTextA; + ALIAS(GetWindowTextA, 0x7E150C); typedef BOOL ( __stdcall * FP_RegisterHotKey)(HWND hWnd, int id, UINT fsModifiers, UINT vk); - static FP_RegisterHotKey &RegisterHotKey; + ALIAS(RegisterHotKey, 0x7E1510); typedef LONG(__stdcall* FP_InterlockedIncrement)(void* lpAddend); - static FP_InterlockedIncrement& InterlockedIncrement; + ALIAS(InterlockedIncrement, 0x7E11C8); typedef LONG(__stdcall* FP_InterlockedDecrement)(void* lpAddend); - static FP_InterlockedDecrement& InterlockedDecrement; - + ALIAS(InterlockedDecrement, 0x7E11CC); +#undef ALIAS }; class MovieInfo diff --git a/YRCom.h b/YRCom.h index 5d9403e3..c8500805 100644 --- a/YRCom.h +++ b/YRCom.h @@ -90,12 +90,12 @@ class TClassFactory : public IClassFactory virtual ULONG __stdcall AddRef() override { - return Imports::InterlockedIncrement(&this->nRefCount); + return Imports::InterlockedIncrement()(&this->nRefCount); } virtual ULONG __stdcall Release() override { - int nNewRef = Imports::InterlockedIncrement(&this->nRefCount); + int nNewRef = Imports::InterlockedIncrement()(&this->nRefCount); if (!nNewRef) GameDelete(this); return nNewRef; @@ -131,4 +131,4 @@ class TClassFactory : public IClassFactory private: int nRefCount {0}; -}; \ No newline at end of file +};