From a3feee8027d1c0df7380c9a67b42dde2d8f631cb Mon Sep 17 00:00:00 2001 From: ehouse Date: Sat, 28 Jan 2006 18:58:04 +0000 Subject: [PATCH] first checked in. may have bugs --- xwords4/wince/debhacks.c | 52 ++++++++++++++++++++++++++++++++++++++++ xwords4/wince/debhacks.h | 40 +++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 xwords4/wince/debhacks.c create mode 100644 xwords4/wince/debhacks.h diff --git a/xwords4/wince/debhacks.c b/xwords4/wince/debhacks.c new file mode 100644 index 000000000..98f963901 --- /dev/null +++ b/xwords4/wince/debhacks.c @@ -0,0 +1,52 @@ + +#ifdef USE_DEB_HACKS + +#include "xptypes.h" +#include "debhacks.h" + +wchar_t* +DH(lstrcat)(wchar_t *s1, const wchar_t* s2) +{ + return wcscat( s1, s2 ); +} + +wchar_t* +DH(lstrcpy)(wchar_t* dest, const wchar_t* src) +{ + return wcscpy( dest, src ); +} + +int +DH(DialogBoxParam)( HINSTANCE hinst, LPCWSTR name, HWND hwnd, + DLGPROC proc, LPARAM lparam ) +{ + HRSRC resstr = FindResource( hinst, name, RT_DIALOG ); + HGLOBAL lr = LoadResource( hinst, resstr ); + return DialogBoxIndirectParamW(hinst, lr, hwnd, proc, lparam ); +} + +BOOL +DH(GetTextExtentPoint32)( HDC hdc, LPCWSTR str, int i, LPSIZE siz ) +{ + return GetTextExtentExPointW(hdc, str, i, 0, NULL, NULL, siz ); +} + +BOOL +DH(SetEvent)(HANDLE h) +{ + return FALSE; +} + +BOOL +DH(ResetEvent)(HANDLE h) +{ + return FALSE; +} + +DWORD +DH(GetCurrentThreadId)(void) +{ + return 0; +} + +#endif diff --git a/xwords4/wince/debhacks.h b/xwords4/wince/debhacks.h new file mode 100644 index 000000000..e09d0bb10 --- /dev/null +++ b/xwords4/wince/debhacks.h @@ -0,0 +1,40 @@ + + +#ifndef _DEBHACKS_H_ +#define _DEBHACKS_H_ + +#ifdef USE_DEB_HACKS + +#define MS(func) M$_##func +#define DH(func) debhack_##func + + +typedef struct DH(WIN32_FIND_DATA) { + DWORD dwFileAttributes; + FILETIME dh_ftCreationTime; + FILETIME dh_ftLastAccessTime; + FILETIME dh_ftLastWriteTime; + DWORD dh_nFileSizeHigh; + DWORD dh_nFileSizeLow; + DWORD dh_dwReserved1; + WCHAR cFileName[MAX_PATH]; +} DH(WIN32_FIND_DATA); + +wchar_t* DH(lstrcat)(wchar_t *s1, const wchar_t* s2); +wchar_t* DH(lstrcpy)(wchar_t* dest, const wchar_t* src); +int DH(DialogBoxParam)( HINSTANCE hinst, LPCWSTR str, HWND hwnd, + DLGPROC proc, LPARAM lparam ); +BOOL DH(GetTextExtentPoint32)( HDC,LPCWSTR,int,LPSIZE); +DWORD DH(GetCurrentThreadId)(void); +BOOL DH(SetEvent)(HANDLE); +BOOL DH(ResetEvent)(HANDLE); + + +#else + +#define MS(func) func +#define DH(func) func + +#endif + +#endif