Skip to content

Commit

Permalink
Implement some missing function wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNNX committed Apr 18, 2024
1 parent 1fca968 commit 5fb2efd
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 4 deletions.
8 changes: 4 additions & 4 deletions COREDLL/Exports.def
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ EXPORTS
EqualRgn @91
CreateAcceleratorTableW @92
DestroyAcceleratorTable @93
LoadAcceleratorsW @94
LoadAcceleratorsW = LoadAcceleratorsW_WCECL @94
RegisterClassW = RegisterClassW_WCECL @95
CopyRect = CopyRect_WCECL @96
EqualRect @97
Expand Down Expand Up @@ -427,14 +427,14 @@ EXPORTS
GetMouseMovePoints = GetMouseMovePoints_WCECL @820
GetAsyncKeyState = GetAsyncKeyState_WCECL @826
RegisterHotKey @835
TranslateAcceleratorW @838
TranslateAcceleratorW = TranslateAcceleratorW_WCECL @838
InsertMenuW @841
AppendMenuW = AppendMenuW_WCECL @842
RemoveMenu @843
DestroyMenu @844
TrackPopupMenuEx @845
LoadMenuW @846
EnableMenuItem @847
EnableMenuItem = EnableMenuItem_WCECL @847
CheckMenuItem @848
CheckMenuRadioItem = CheckMenuRadioItem_WCECL @849
DeleteMenu @850
Expand Down Expand Up @@ -538,7 +538,7 @@ EXPORTS
StartPage = StartPage_WCECL @964
EnumFontFamiliesW = EnumFontFamiliesW_WCECL @965
GetTextFaceW @967
CombineRgn @968
CombineRgn = CombineRgn_WCECL @968
CreateRectRgnIndirect = CreateRectRgnIndirect_WCECL @969
ExcludeClipRect @970
GetClipBox = GetClipBox_WCECL @971
Expand Down
20 changes: 20 additions & 0 deletions COREDLL/freecell_support_wip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,4 +668,24 @@ void WINAPI OutputDebugStringW_WCECL(LPCWSTR str)
BOOL WINAPI PatBlt_WCECL(HDC hdc, int x, int y, int w, int h, DWORD rop)
{
return PatBlt(hdc, x, y, w, h, rop);
}

HACCEL WINAPI LoadAcceleratorsW_WCECL(HINSTANCE hInstance, LPCWSTR lpTableName)
{
return LoadAcceleratorsW(hInstance, lpTableName);
}

int WINAPI TranslateAcceleratorW_WCECL(HWND hWnd, HACCEL hAccelTable, LPMSG lpMsg)
{
return TranslateAcceleratorW(hWnd, hAccelTable, lpMsg);
}

BOOL WINAPI EnableMenuItem_WCECL(HMENU hMenu, UINT uIDEnableItem, UINT uEnable)
{
return EnableMenuItem(hMenu, uIDEnableItem, uEnable);
}

int WINAPI CombineRgn_WCECL(HRGN hrgnDst, HRGN hrgnSrc1, HRGN hrgnSrc2, int iMode)
{
return CombineRgn(hrgnDst, hrgnSrc1, hrgnSrc2, iMode);
}
37 changes: 37 additions & 0 deletions COREDLL/winuser_wcecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "stdafx.h"
#include "winuser_wcecl.h"
#include <map>
#include <assert.h>

#define OK_BUTTON_UNIMPLEMENTED

Expand Down Expand Up @@ -107,12 +108,41 @@ BOOL WINAPI IsDialogMessageW_WCECL(
return result;
}

/* Checks if the parameter Param is not in memory occupied by the output
parameter outParam. */
template<typename T1, typename T2>
static BOOL CheckOutParam(const T1* outParam, const T2& Param)
{
SIZE_T outParamSize = sizeof(T1);
ULONG_PTR outParamPtr = (ULONG_PTR)outParam;
ULONG_PTR paramPtr = (ULONG_PTR)&Param;

if (paramPtr >= outParamPtr && paramPtr < outParamPtr + outParamSize)
{
assert(FALSE);
}

paramPtr += sizeof(T2) - 1;
if (paramPtr >= outParamPtr && paramPtr < outParamPtr + outParamSize)
{
assert(FALSE);
}

return TRUE;
}


BOOL WINAPI GetMessageW_WCECL(
LPMSG lpMsg,
HWND hWnd,
UINT wMsgFilterMin,
UINT wMsgFilterMax)
{
assert(CheckOutParam(lpMsg, lpMsg));
assert(CheckOutParam(lpMsg, hWnd));
assert(CheckOutParam(lpMsg, wMsgFilterMin));
assert(CheckOutParam(lpMsg, wMsgFilterMax));

auto result = GetMessageW(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
return result;
}
Expand Down Expand Up @@ -716,6 +746,13 @@ LRESULT WINAPI SendMessageW_WCECL(
WPARAM wParam,
LPARAM lParam)
{
if (Msg == WM_USER + 81)
{
/* TODO */
//Msg = TB_SETTOOLTIPS;
return 0;
}

auto result = SendMessageW(hWnd, Msg, wParam, lParam);
return result;
}
Expand Down

0 comments on commit 5fb2efd

Please sign in to comment.