From 74ff28452fd3b52bc813ccd08ab78c3a79e88fe8 Mon Sep 17 00:00:00 2001 From: Royce Mitchell III Date: Thu, 7 Aug 2003 04:03:25 +0000 Subject: [PATCH] * added _DISABLE_TIDENTS macro to disable any ANSI/UNICODE ambiguous elements from the header files. * enabled _DISABLE_TIDENTS for most ReactOS OS components. * fixed all errors that resulted from this change * a few small bugfixes along the way svn path=/trunk/; revision=5449 --- reactos/hal/halx86/Makefile | 5 +- reactos/include/ascii.h | 36 +-- reactos/include/base.h | 134 ++++++++--- reactos/include/defines.h | 127 +++++++--- reactos/include/funcs.h | 34 ++- reactos/include/messages.h | 28 +++ reactos/include/structs.h | 45 ++-- reactos/include/unicode.h | 30 ++- reactos/include/win32k/icm.h | 6 +- reactos/include/win32k/ntuser.h | 2 + reactos/include/winsock2.h | 94 +++++++- reactos/include/ws2spi.h | 2 +- reactos/lib/advapi32/makefile | 5 +- reactos/lib/advapi32/service/scm.c | 300 +++++++++++++----------- reactos/lib/advapi32/service/sctrl.c | 12 +- reactos/lib/crtdll/makefile | 5 +- reactos/lib/crtdll/sys_stat/stat.c | 4 +- reactos/lib/epsapi/makefile | 5 +- reactos/lib/fmifs/makefile | 5 +- reactos/lib/freetype/Makefile | 5 +- reactos/lib/fslib/vfatlib/Makefile | 5 +- reactos/lib/gdi32/makefile | 5 +- reactos/lib/gdi32/misc/stubsa.c | 18 +- reactos/lib/gdi32/misc/stubsw.c | 21 +- reactos/lib/gdi32/objects/text.c | 2 +- reactos/lib/iphlpapi/iphlpapi.c | 132 ++++++----- reactos/lib/iphlpapi/makefile | 3 + reactos/lib/iprtprio/makefile | 3 + reactos/lib/kbdus/makefile | 5 +- reactos/lib/kernel32/file/find.c | 4 +- reactos/lib/kernel32/makefile | 5 +- reactos/lib/kernel32/misc/error.c | 4 +- reactos/lib/kernel32/misc/errormsg.c | 39 ++- reactos/lib/kernel32/misc/mbchars.c | 4 +- reactos/lib/kernel32/misc/res.c | 54 ++--- reactos/lib/kernel32/misc/stubs.c | 48 ++-- reactos/lib/lzexpand/Makefile | 3 + reactos/lib/msafd/makefile | 5 +- reactos/lib/msvcrt/Makefile | 5 +- reactos/lib/msvcrt/misc/cpp.c | 6 +- reactos/lib/msvcrt/misc/getargs.c | 4 +- reactos/lib/ntdll/makefile | 5 +- reactos/lib/ole32/makefile | 5 +- reactos/lib/oleaut32/makefile | 5 +- reactos/lib/psapi/makefile | 5 +- reactos/lib/rosrtl/makefile | 5 +- reactos/lib/rpcrt4/Makefile | 5 +- reactos/lib/rpcrt4/midl/Makefile | 5 +- reactos/lib/secur32/Makefile | 5 +- reactos/lib/snmpapi/makefile | 3 + reactos/lib/string/Makefile | 5 +- reactos/lib/syssetup/Makefile | 5 +- reactos/lib/syssetup/install.c | 6 +- reactos/lib/tgetopt/Makefile | 5 +- reactos/lib/twain/Makefile | 5 +- reactos/lib/user32/Makefile | 5 +- reactos/lib/user32/controls/scrollbar.c | 4 +- reactos/lib/user32/misc/resources.c | 4 +- reactos/lib/user32/misc/winhelp.c | 4 +- reactos/lib/user32/misc/winsta.c | 6 +- reactos/lib/user32/user32.def | 1 - reactos/lib/user32/user32.edf | 1 - reactos/lib/user32/windows/bitmap.c | 20 +- reactos/lib/user32/windows/class.c | 95 ++++---- reactos/lib/user32/windows/defwnd.c | 299 ++++++++++++----------- reactos/lib/user32/windows/menu.c | 27 ++- reactos/lib/user32/windows/messagebox.c | 8 +- reactos/lib/user32/windows/nonclient.c | 8 +- reactos/lib/user32/windows/prop.c | 10 +- reactos/lib/user32/windows/window.c | 45 ++-- reactos/lib/user32/windows/winpos.c | 10 +- reactos/lib/version/makefile | 5 +- reactos/lib/winedbgc/Makefile | 5 +- reactos/lib/winmm/Makefile | 3 + reactos/lib/winspool/Makefile | 5 +- reactos/lib/ws2_32/makefile | 5 +- reactos/lib/ws2_32/misc/event.c | 4 +- reactos/lib/ws2help/makefile | 3 + reactos/lib/wshirda/makefile | 3 + reactos/lib/wsock32/Makefile | 5 +- reactos/lib/wsock32/stubs.c | 138 +++++------ reactos/lib/zlib/Makefile | 5 +- reactos/ntoskrnl/Makefile | 5 +- reactos/subsys/csrss/makefile | 5 +- reactos/subsys/ntvdm/makefile | 5 +- reactos/subsys/ntvdm/ntvdm.c | 32 +-- reactos/subsys/smss/makefile | 5 +- reactos/subsys/win32k/include/class.h | 2 +- reactos/subsys/win32k/include/menu.h | 3 +- reactos/subsys/win32k/makefile | 7 +- reactos/subsys/win32k/ntuser/class.c | 116 ++++----- reactos/subsys/win32k/objects/icm.c | 14 +- 92 files changed, 1342 insertions(+), 908 deletions(-) diff --git a/reactos/hal/halx86/Makefile b/reactos/hal/halx86/Makefile index b8d26a27ce8..3447f39d298 100644 --- a/reactos/hal/halx86/Makefile +++ b/reactos/hal/halx86/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.10 2003/06/19 16:00:03 gvg Exp $ +# $Id: Makefile,v 1.11 2003/08/07 04:03:22 royce Exp $ PATH_TO_TOP = ../.. @@ -28,6 +28,9 @@ TARGET_ASFLAGS = -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/ntoskrnl/include -D__ TARGET_CFLAGS = -I./include -I$(PATH_TO_TOP)/ntoskrnl/include -g +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_NAME_UP = halx86up diff --git a/reactos/include/ascii.h b/reactos/include/ascii.h index 879d35c3997..259ca8b0fa9 100644 --- a/reactos/include/ascii.h +++ b/reactos/include/ascii.h @@ -292,7 +292,7 @@ WINBOOL STDCALL EnumResourceTypesA( HINSTANCE hModule, - ENUMRESTYPEPROC lpEnumFunc, + ENUMRESTYPEPROCA lpEnumFunc, LONG lParam ); @@ -301,7 +301,7 @@ STDCALL EnumResourceNamesA( HINSTANCE hModule, LPCSTR lpType, - ENUMRESNAMEPROC lpEnumFunc, + ENUMRESNAMEPROCA lpEnumFunc, LONG lParam ); @@ -311,7 +311,7 @@ EnumResourceLanguagesA( HINSTANCE hModule, LPCSTR lpType, LPCSTR lpName, - ENUMRESLANGPROC lpEnumFunc, + ENUMRESLANGPROCA lpEnumFunc, LONG lParam ); @@ -1069,7 +1069,7 @@ CreateWindowStationA( HANDLE STDCALL CreateWaitableTimerA( LPSECURITY_ATTRIBUTES Attributes, BOOL ManualReset, - LPCTSTR Name ); + LPCSTR Name ); HWINSTA STDCALL @@ -1081,7 +1081,7 @@ OpenWindowStationA( WINBOOL STDCALL EnumWindowStationsA( - ENUMWINDOWSTATIONPROC lpEnumFunc, + ENUMWINDOWSTATIONPROCA lpEnumFunc, LPARAM lParam); WINBOOL @@ -1619,14 +1619,14 @@ int STDCALL EnumPropsExA( HWND hWnd, - PROPENUMPROCEX lpEnumFunc, + PROPENUMPROCEXA lpEnumFunc, LPARAM lParam); int STDCALL EnumPropsA( HWND hWnd, - PROPENUMPROC lpEnumFunc); + PROPENUMPROCA lpEnumFunc); WINBOOL STDCALL @@ -2039,7 +2039,7 @@ UpdateICMRegKeyA(DWORD, DWORD, LPSTR, UINT); int STDCALL -EnumICMProfilesA(HDC,ICMENUMPROC,LPARAM); +EnumICMProfilesA(HDC,ICMENUMPROCA,LPARAM); int STDCALL @@ -2525,7 +2525,7 @@ GetCurrencyFormatA( WINBOOL STDCALL EnumCalendarInfoA( - CALINFO_ENUMPROC lpCalInfoEnumProc, + CALINFO_ENUMPROCA lpCalInfoEnumProc, LCID Locale, CALID Calendar, CALTYPE CalType); @@ -2533,14 +2533,14 @@ EnumCalendarInfoA( WINBOOL STDCALL EnumTimeFormatsA( - TIMEFMT_ENUMPROC lpTimeFmtEnumProc, + TIMEFMT_ENUMPROCA lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags); WINBOOL STDCALL EnumDateFormatsA( - DATEFMT_ENUMPROC lpDateFmtEnumProc, + DATEFMT_ENUMPROCA lpDateFmtEnumProc, LCID Locale, DWORD dwFlags); @@ -2575,13 +2575,13 @@ FoldStringA( WINBOOL STDCALL EnumSystemLocalesA( - LOCALE_ENUMPROC lpLocaleEnumProc, + LOCALE_ENUMPROCA lpLocaleEnumProc, DWORD dwFlags); WINBOOL STDCALL EnumSystemCodePagesA( - CODEPAGE_ENUMPROC lpCodePageEnumProc, + CODEPAGE_ENUMPROCA lpCodePageEnumProc, DWORD dwFlags); WINBOOL @@ -3015,9 +3015,15 @@ DdeQueryStringA (DWORD, HSZ, char *, DWORD, int); /* ----------------------------------------------- */ WINBOOL STDCALL LogonUserA (LPSTR, LPSTR, LPSTR, DWORD, DWORD, HANDLE *); -WINBOOL STDCALL CreateProcessAsUserA (HANDLE, LPCTSTR, LPTSTR, +WINBOOL STDCALL CreateProcessAsUserA (HANDLE, LPCSTR, LPSTR, SECURITY_ATTRIBUTES*, SECURITY_ATTRIBUTES*, WINBOOL, DWORD, LPVOID, - LPCTSTR, STARTUPINFOA*, PROCESS_INFORMATION*); + LPCSTR, STARTUPINFOA*, PROCESS_INFORMATION*); + +DWORD WINAPI +SHGetFileInfoA (LPCSTR, DWORD, SHFILEINFO FAR *, UINT, UINT); + +WINBOOL WINAPI +SHGetPathFromIDListA (LPCITEMIDLIST, LPSTR); #ifdef __cplusplus } diff --git a/reactos/include/base.h b/reactos/include/base.h index e37c0e7f8b9..3f08cda0dbc 100644 --- a/reactos/include/base.h +++ b/reactos/include/base.h @@ -60,8 +60,8 @@ typedef long LONG; #define APIENTRY STDCALL #define WINGDIAPI - +#ifndef _DISABLE_TIDENTS #ifdef UNICODE typedef wchar_t *LPTCH; typedef wchar_t *LPTSTR; @@ -69,6 +69,7 @@ typedef wchar_t *LPTSTR; typedef char *LPTCH; typedef char *LPTSTR; #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #ifndef RC_INVOKED @@ -152,12 +153,14 @@ typedef WINBOOL *LPBOOL; typedef CONST CHAR *LPCCH; typedef CHAR *LPCH; typedef COLORREF *LPCOLORREF; - + +#ifndef _DISABLE_TIDENTS #ifdef UNICODE typedef const wchar_t *LPCTSTR; #else typedef const char *LPCTSTR; #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ typedef const wchar_t *LPCWCH; typedef DWORD *LPDWORD; @@ -183,6 +186,7 @@ typedef short *PSHORT; typedef char *PSTR; typedef char *PSZ; +#ifndef _DISABLE_TIDENTS #ifdef UNICODE typedef wchar_t *PTBYTE; typedef wchar_t *PTCH; @@ -194,6 +198,7 @@ typedef char *PTCH; typedef char *PTCHAR; typedef char *PTSTR; #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* typedef PWSTR; @@ -209,6 +214,7 @@ typedef SC_HANDLE *LPSC_HANDLE; typedef DWORD SERVICE_STATUS_HANDLE; /* typedef SPHANDLE; */ +#ifndef _DISABLE_TIDENTS #ifdef UNICODE typedef wchar_t TBYTE; #ifndef _TCHAR_DEFINED @@ -224,6 +230,7 @@ typedef char TCHAR; #endif /* _TCHAR_DEFINED */ typedef BYTE BCHAR; #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ typedef unsigned int WPARAM; /* typedef YIELDPROC; */ @@ -323,7 +330,9 @@ typedef enum _SID_NAME_USE { #define INDEXTOSTATEIMAGEMASK(i) ((i) << 12) #define MAKEINTATOM(i) (LPTSTR) ((DWORD) ((WORD) (i))) +#ifndef _DISABLE_TIDENTS #define MAKEINTRESOURCE(i) (LPTSTR) ((ULONG_PTR) ((WORD) (i))) +#endif /* _DISABLE_TIDENTS */ #define MAKEINTRESOURCEA(i) (LPSTR) ((ULONG_PTR) ((WORD) (i))) #define MAKEINTRESOURCEW(i) (LPWSTR) ((ULONG_PTR) ((WORD) (i))) #define IS_INTRESOURCE(n) ((((ULONG_PTR) (n)) >> 16) == 0) @@ -350,22 +359,23 @@ typedef enum _SID_NAME_USE { #define INDEXTOOVERLAYMASK(i) ((i) << 8) #define INDEXTOSTATEIMAGEMASK(i) ((i) << 12) -#ifdef UNICODE -#ifndef _T -#define _T(quote) L##quote -#endif -#ifndef _TEXT -#define TEXT(quote) L##quote -#endif -#else -#ifndef _T -#define _T(quote) quote -#endif -#ifndef _TEXT -#define TEXT(quote) quote -#endif -#endif - +#ifndef _DISABLE_TIDENTS +# ifdef UNICODE +# ifndef _T +# define _T(quote) L##quote +# endif /* _T */ +# ifndef _TEXT +# define TEXT(quote) L##quote +# endif /* _TEXT */ +# else /* UNICODE */ +# ifndef _T +# define _T(quote) quote +# endif /* _T */ +# ifndef _TEXT +# define TEXT(quote) quote +# endif /* _TEXT */ +# endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #ifndef RC_INVOKED @@ -382,42 +392,96 @@ typedef UINT CALLBACK (*LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM); typedef UINT CALLBACK (*LPSETUPHOOKPROC) (HWND, UINT, WPARAM, LPARAM); typedef WINBOOL CALLBACK (*DLGPROC) (HWND, UINT, WPARAM, LPARAM); typedef int CALLBACK (*PFNPROPSHEETCALLBACK) (HWND, UINT, LPARAM); -typedef VOID CALLBACK (*LPSERVICE_MAIN_FUNCTION) (DWORD, LPTSTR*); +typedef VOID CALLBACK (*LPSERVICE_MAIN_FUNCTIONA) (DWORD, LPSTR*); +typedef VOID CALLBACK (*LPSERVICE_MAIN_FUNCTIONW) (DWORD, LPWSTR*); typedef int CALLBACK (*PFNTVCOMPARE) (LPARAM, LPARAM, LPARAM); typedef LRESULT CALLBACK (*WNDPROC) (HWND, UINT, WPARAM, LPARAM); typedef int CALLBACK (*FARPROC)(void); typedef FARPROC PROC; -typedef WINBOOL CALLBACK (*ENUMRESTYPEPROC) (HANDLE, LPTSTR, LONG); -typedef WINBOOL CALLBACK (*ENUMRESNAMEPROC) (HANDLE, LPCTSTR, LPTSTR, LONG); -typedef WINBOOL CALLBACK (*ENUMRESLANGPROC) (HANDLE, LPCTSTR, LPCTSTR, WORD, LONG); +typedef WINBOOL CALLBACK (*ENUMRESTYPEPROCA) (HANDLE, LPSTR, LONG); +typedef WINBOOL CALLBACK (*ENUMRESTYPEPROCW) (HANDLE, LPWSTR, LONG); +typedef WINBOOL CALLBACK (*ENUMRESNAMEPROCA) (HANDLE, LPCSTR, LPSTR, LONG); +typedef WINBOOL CALLBACK (*ENUMRESNAMEPROCW) (HANDLE, LPCWSTR, LPWSTR, LONG); +typedef WINBOOL CALLBACK (*ENUMRESLANGPROCA) (HANDLE, LPCSTR, LPCSTR, WORD, LONG); +typedef WINBOOL CALLBACK (*ENUMRESLANGPROCW) (HANDLE, LPCWSTR, LPCWSTR, WORD, LONG); typedef FARPROC DESKTOPENUMPROC; typedef WINBOOL CALLBACK (*ENUMWINDOWSPROC) (HWND, LPARAM); -typedef WINBOOL CALLBACK (*ENUMWINDOWSTATIONPROC) (LPTSTR, LPARAM); +typedef WINBOOL CALLBACK (*ENUMWINDOWSTATIONPROCA) (LPSTR, LPARAM); +typedef WINBOOL CALLBACK (*ENUMWINDOWSTATIONPROCW) (LPWSTR, LPARAM); typedef VOID CALLBACK (*SENDASYNCPROC) (HWND, UINT, DWORD, LRESULT); typedef VOID CALLBACK (*TIMERPROC) (HWND, UINT, UINT, DWORD); typedef FARPROC GRAYSTRINGPROC; typedef WINBOOL CALLBACK (*DRAWSTATEPROC) (HDC, LPARAM, WPARAM, int, int); -typedef WINBOOL CALLBACK (*PROPENUMPROCEX) (HWND, LPCTSTR, HANDLE, DWORD); -typedef WINBOOL CALLBACK (*PROPENUMPROC) (HWND, LPCTSTR, HANDLE); +typedef WINBOOL CALLBACK (*PROPENUMPROCEXA) (HWND, LPCSTR, HANDLE, DWORD); +typedef WINBOOL CALLBACK (*PROPENUMPROCEXW) (HWND, LPCWSTR, HANDLE, DWORD); +typedef WINBOOL CALLBACK (*PROPENUMPROCA) (HWND, LPCSTR, HANDLE); +typedef WINBOOL CALLBACK (*PROPENUMPROCW) (HWND, LPCWSTR, HANDLE); typedef LRESULT CALLBACK (*HOOKPROC) (int, WPARAM, LPARAM); typedef VOID CALLBACK (*ENUMOBJECTSPROC) (LPVOID, LPARAM); typedef VOID CALLBACK (*LINEDDAPROC) (int, int, LPARAM); typedef WINBOOL CALLBACK (*ABORTPROC) (HDC, int); typedef UINT CALLBACK (*LPPAGEPAINTHOOK) (HWND, UINT, WPARAM, LPARAM ); typedef UINT CALLBACK (*LPPAGESETUPHOOK) (HWND, UINT, WPARAM, LPARAM ); -typedef int CALLBACK (*ICMENUMPROC) (LPTSTR, LPARAM); +typedef int CALLBACK (*ICMENUMPROCA) (LPSTR, LPARAM); +typedef int CALLBACK (*ICMENUMPROCW) (LPWSTR, LPARAM); typedef LONG (*EDITWORDBREAKPROCEX) (char *, LONG, BYTE, INT); typedef int CALLBACK (*PFNLVCOMPARE) (LPARAM, LPARAM, LPARAM); -typedef WINBOOL CALLBACK (*LOCALE_ENUMPROC) (LPTSTR); -typedef WINBOOL CALLBACK (*CODEPAGE_ENUMPROC) (LPTSTR); -typedef WINBOOL CALLBACK (*DATEFMT_ENUMPROC) (LPTSTR); -typedef WINBOOL CALLBACK (*TIMEFMT_ENUMPROC) (LPTSTR); -typedef WINBOOL CALLBACK (*CALINFO_ENUMPROC) (LPTSTR); +typedef WINBOOL CALLBACK (*LOCALE_ENUMPROCA) (LPSTR); +typedef WINBOOL CALLBACK (*LOCALE_ENUMPROCW) (LPWSTR); +typedef WINBOOL CALLBACK (*CODEPAGE_ENUMPROCA) (LPSTR); +typedef WINBOOL CALLBACK (*CODEPAGE_ENUMPROCW) (LPWSTR); +typedef WINBOOL CALLBACK (*DATEFMT_ENUMPROCA) (LPSTR); +typedef WINBOOL CALLBACK (*DATEFMT_ENUMPROCW) (LPWSTR); +typedef WINBOOL CALLBACK (*TIMEFMT_ENUMPROCA) (LPSTR); +typedef WINBOOL CALLBACK (*TIMEFMT_ENUMPROCW) (LPWSTR); +typedef WINBOOL CALLBACK (*CALINFO_ENUMPROCA) (LPSTR); +typedef WINBOOL CALLBACK (*CALINFO_ENUMPROCW) (LPWSTR); typedef WINBOOL CALLBACK (*PHANDLER_ROUTINE) (DWORD); typedef VOID CALLBACK (*LPHANDLER_FUNCTION) (DWORD); -typedef UINT CALLBACK (*PFNGETPROFILEPATH) (LPCTSTR, LPSTR, UINT); -typedef UINT CALLBACK (*PFNRECONCILEPROFILE) (LPCTSTR, LPCTSTR, DWORD); -typedef WINBOOL CALLBACK (*PFNPROCESSPOLICIES) (HWND, LPCTSTR, LPCTSTR, LPCTSTR, DWORD); +typedef UINT CALLBACK (*PFNGETPROFILEPATHA) (LPCSTR, LPSTR, UINT); +typedef UINT CALLBACK (*PFNGETPROFILEPATHW) (LPCWSTR, LPWSTR, UINT); +typedef UINT CALLBACK (*PFNRECONCILEPROFILEA) (LPCSTR, LPCSTR, DWORD); +typedef UINT CALLBACK (*PFNRECONCILEPROFILEW) (LPCWSTR, LPCWSTR, DWORD); +typedef WINBOOL CALLBACK (*PFNPROCESSPOLICIESA) (HWND, LPCSTR, LPCSTR, LPCSTR, DWORD); +typedef WINBOOL CALLBACK (*PFNPROCESSPOLICIESW) (HWND, LPCWSTR, LPCWSTR, LPCWSTR, DWORD); + +#ifndef _DISABLE_TIDENTS +#ifdef UNICODE +#define LPSERVICE_MAIN_FUNCTION LPSERVICE_MAIN_FUNCTIONW +#define ENUMRESTYPEPROC ENUMRESTYPEPROCW +#define ENUMRESNAMEPROC ENUMRESNAMEPROCW +#define ENUMRESLANGPROC ENUMRESLANGPROCW +#define ENUMWINDOWSTATIONPROC ENUMWINDOWSTATIONPROCW +#define PROPENUMPROCEX PROPENUMPROCEXW +#define PROPENUMPROC PROPENUMPROCW +#define ICMENUMPROC ICMENUMPROCW +#define LOCALE_ENUMPROC LOCALE_ENUMPROCW +#define CODEPAGE_ENUMPROC CODEPAGE_ENUMPROCW +#define DATEFMT_ENUMPROC DATEFMT_ENUMPROCW +#define TIMEFMT_ENUMPROC TIMEFMT_ENUMPROCW +#define CALINFO_ENUMPROC CALINFO_ENUMPROCW +#define PFNGETPROFILEPATH PFNGETPROFILEPATHW +#define PFNRECONCILEPROFILE PFNRECONCILEPROFILEW +#define PFNPROCESSPOLICIES PFNPROCESSPOLICIESW +#else /* UNICODE */ +#define LPSERVICE_MAIN_FUNCTION LPSERVICE_MAIN_FUNCTIONA +#define ENUMRESTYPEPROC ENUMRESTYPEPROCA +#define ENUMRESNAMEPROC ENUMRESNAMEPROCA +#define ENUMRESLANGPROC ENUMRESLANGPROCA +#define ENUMWINDOWSTATIONPROC ENUMWINDOWSTATIONPROCA +#define PROPENUMPROCEX PROPENUMPROCEXA +#define PROPENUMPROC PROPENUMPROCA +#define ICMENUMPROC ICMENUMPROCA +#define LOCALE_ENUMPROC LOCALE_ENUMPROCA +#define CODEPAGE_ENUMPROC CODEPAGE_ENUMPROCA +#define DATEFMT_ENUMPROC DATEFMT_ENUMPROCA +#define TIMEFMT_ENUMPROC TIMEFMT_ENUMPROCA +#define CALINFO_ENUMPROC CALINFO_ENUMPROCA +#define PFNGETPROFILEPATH PFNGETPROFILEPATHA +#define PFNRECONCILEPROFILE PFNRECONCILEPROFILEA +#define PFNPROCESSPOLICIES PFNPROCESSPOLICIESA +#endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} @@ -458,6 +522,7 @@ typedef WINBOOL CALLBACK (*PFNPROCESSPOLICIES) (HWND, LPCTSTR, LPCTSTR, LPCTSTR, #define SC_GROUP_IDENTIFIERW L'+' #define SC_GROUP_IDENTIFIERA '+' +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEW #define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEW @@ -467,6 +532,7 @@ typedef WINBOOL CALLBACK (*PFNPROCESSPOLICIES) (HWND, LPCTSTR, LPCTSTR, LPCTSTR, #define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEA #define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* ---------------------------------- */ /* From ddeml.h in old Cygnus headers */ diff --git a/reactos/include/defines.h b/reactos/include/defines.h index 2ae21fbec27..13b4f1d2884 100644 --- a/reactos/include/defines.h +++ b/reactos/include/defines.h @@ -1039,20 +1039,69 @@ extern "C" { /* EnumProtocols */ /* EnumResLangProc */ -#define RT_ACCELERATOR (MAKEINTRESOURCE(9)) -#define RT_BITMAP (MAKEINTRESOURCE(2)) -#define RT_DIALOG (MAKEINTRESOURCE(5)) -#define RT_FONT (MAKEINTRESOURCE(8)) -#define RT_FONTDIR (MAKEINTRESOURCE(7)) -#define RT_MENU (MAKEINTRESOURCE(4)) -#define RT_RCDATA (MAKEINTRESOURCE(10)) -#define RT_STRING (MAKEINTRESOURCE(6)) -#define RT_MESSAGETABLE (MAKEINTRESOURCE(11)) -#define RT_CURSOR (MAKEINTRESOURCE(1)) -#define RT_GROUP_CURSOR (MAKEINTRESOURCE(12)) -#define RT_ICON (MAKEINTRESOURCE(3)) -#define RT_GROUP_ICON (MAKEINTRESOURCE(13)) -#define RT_VERSION (MAKEINTRESOURCE(16)) +#define RT_ACCELERATORA (MAKEINTRESOURCEA(9)) +#define RT_BITMAPA (MAKEINTRESOURCEA(2)) +#define RT_DIALOGA (MAKEINTRESOURCEA(5)) +#define RT_FONTA (MAKEINTRESOURCEA(8)) +#define RT_FONTDIRA (MAKEINTRESOURCEA(7)) +#define RT_MENUA (MAKEINTRESOURCEA(4)) +#define RT_RCDATAA (MAKEINTRESOURCEA(10)) +#define RT_STRINGA (MAKEINTRESOURCEA(6)) +#define RT_MESSAGETABLEA (MAKEINTRESOURCEA(11)) +#define RT_CURSORA (MAKEINTRESOURCEA(1)) +#define RT_GROUP_CURSORA (MAKEINTRESOURCEA(12)) +#define RT_ICONA (MAKEINTRESOURCEA(3)) +#define RT_GROUP_ICONA (MAKEINTRESOURCEA(13)) +#define RT_VERSIONA (MAKEINTRESOURCEA(16)) + +#define RT_ACCELERATORW (MAKEINTRESOURCEW(9)) +#define RT_BITMAPW (MAKEINTRESOURCEW(2)) +#define RT_DIALOGW (MAKEINTRESOURCEW(5)) +#define RT_FONTW (MAKEINTRESOURCEW(8)) +#define RT_FONTDIRW (MAKEINTRESOURCEW(7)) +#define RT_MENUW (MAKEINTRESOURCEW(4)) +#define RT_RCDATAW (MAKEINTRESOURCEW(10)) +#define RT_STRINGW (MAKEINTRESOURCEW(6)) +#define RT_MESSAGETABLEW (MAKEINTRESOURCEW(11)) +#define RT_CURSORW (MAKEINTRESOURCEW(1)) +#define RT_GROUP_CURSORW (MAKEINTRESOURCEW(12)) +#define RT_ICONW (MAKEINTRESOURCEW(3)) +#define RT_GROUP_ICONW (MAKEINTRESOURCEW(13)) +#define RT_VERSIONW (MAKEINTRESOURCEW(16)) + +#ifndef _DISABLE_TIDENT +#ifdef UNICODE +#define RT_ACCELERATOR RT_ACCELERATORW +#define RT_BITMAP RT_BITMAPW +#define RT_DIALOG RT_DIALOGW +#define RT_FONT RT_FONTW +#define RT_FONTDIR RT_FONTDIRW +#define RT_MENU RT_MENUW +#define RT_RCDATA RT_RCDATAW +#define RT_STRING RT_STRINGW +#define RT_MESSAGETABLE RT_MESSAGETABLEW +#define RT_CURSOR RT_CURSORW +#define RT_GROUP_CURSOR RT_GROUP_CURSORW +#define RT_ICON RT_ICONW +#define RT_GROUP_ICON RT_GROUP_ICONW +#define RT_VERSION RT_VERSIONW +#else /* UNICODE */ +#define RT_ACCELERATOR RT_ACCELERATORA +#define RT_BITMAP RT_BITMAPA +#define RT_DIALOG RT_DIALOGA +#define RT_FONT RT_FONTA +#define RT_FONTDIR RT_FONTDIRA +#define RT_MENU RT_MENUA +#define RT_RCDATA RT_RCDATAA +#define RT_STRING RT_STRINGA +#define RT_MESSAGETABLE RT_MESSAGETABLEA +#define RT_CURSOR RT_CURSORA +#define RT_GROUP_CURSOR RT_GROUP_CURSORA +#define RT_ICON RT_ICONA +#define RT_GROUP_ICON RT_GROUP_ICONA +#define RT_VERSION RT_VERSIONA +#endif /* UNICODE */ +#endif /* _DISABLE_TIDENT */ /* EnumServicesStatus */ #define SERVICE_WIN32 (48) @@ -1475,27 +1524,27 @@ extern "C" { #define HANDLE_FLAG_PROTECT_FROM_CLOSE (2) /* GetIconInfo */ -#define IDC_ARROW (MAKEINTRESOURCE(32512)) -#define IDC_IBEAM (MAKEINTRESOURCE(32513)) -#define IDC_WAIT (MAKEINTRESOURCE(32514)) -#define IDC_CROSS (MAKEINTRESOURCE(32515)) -#define IDC_UPARROW (MAKEINTRESOURCE(32516)) -#define IDC_SIZENWSE (MAKEINTRESOURCE(32642)) -#define IDC_SIZENESW (MAKEINTRESOURCE(32643)) -#define IDC_SIZEWE (MAKEINTRESOURCE(32644)) -#define IDC_SIZENS (MAKEINTRESOURCE(32645)) -#define IDC_SIZEALL (MAKEINTRESOURCE(32646)) -#define IDC_NO (MAKEINTRESOURCE(32648)) -#define IDC_APPSTARTING (MAKEINTRESOURCE(32650)) -#define IDC_HELP (MAKEINTRESOURCE(32651)) -#define IDI_APPLICATION (MAKEINTRESOURCE(32512)) -#define IDI_HAND (MAKEINTRESOURCE(32513)) -#define IDI_QUESTION (MAKEINTRESOURCE(32514)) -#define IDI_EXCLAMATION (MAKEINTRESOURCE(32515)) -#define IDI_ASTERISK (MAKEINTRESOURCE(32516)) -#define IDI_WINLOGO (MAKEINTRESOURCE(32517)) -#define IDC_SIZE (MAKEINTRESOURCE(32640)) -#define IDC_ICON (MAKEINTRESOURCE(32641)) +#define IDC_ARROW (MAKEINTRESOURCEW(32512)) +#define IDC_IBEAM (MAKEINTRESOURCEW(32513)) +#define IDC_WAIT (MAKEINTRESOURCEW(32514)) +#define IDC_CROSS (MAKEINTRESOURCEW(32515)) +#define IDC_UPARROW (MAKEINTRESOURCEW(32516)) +#define IDC_SIZENWSE (MAKEINTRESOURCEW(32642)) +#define IDC_SIZENESW (MAKEINTRESOURCEW(32643)) +#define IDC_SIZEWE (MAKEINTRESOURCEW(32644)) +#define IDC_SIZENS (MAKEINTRESOURCEW(32645)) +#define IDC_SIZEALL (MAKEINTRESOURCEW(32646)) +#define IDC_NO (MAKEINTRESOURCEW(32648)) +#define IDC_APPSTARTING (MAKEINTRESOURCEW(32650)) +#define IDC_HELP (MAKEINTRESOURCEW(32651)) +#define IDI_APPLICATION (MAKEINTRESOURCEW(32512)) +#define IDI_HAND (MAKEINTRESOURCEW(32513)) +#define IDI_QUESTION (MAKEINTRESOURCEW(32514)) +#define IDI_EXCLAMATION (MAKEINTRESOURCEW(32515)) +#define IDI_ASTERISK (MAKEINTRESOURCEW(32516)) +#define IDI_WINLOGO (MAKEINTRESOURCEW(32517)) +#define IDC_SIZE (MAKEINTRESOURCEW(32640)) +#define IDC_ICON (MAKEINTRESOURCEW(32641)) /* GetMapMode */ #define MM_ANISOTROPIC (8) @@ -3367,6 +3416,7 @@ extern "C" { #define WC_LISTVIEWA "SysListView32" #define WC_TABCONTROLA "SysTabControl32" #define WC_TREEVIEWA "SysTreeView32" +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define ANIMATE_CLASS ANIMATE_CLASSW #define HOTKEY_CLASS HOTKEY_CLASSW @@ -3394,6 +3444,7 @@ extern "C" { #define WC_TABCONTROL WC_TABCONTROLA #define WC_TREEVIEW WC_TREEVIEWA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* Header control styles */ #define HDS_BUTTONS (2) @@ -3582,11 +3633,13 @@ extern "C" { #define LVIS_STATEIMAGEMASK (61440) #define LPSTR_TEXTCALLBACKW ((LPWSTR)-1L) #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKW #else #define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* LV_ITEM structure */ #define LVIF_TEXT (1) @@ -4040,6 +4093,7 @@ extern "C" { #define LBSELCHSTRINGA "commdlg_LBSelChangedNotify" #define SETRGBSTRINGA "commdlg_SetRGBColor" #define SHAREVISTRINGA "commdlg_ShareViolation" +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define COLOROKSTRING COLOROKSTRINGW #define FILEOKSTRING FILEOKSTRINGW @@ -4056,7 +4110,8 @@ extern "C" { #define LBSELCHSTRING LBSELCHSTRINGA #define SETRGBSTRING SETRGBSTRINGA #define SHAREVISTRING SHAREVISTRINGA -#endif +#endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* LBSELCHSTRING message */ #define CD_LBSELCHANGE (0) diff --git a/reactos/include/funcs.h b/reactos/include/funcs.h index 21373284482..29c0136c7cf 100644 --- a/reactos/include/funcs.h +++ b/reactos/include/funcs.h @@ -63,6 +63,7 @@ typedef PPROGRESS_ROUTINE LPPROGRESS_ROUTINE; /* Define the approprate declaration based upon UNICODE or ASCII */ +#ifndef _DISABLE_TIDENTS /* UNICODE */ #ifdef UNICODE @@ -468,6 +469,8 @@ typedef PPROGRESS_ROUTINE LPPROGRESS_ROUTINE; #define DdeQueryString DdeQueryStringW #define LogonUser LogonUserW #define CreateProcessAsUser CreateProcessAsUserW +#define SHGetFileInfo SHGetFileInfoW +#define SHGetPathFromIDList SHGetPathFromIDListW /* ASCII */ #else @@ -875,8 +878,11 @@ typedef PPROGRESS_ROUTINE LPPROGRESS_ROUTINE; #define DdeQueryString DdeQueryStringA #define LogonUser LogonUserA #define CreateProcessAsUser CreateProcessAsUserA +#define SHGetFileInfo SHGetFileInfoA +#define SHGetPathFromIDList SHGetPathFromIDListA #endif /* UNICODE and ASCII defines */ +#endif /* _DISABLE_TIDENTS */ HWND STDCALL GetAncestor(HWND hWnd, UINT GaFlags); WINBOOL STDCALL AbnormalTermination(VOID); @@ -895,20 +901,6 @@ WINBOOL STDCALL AccessCheck( LPBOOL AccessStatus ); -WINBOOL STDCALL AccessCheckAndAuditAlarm( - LPCTSTR SubsystemName, - LPVOID HandleId, - LPTSTR ObjectTypeName, - LPTSTR ObjectName, - PSECURITY_DESCRIPTOR SecurityDescriptor, - DWORD DesiredAccess, - PGENERIC_MAPPING GenericMapping, - WINBOOL ObjectCreation, - LPDWORD GrantedAccess, - LPBOOL AccessStatus, - LPBOOL pfGenerateOnClose - ); - #ifndef __NTDRIVER__ LONG STDCALL @@ -6937,31 +6929,37 @@ CommDlgExtendedError(VOID); #define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define CommDlg_OpenSave_GetSpec CommDlg_OpenSave_GetSpecW #else #define CommDlg_OpenSave_GetSpec CommDlg_OpenSave_GetSpecA #endif /* !UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz) #define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define CommDlg_OpenSave_GetFilePath CommDlg_OpenSave_GetFilePathW #else #define CommDlg_OpenSave_GetFilePath CommDlg_OpenSave_GetFilePathA #endif /* !UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz) #define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define CommDlg_OpenSave_GetFolderPath CommDlg_OpenSave_GetFolderPathW #else #define CommDlg_OpenSave_GetFolderPath CommDlg_OpenSave_GetFolderPathA #endif /* !UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl) @@ -7479,6 +7477,7 @@ wglSwapLayerBuffers(HDC, UINT); There doesn't seem to be any difference. */ +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define wglUseFontBitmaps wglUseFontBitmapsW #define wglUseFontOutlines wglUseFontOutlinesW @@ -7486,6 +7485,7 @@ wglSwapLayerBuffers(HDC, UINT); #define wglUseFontBitmaps wglUseFontBitmapsA #define wglUseFontOutlines wglUseFontOutlinesA #endif /* !UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* ------------------------------------- */ /* From shellapi.h in old Cygnus headers */ @@ -7563,9 +7563,6 @@ HRESULT WINAPI SHGetDesktopFolder (LPSHELLFOLDER); */ -DWORD WINAPI -SHGetFileInfo (LPCTSTR, DWORD, SHFILEINFO FAR *, UINT, UINT); - /* Define when IUnknown is defined. HRESULT WINAPI SHGetInstanceExplorer (IUnknown **); @@ -7576,9 +7573,6 @@ HRESULT WINAPI SHGetMalloc (LPMALLOC *); */ -WINBOOL WINAPI -SHGetPathFromIDList (LPCITEMIDLIST, LPTSTR); - HRESULT WINAPI SHGetSpecialFolderLocation (HWND, int, LPITEMIDLIST *); diff --git a/reactos/include/messages.h b/reactos/include/messages.h index f3723c8a11c..84d665ffc9d 100644 --- a/reactos/include/messages.h +++ b/reactos/include/messages.h @@ -44,11 +44,13 @@ extern "C" { /* Animation Control */ #define ACM_OPENW (1127) #define ACM_OPENA (1124) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define ACM_OPEN ACM_OPENW #else #define ACM_OPEN ACM_OPENA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define ACM_PLAY (1125) #define ACM_STOP (1126) #define ACN_START (1) @@ -250,6 +252,7 @@ extern "C" { #define HDM_GETITEMA (4611) #define HDM_INSERTITEMA (4609) #define HDM_SETITEMA (4612) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define HDM_GETITEM HDM_GETITEMW #define HDM_INSERTITEM HDM_INSERTITEMW @@ -259,6 +262,7 @@ extern "C" { #define HDM_INSERTITEM HDM_INSERTITEMA #define HDM_SETITEM HDM_SETITEMA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define HDM_GETITEMCOUNT (4608) #define HDM_HITTEST (4614) #define HDM_LAYOUT (4613) @@ -280,6 +284,7 @@ extern "C" { #define HDN_ITEMCLICKA (-302) #define HDN_ITEMDBLCLICKA (-303) #define HDN_TRACKA (-308) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define HDN_BEGINTRACK HDN_BEGINTRACKW #define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKW @@ -299,6 +304,7 @@ extern "C" { #define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKA #define HDN_TRACK HDN_TRACKA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* Hot key control */ #define HKM_GETHOTKEY (1026) @@ -392,6 +398,7 @@ extern "C" { #define LVM_SETCOLUMNA (4122) #define LVM_SETITEMA (4102) #define LVM_SETITEMTEXTA (4142) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define LVM_EDITLABEL LVM_EDITLABELW #define LVM_FINDITEM LVM_FINDITEMW @@ -419,6 +426,7 @@ extern "C" { #define LVM_SETITEM LVM_SETITEMA #define LVM_SETITEMTEXT LVM_SETITEMTEXTA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define LVM_GETITEMCOUNT (4100) #define LVM_GETITEMPOSITION (4112) #define LVM_GETITEMRECT (4110) @@ -461,6 +469,7 @@ extern "C" { #define LVN_ENDLABELEDITA (-106) #define LVN_GETDISPINFOA (-150) #define LVN_SETDISPINFOA (-151) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITW #define LVN_ENDLABELEDIT LVN_ENDLABELEDITW @@ -472,6 +481,7 @@ extern "C" { #define LVN_GETDISPINFO LVN_GETDISPINFOA #define LVN_SETDISPINFO LVN_SETDISPINFOA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define LVN_INSERTITEM (-102) #define LVN_ITEMCHANGED (-101) #define LVN_ITEMCHANGING (-100) @@ -515,6 +525,7 @@ extern "C" { #define PSM_SETTITLEW (1144) #define PSM_SETFINISHTEXTA (1139) #define PSM_SETTITLEA (1135) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define PSM_SETFINISHTEXT PSM_SETFINISHTEXTW #define PSM_SETTITLE PSM_SETTITLEW @@ -522,6 +533,7 @@ extern "C" { #define PSM_SETFINISHTEXT PSM_SETFINISHTEXTA #define PSM_SETTITLE PSM_SETTITLEA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define PSM_SETWIZBUTTONS (1136) #define PSM_UNCHANGED (1133) @@ -546,6 +558,7 @@ extern "C" { #define SB_GETTEXTA (1026) #define SB_GETTEXTLENGTHA (1027) #define SB_SETTEXTA (1025) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define SB_GETTEXT SB_GETTEXTW #define SB_GETTEXTLENGTH SB_GETTEXTLENGTHW @@ -555,6 +568,7 @@ extern "C" { #define SB_GETTEXTLENGTH SB_GETTEXTLENGTHA #define SB_SETTEXT SB_SETTEXTA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define SB_SETMINHEIGHT (1032) #define SB_SETPARTS (1028) #define SB_SIMPLE (1033) @@ -602,6 +616,7 @@ extern "C" { #define TB_ADDSTRINGA (1052) #define TB_GETBUTTONTEXTA (1069) #define TB_SAVERESTOREA (1050) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define TB_ADDSTRING TB_ADDSTRINGW #define TB_GETBUTTONTEXT TB_GETBUTTONTEXTW @@ -611,6 +626,7 @@ extern "C" { #define TB_GETBUTTONTEXT TB_GETBUTTONTEXTA #define TB_SAVERESTORE TB_SAVERESTOREA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define TB_GETITEMRECT (1053) #define TB_GETROWS (1064) #define TB_GETSTATE (1042) @@ -670,11 +686,13 @@ extern "C" { #define TBN_ENDDRAG (-702) #define TBN_GETBUTTONINFOW (-720) #define TBN_GETBUTTONINFOA (-700) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define TBN_GETBUTTONINFO TBN_GETBUTTONINFOW #else #define TBN_GETBUTTONINFO TBN_GETBUTTONINFOA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define TBN_QUERYDELETE (-707) #define TBN_QUERYINSERT (-706) #define TBN_RESET (-705) @@ -693,6 +711,7 @@ extern "C" { #define TCM_GETITEMA (4869) #define TCM_INSERTITEMA (4871) #define TCM_SETITEMA (4870) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define TCM_GETITEM TCM_GETITEM #define TCM_INSERTITEM TCM_INSERTITEMW @@ -702,6 +721,7 @@ extern "C" { #define TCM_INSERTITEM TCM_INSERTITEMA #define TCM_SETITEM TCM_SETITEMA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define TCM_GETITEMCOUNT (4868) #define TCM_GETITEMRECT (4874) #define TCM_GETROWCOUNT (4908) @@ -743,6 +763,7 @@ extern "C" { #define TTM_NEWTOOLRECTA (1030) #define TTM_SETTOOLINFOA (1033) #define TTM_UPDATETIPTEXTA (1036) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define TTM_ADDTOOL TTM_ADDTOOLW #define TTM_DELTOOL TTM_DELTOOLW @@ -766,6 +787,7 @@ extern "C" { #define TTM_SETTOOLINFO TTM_SETTOOLINFOA #define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define TTM_GETTOOLCOUNT (1037) #define TTM_RELAYEVENT (1031) #define TTM_SETDELAYTIME (1027) @@ -774,11 +796,13 @@ extern "C" { /* Tool tip control notification */ #define TTN_NEEDTEXTW (-530) #define TTN_NEEDTEXTA (-520) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define TTN_NEEDTEXT TTN_NEEDTEXTW #else #define TTN_NEEDTEXT TTN_NEEDTEXTA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define TTN_POP (-522) #define TTN_SHOW (-521) @@ -806,6 +830,7 @@ extern "C" { #define TVM_GETITEMA (4364) #define TVM_INSERTITEMA (4352) #define TVM_SETITEMA (4365) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define TVM_EDITLABEL TVM_EDITLABELW #define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGW @@ -819,6 +844,7 @@ extern "C" { #define TVM_INSERTITEM TVM_INSERTITEMA #define TVM_SETITEM TVM_SETITEMA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ #define TVM_SELECTITEM (4363) #define TVM_SETIMAGELIST (4361) #define TVM_SETINDENT (4359) @@ -849,6 +875,7 @@ extern "C" { #define TVN_SELCHANGEDA (-402) #define TVN_SELCHANGINGA (-401) #define TVN_SETDISPINFOA (-404) +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define TVN_BEGINDRAG TVN_BEGINDRAGW #define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITW @@ -874,6 +901,7 @@ extern "C" { #define TVN_SELCHANGING TVN_SELCHANGINGA #define TVN_SETDISPINFO TVN_SETDISPINFOA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* Up/down control */ #define UDM_GETACCEL (1132) diff --git a/reactos/include/structs.h b/reactos/include/structs.h index 8ec83c09c15..afd8fceac86 100644 --- a/reactos/include/structs.h +++ b/reactos/include/structs.h @@ -46,10 +46,10 @@ #include #include -// NOTE - change the following to an #if 0 to verify you aren't -// accidentally using generic struct pointers in your A/W-specific -// structs -#if 1 +// NOTE - _DISABLE_TIDENTS exists to keep ReactOS's source from +// accidentally utilitizing ANSI/UNICODE-generic structs, defines +// or functions. +#ifndef _DISABLE_TIDENTS # ifdef UNICODE # define typedef_tident(ident) typedef ident##W ident; # else @@ -59,6 +59,7 @@ # define typedef_tident(ident) #endif + typedef struct _VALENT_A { LPSTR ve_valuename; DWORD ve_valuelen; @@ -1452,8 +1453,8 @@ typedef struct tagPANOSE { typedef struct tagEXTLOGFONTA { LOGFONTA elfLogFont; - BCHAR elfFullName[LF_FULLFACESIZE]; - BCHAR elfStyle[LF_FACESIZE]; + CHAR elfFullName[LF_FULLFACESIZE]; + CHAR elfStyle[LF_FACESIZE]; DWORD elfVersion; DWORD elfStyleSize; DWORD elfMatch; @@ -2044,8 +2045,8 @@ typedef_tident(LPENUM_SERVICE_STATUS) typedef struct tagENUMLOGFONTA { LOGFONTA elfLogFont; - BCHAR elfFullName[LF_FULLFACESIZE]; - BCHAR elfStyle[LF_FACESIZE]; + CHAR elfFullName[LF_FULLFACESIZE]; + CHAR elfStyle[LF_FACESIZE]; } ENUMLOGFONTA, *LPENUMLOGFONTA; typedef struct tagENUMLOGFONTW { @@ -2059,9 +2060,9 @@ typedef_tident(LPENUMLOGFONT) typedef struct tagENUMLOGFONTEXA { LOGFONTA elfLogFont; - BCHAR elfFullName[LF_FULLFACESIZE]; - BCHAR elfStyle[LF_FACESIZE]; - BCHAR elfScript[LF_FACESIZE]; + CHAR elfFullName[LF_FULLFACESIZE]; + CHAR elfStyle[LF_FACESIZE]; + CHAR elfScript[LF_FACESIZE]; } ENUMLOGFONTEXA, *LPENUMLOGFONTEXA; typedef struct tagENUMLOGFONTEXW { @@ -3215,10 +3216,10 @@ typedef struct tagNEWTEXTMETRICA { LONG tmOverhang; LONG tmDigitizedAspectX; LONG tmDigitizedAspectY; - BCHAR tmFirstChar; - BCHAR tmLastChar; - BCHAR tmDefaultChar; - BCHAR tmBreakChar; + CHAR tmFirstChar; + CHAR tmLastChar; + CHAR tmDefaultChar; + CHAR tmBreakChar; BYTE tmItalic; BYTE tmUnderlined; BYTE tmStruckOut; @@ -3332,6 +3333,7 @@ typedef struct _NM_TREEVIEWW { typedef_tident(NM_TREEVIEW) typedef_tident(LPNM_TREEVIEW) + typedef struct _NM_UPDOWN { NMHDR hdr; int iPos; @@ -3616,10 +3618,10 @@ typedef struct tagTEXTMETRICA { LONG tmOverhang; LONG tmDigitizedAspectX; LONG tmDigitizedAspectY; - BCHAR tmFirstChar; - BCHAR tmLastChar; - BCHAR tmDefaultChar; - BCHAR tmBreakChar; + CHAR tmFirstChar; + CHAR tmLastChar; + CHAR tmDefaultChar; + CHAR tmBreakChar; BYTE tmItalic; BYTE tmUnderlined; BYTE tmStruckOut; @@ -4610,12 +4612,12 @@ typedef struct tagSERIALKEYS { typedef struct _SERVICE_TABLE_ENTRYA { LPSTR lpServiceName; - LPSERVICE_MAIN_FUNCTION lpServiceProc; + LPSERVICE_MAIN_FUNCTIONA lpServiceProc; } SERVICE_TABLE_ENTRYA, *LPSERVICE_TABLE_ENTRYA; typedef struct _SERVICE_TABLE_ENTRYW { LPWSTR lpServiceName; - LPSERVICE_MAIN_FUNCTION lpServiceProc; + LPSERVICE_MAIN_FUNCTIONW lpServiceProc; } SERVICE_TABLE_ENTRYW, *LPSERVICE_TABLE_ENTRYW; typedef_tident(SERVICE_TABLE_ENTRY) @@ -5841,4 +5843,3 @@ typedef struct _WIN32_FILE_ATTRIBUTES_DATA { #endif /* WIN32_LEAN_AND_MEAN */ #endif /* _GNU_H_WINDOWS32_STRUCTURES */ - diff --git a/reactos/include/unicode.h b/reactos/include/unicode.h index a3c26ab004b..c23af5fa226 100644 --- a/reactos/include/unicode.h +++ b/reactos/include/unicode.h @@ -293,7 +293,7 @@ WINBOOL STDCALL EnumResourceTypesW( HINSTANCE hModule, - ENUMRESTYPEPROC lpEnumFunc, + ENUMRESTYPEPROCW lpEnumFunc, LONG lParam ); @@ -302,7 +302,7 @@ STDCALL EnumResourceNamesW( HINSTANCE hModule, LPCWSTR lpType, - ENUMRESNAMEPROC lpEnumFunc, + ENUMRESNAMEPROCW lpEnumFunc, LONG lParam ); @@ -312,7 +312,7 @@ EnumResourceLanguagesW( HINSTANCE hModule, LPCWSTR lpType, LPCWSTR lpName, - ENUMRESLANGPROC lpEnumFunc, + ENUMRESLANGPROCW lpEnumFunc, LONG lParam ); @@ -1078,7 +1078,7 @@ OpenWindowStationW( WINBOOL STDCALL EnumWindowStationsW( - ENUMWINDOWSTATIONPROC lpEnumFunc, + ENUMWINDOWSTATIONPROCW lpEnumFunc, LPARAM lParam); WINBOOL @@ -1614,14 +1614,14 @@ int STDCALL EnumPropsExW( HWND hWnd, - PROPENUMPROCEX lpEnumFunc, + PROPENUMPROCEXW lpEnumFunc, LPARAM lParam); int STDCALL EnumPropsW( HWND hWnd, - PROPENUMPROC lpEnumFunc); + PROPENUMPROCW lpEnumFunc); WINBOOL STDCALL @@ -2050,7 +2050,7 @@ UpdateICMRegKeyW(DWORD, DWORD, LPWSTR, UINT); int STDCALL -EnumICMProfilesW(HDC,ICMENUMPROC,LPARAM); +EnumICMProfilesW(HDC,ICMENUMPROCW,LPARAM); HPROPSHEETPAGE STDCALL @@ -2553,7 +2553,7 @@ GetCurrencyFormatW( WINBOOL STDCALL EnumCalendarInfoW( - CALINFO_ENUMPROC lpCalInfoEnumProc, + CALINFO_ENUMPROCW lpCalInfoEnumProc, LCID Locale, CALID Calendar, CALTYPE CalType); @@ -2561,14 +2561,14 @@ EnumCalendarInfoW( WINBOOL STDCALL EnumTimeFormatsW( - TIMEFMT_ENUMPROC lpTimeFmtEnumProc, + TIMEFMT_ENUMPROCW lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags); WINBOOL STDCALL EnumDateFormatsW( - DATEFMT_ENUMPROC lpDateFmtEnumProc, + DATEFMT_ENUMPROCW lpDateFmtEnumProc, LCID Locale, DWORD dwFlags); @@ -2601,13 +2601,13 @@ FoldStringW( WINBOOL STDCALL EnumSystemLocalesW( - LOCALE_ENUMPROC lpLocaleEnumProc, + LOCALE_ENUMPROCW lpLocaleEnumProc, DWORD dwFlags); WINBOOL STDCALL EnumSystemCodePagesW( - CODEPAGE_ENUMPROC lpCodePageEnumProc, + CODEPAGE_ENUMPROCW lpCodePageEnumProc, DWORD dwFlags); WINBOOL @@ -3056,6 +3056,12 @@ WINBOOL STDCALL CreateProcessAsUserW (HANDLE, LPCWSTR, LPWSTR, DWORD, LPVOID, LPCWSTR, STARTUPINFOW*, PROCESS_INFORMATION*); +DWORD WINAPI +SHGetFileInfoW (LPCWSTR, DWORD, SHFILEINFO FAR *, UINT, UINT); + +WINBOOL WINAPI +SHGetPathFromIDListW (LPCITEMIDLIST, LPWSTR); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/reactos/include/win32k/icm.h b/reactos/include/win32k/icm.h index 8ac47a1d7d9..6bdfc475fad 100644 --- a/reactos/include/win32k/icm.h +++ b/reactos/include/win32k/icm.h @@ -25,9 +25,9 @@ W32kDeleteColorSpace(HCOLORSPACE hColorSpace); INT STDCALL -W32kEnumICMProfiles(HDC hDC, - ICMENUMPROC EnumICMProfilesFunc, - LPARAM lParam); +W32kEnumICMProfiles(HDC hDC, + LPWSTR lpstrBuffer, + UINT cch ); HCOLORSPACE STDCALL diff --git a/reactos/include/win32k/ntuser.h b/reactos/include/win32k/ntuser.h index 18e57611ff5..42c4c60d665 100644 --- a/reactos/include/win32k/ntuser.h +++ b/reactos/include/win32k/ntuser.h @@ -10,6 +10,7 @@ NtUserGetClassLong(HWND hWnd, DWORD Offset, BOOL Ansi); LONG STDCALL NtUserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi); + INT STDCALL NtUserReleaseDC(HWND hWnd, HDC hDc); @@ -1164,6 +1165,7 @@ NtUserRegisterClassExWOW(CONST WNDCLASSEXW* lpwcx, DWORD Unknown4, DWORD Unknown5); + DWORD STDCALL NtUserRegisterHotKey( diff --git a/reactos/include/winsock2.h b/reactos/include/winsock2.h index 642c00e63fe..72ee035c2d7 100644 --- a/reactos/include/winsock2.h +++ b/reactos/include/winsock2.h @@ -494,6 +494,7 @@ typedef struct _WSAPROTOCOL_INFOW { WCHAR szProtocol[WSAPROTOCOL_LEN + 1]; } WSAPROTOCOL_INFOW, FAR * LPWSAPROTOCOL_INFOW; +#ifndef _DISABLE_TIDENTS #ifdef UNICODE typedef WSAPROTOCOL_INFOW WSAPROTOCOL_INFO; typedef LPWSAPROTOCOL_INFOW LPWSAPROTOCOL_INFO; @@ -501,6 +502,7 @@ typedef LPWSAPROTOCOL_INFOW LPWSAPROTOCOL_INFO; typedef WSAPROTOCOL_INFOA WSAPROTOCOL_INFO; typedef LPWSAPROTOCOL_INFOA LPWSAPROTOCOL_INFO; #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* WinSock 2 extended commands for WSAIoctl() */ @@ -696,6 +698,7 @@ typedef struct _WSANAMESPACE_INFOW { LPWSTR lpszIdentifier; } WSANAMESPACE_INFOW, *PWSANAMESPACE_INFOW, *LPWSANAMESPACE_INFOW; +#ifndef _DISABLE_TIDENTS #ifdef UNICODE typedef WSANAMESPACE_INFOW WSANAMESPACE_INFO; typedef PWSANAMESPACE_INFOW PWSANAMESPACE_INFO; @@ -705,6 +708,7 @@ typedef WSANAMESPACE_INFOA WSANAMESPACE_INFO; typedef PWSANAMESPACE_INFOA PWSANAMESPACE_INFO; typedef LPWSANAMESPACE_INFOA LPWSANAMESPACE_INFO; #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ typedef enum _WSAEcomparator @@ -762,6 +766,7 @@ typedef struct _WSAQuerySetW { LPBLOB lpBlob; } WSAQUERYSETW, *PWSAQUERYSETW, *LPWSAQUERYSETW; +#ifndef _DISABLE_TIDENTS #ifdef UNICODE typedef WSAQUERYSETW WSAQUERYSET; typedef PWSAQUERYSETW PWSAQUERYSET; @@ -771,6 +776,7 @@ typedef WSAQUERYSETA WSAQUERYSET; typedef PWSAQUERYSETA PWSAQUERYSET; typedef LPWSAQUERYSETA LPWSAQUERYSET; #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ typedef enum _WSAESETSERVICEOP { @@ -796,6 +802,7 @@ typedef struct _WSANSClassInfoW { LPVOID lpValue; } WSANSCLASSINFOW, *PWSANSCLASSINFOW, *LPWSANSCLASSINFOW; +#ifndef _DISABLE_TIDENTS #ifdef UNICODE typedef WSANSCLASSINFOW WSANSCLASSINFO; typedef PWSANSCLASSINFOW PWSANSCLASSINFO; @@ -805,6 +812,7 @@ typedef WSANSCLASSINFOA WSANSCLASSINFO; typedef PWSANSCLASSINFOA PWSANSCLASSINFO; typedef LPWSANSCLASSINFOA LPWSANSCLASSINFO; #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ typedef struct _WSAServiceClassInfoA { LPGUID lpServiceClassId; @@ -820,6 +828,7 @@ typedef struct _WSAServiceClassInfoW { LPWSANSCLASSINFOW lpClassInfos; } WSASERVICECLASSINFOW, *PWSASERVICECLASSINFOW, *LPWSASERVICECLASSINFOW; +#ifndef _DISABLE_TIDENTS #ifdef UNICODE typedef WSASERVICECLASSINFOW WSASERVICECLASSINFO; typedef PWSASERVICECLASSINFOW PWSASERVICECLASSINFO; @@ -829,6 +838,7 @@ typedef WSASERVICECLASSINFOA WSASERVICECLASSINFO; typedef PWSASERVICECLASSINFOA PWSASERVICECLASSINFO; typedef LPWSASERVICECLASSINFOA LPWSASERVICECLASSINFO; #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* WinSock 2 DLL prototypes */ @@ -1041,11 +1051,13 @@ WSADuplicateSocketW( IN DWORD dwProcessId, OUT LPWSAPROTOCOL_INFOW lpProtocolInfo); +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define WSADuplicateSocket WSADuplicateSocketA #else /* UNICODE */ #define WSADuplicateSocket WSADuplicateSocketW #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ INT WSAAPI @@ -1068,11 +1080,13 @@ WSAEnumProtocolsW( OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer, IN OUT LPDWORD lpdwBufferLength); +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define WSAEnumProtocols WSAEnumProtocolsA #else /* UNICODE */ #define WSAEnumProtocols WSAEnumProtocolsW #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ INT WSAAPI @@ -1258,11 +1272,13 @@ WSASocketW( IN GROUP g, IN DWORD dwFlags); +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define WSASocket WSASocketW #else /* UNICODE */ #define WSASocket WSASocketA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ INT WSAAPI @@ -1310,11 +1326,13 @@ WSAAddressToStringW( OUT LPWSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength); +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define WSAAddressToString WSAAddressToStringW #else /* UNICODE */ #define WSAAddressToString WSAAddressToStringA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ INT WSAAPI @@ -1328,11 +1346,13 @@ WSAEnumNameSpaceProvidersW( IN OUT LPDWORD lpdwBufferLength, OUT LPWSANAMESPACE_INFOW lpnspBuffer); +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define WSAEnumNameSpaceProviders WSAEnumNameSpaceProvidersW #else /* UNICODE */ #define WSAEnumNameSpaceProviders WSAEnumNameSpaceProvidersA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ INT WSAAPI @@ -1350,11 +1370,13 @@ WSAGetServiceClassInfoW( IN OUT LPDWORD lpdwBufferLength, OUT LPWSASERVICECLASSINFOW lpServiceClassInfo); +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define WSAGetServiceClassInfo WSAGetServiceClassInfoW #else /* UNICODE */ #define WSAGetServiceClassInfo WSAGetServiceClassInfoA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ INT WSAAPI @@ -1370,11 +1392,13 @@ WSAGetServiceClassNameByClassIdW( OUT LPWSTR lpszServiceClassName, IN OUT LPDWORD lpdwBufferLength); +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define WSAGetServiceClassNameByClassId WSAGetServiceClassNameByClassIdW #else /* UNICODE */ #define WSAGetServiceClassNameByClassId WSAGetServiceClassNameByClassIdA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ INT WSAAPI @@ -1386,19 +1410,36 @@ WSAAPI WSAInstallServiceClassW( IN LPWSASERVICECLASSINFOW lpServiceClassInfo); +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define WSAInstallServiceClass WSAInstallServiceClassW #else /* UNICODE */ #define WSAInstallServiceClass WSAInstallServiceClassA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ INT WSAAPI -WSALookupServiceBegin( - IN LPWSAQUERYSET lpqsRestrictions, +WSALookupServiceBeginA( + IN LPWSAQUERYSETA lpqsRestrictions, IN DWORD dwControlFlags, OUT LPHANDLE lphLookup); +INT +WSAAPI +WSALookupServiceBeginW( + IN LPWSAQUERYSETW lpqsRestrictions, + IN DWORD dwControlFlags, + OUT LPHANDLE lphLookup); + +#ifndef _DISABLE_TIDENTS +#ifdef UNICODE +#define WSALookupServiceBegin WSALookupServiceBeginW +#else /* UNICODE */ +#define WSALookupServiceBegin WSALookupServiceBeginA +#endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ + INT WSAAPI WSALookupServiceEnd( @@ -1406,11 +1447,27 @@ WSALookupServiceEnd( INT WSAAPI -WSALookupServiceNext( - IN HANDLE hLookup, - IN DWORD dwControlFlags, - IN OUT LPDWORD lpdwBufferLength, - OUT LPWSAQUERYSET lpqsResults); +WSALookupServiceNextA( + IN HANDLE hLookup, + IN DWORD dwControlFlags, + IN OUT LPDWORD lpdwBufferLength, + OUT LPWSAQUERYSETA lpqsResults); + +INT +WSAAPI +WSALookupServiceNextW( + IN HANDLE hLookup, + IN DWORD dwControlFlags, + IN OUT LPDWORD lpdwBufferLength, + OUT LPWSAQUERYSETW lpqsResults); + +#ifndef _DISABLE_TIDENTS +#ifdef UNICODE +#define WSALookupServiceNext WSALookupServiceNextW +#else /* UNICODE */ +#define WSALookupServiceNext WSALookupServiceNextA +#endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ INT WSAAPI @@ -1419,10 +1476,25 @@ WSARemoveServiceClass( INT WSAAPI -WSASetService( - IN LPWSAQUERYSET lpqsRegInfo, +WSASetServiceA( + IN LPWSAQUERYSETA lpqsRegInfo, + IN WSAESETSERVICEOP essOperation, + IN DWORD dwControlFlags); + +INT +WSAAPI +WSASetServiceW( + IN LPWSAQUERYSETW lpqsRegInfo, IN WSAESETSERVICEOP essOperation, - IN DWORD dwControlFlags); + IN DWORD dwControlFlags); + +#ifndef _DISABLE_TIDENTS +#ifdef UNICODE +#define WSASetService WSASetServiceW +#else /* UNICODE */ +#define WSASetService WSASetServiceA +#endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ INT WSAAPI @@ -1442,11 +1514,13 @@ WSAStringToAddressW( OUT LPSOCKADDR lpAddress, IN OUT LPINT lpAddressLength); +#ifndef _DISABLE_TIDENTS #ifdef UNICODE #define WSAStringToAddress WSAStringToAddressW #else /* UNICODE */ #define WSAStringToAddress WSAStringToAddressA #endif /* UNICODE */ +#endif /* _DISABLE_TIDENTS */ /* WinSock 1.1 compatible name resolution APIs */ diff --git a/reactos/include/ws2spi.h b/reactos/include/ws2spi.h index 1523de3f5f5..70c92af946b 100644 --- a/reactos/include/ws2spi.h +++ b/reactos/include/ws2spi.h @@ -444,7 +444,7 @@ typedef INT (WSPAPI * LPNSPLOOKUPSERVICENEXT)( IN HANDLE hLookup, IN DWORD dwControlFlags, IN OUT LPDWORD lpdwBufferLength, - OUT LPWSAQUERYSET lpqsResults); + OUT LPWSAQUERYSETW lpqsResults); typedef INT (WSPAPI * LPNSPREMOVESERVICECLASS)( IN LPGUID lpProviderId, diff --git a/reactos/lib/advapi32/makefile b/reactos/lib/advapi32/makefile index 8cd73597feb..2975c04b329 100644 --- a/reactos/lib/advapi32/makefile +++ b/reactos/lib/advapi32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.28 2003/07/20 00:04:06 ekohl Exp $ +# $Id: makefile,v 1.29 2003/08/07 04:03:22 royce Exp $ PATH_TO_TOP = ../.. @@ -11,6 +11,9 @@ TARGET_CFLAGS = \ -Werror \ -fno-builtin +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib TARGET_SDKLIBS = ntdll.a kernel32.a diff --git a/reactos/lib/advapi32/service/scm.c b/reactos/lib/advapi32/service/scm.c index 2e3af6fd4ef..ae519b77c45 100644 --- a/reactos/lib/advapi32/service/scm.c +++ b/reactos/lib/advapi32/service/scm.c @@ -1,4 +1,4 @@ -/* $Id: scm.c,v 1.18 2003/07/21 03:40:58 royce Exp $ +/* $Id: scm.c,v 1.19 2003/08/07 04:03:22 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -458,157 +458,175 @@ SC_HANDLE STDCALL OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess) { - HANDLE hPipe; - DWORD dwMode; - DWORD dwWait; - BOOL fSuccess; - HANDLE hStartEvent; - LPWSTR lpszPipeName = L"\\\\.\\pipe\\Ntsvcs"; - - DPRINT("OpenSCManagerW(%x, %x, %d)\n", lpMachineName, lpDatabaseName, dwDesiredAccess); + HANDLE hPipe; + DWORD dwMode; + DWORD dwWait; + BOOL fSuccess; + HANDLE hStartEvent; + LPWSTR lpszPipeName = L"\\\\.\\pipe\\Ntsvcs"; + + DPRINT("OpenSCManagerW(%x, %x, %d)\n", lpMachineName, lpDatabaseName, dwDesiredAccess); - if (lpMachineName == NULL || wcslen(lpMachineName) == 0) { - if (lpDatabaseName != NULL && wcscmp(lpDatabaseName, SERVICES_ACTIVE_DATABASEW) != 0) { - DPRINT("OpenSCManagerW() - Invalid parameters.\n"); - return NULL; - } + if (lpMachineName == NULL || wcslen(lpMachineName) == 0) + { + if (lpDatabaseName != NULL && wcscmp(lpDatabaseName, SERVICES_ACTIVE_DATABASEW) != 0) + { + DPRINT("OpenSCManagerW() - Invalid parameters.\n"); + return NULL; + } - DPRINT("OpenSCManagerW() - OpenEvent(\"SvcctrlStartEvent_A3725DX\")\n"); + DPRINT("OpenSCManagerW() - OpenEvent(\"SvcctrlStartEvent_A3725DX\")\n"); - // Only connect to scm when event "SvcctrlStartEvent_A3725DX" is signaled - hStartEvent = OpenEvent(SYNCHRONIZE, FALSE, _T("SvcctrlStartEvent_A3725DX")); - if (hStartEvent == NULL) { - SetLastError(ERROR_DATABASE_DOES_NOT_EXIST); - DPRINT("OpenSCManagerW() - Failed to Open Event \"SvcctrlStartEvent_A3725DX\".\n"); - return NULL; - } + // Only connect to scm when event "SvcctrlStartEvent_A3725DX" is signaled + hStartEvent = OpenEventW(SYNCHRONIZE, FALSE, L"SvcctrlStartEvent_A3725DX"); + if (hStartEvent == NULL) + { + SetLastError(ERROR_DATABASE_DOES_NOT_EXIST); + DPRINT("OpenSCManagerW() - Failed to Open Event \"SvcctrlStartEvent_A3725DX\".\n"); + return NULL; + } - DPRINT("OpenSCManagerW() - Waiting forever on event handle: %x\n", hStartEvent); + DPRINT("OpenSCManagerW() - Waiting forever on event handle: %x\n", hStartEvent); #if 1 - dwWait = WaitForSingleObject(hStartEvent, INFINITE); - if (dwWait == WAIT_FAILED) { - DPRINT("OpenSCManagerW() - Wait For Start Event failed.\n"); - SetLastError(ERROR_ACCESS_DENIED); - return NULL; - } + dwWait = WaitForSingleObject(hStartEvent, INFINITE); + if (dwWait == WAIT_FAILED) + { + DPRINT("OpenSCManagerW() - Wait For Start Event failed.\n"); + SetLastError(ERROR_ACCESS_DENIED); + return NULL; + } #else - { - DWORD Count; - - /* wait for event creation (by SCM) for max. 20 seconds */ - for (Count = 0; Count < 20; Count++) - { - dwWait = WaitForSingleObject(hStartEvent, 1000); - if (dwWait == WAIT_FAILED) { - DPRINT("OpenSCManagerW() - Wait For Start Event failed.\n"); - Sleep(1000); - } else { - break; - } - } - - if (dwWait == WAIT_FAILED) - { - DbgPrint("WL: Failed to wait on event \"SvcctrlStartEvent_A3725DX\"\n"); - } - - } + { + DWORD Count; + + /* wait for event creation (by SCM) for max. 20 seconds */ + for (Count = 0; Count < 20; Count++) + { + dwWait = WaitForSingleObject(hStartEvent, 1000); + if (dwWait == WAIT_FAILED) + { + DPRINT("OpenSCManagerW() - Wait For Start Event failed.\n"); + Sleep(1000); + } + else + { + break; + } + } + + if (dwWait == WAIT_FAILED) + { + DbgPrint("WL: Failed to wait on event \"SvcctrlStartEvent_A3725DX\"\n"); + } + + } #endif - DPRINT("OpenSCManagerW() - Closing handle to event...\n"); - - CloseHandle(hStartEvent); - - // Try to open a named pipe; wait for it, if necessary - while (1) { - DWORD dwLastError; - DPRINT("OpenSCManagerW() - attempting to open named pipe to SCM.\n"); - hPipe = CreateFileW(lpszPipeName, // pipe name - dwDesiredAccess, - 0, // no sharing - NULL, // no security attributes - OPEN_EXISTING, // opens existing pipe - 0, // default attributes - NULL); // no template file - - DPRINT("OpenSCManagerW() - handle to named pipe: %x\n", hPipe); - // Break if the pipe handle is valid - if (hPipe != INVALID_HANDLE_VALUE) { - break; - } - - // Exit if an error other than ERROR_PIPE_BUSY occurs - dwLastError = GetLastError(); - if (dwLastError != ERROR_PIPE_BUSY) { - DPRINT("OpenSCManagerW() - returning at 4, dwLastError %d\n", dwLastError); - return NULL; - } - - // All pipe instances are busy, so wait for 20 seconds - if (!WaitNamedPipeW(lpszPipeName, 20000)) { - DPRINT("OpenSCManagerW() - Failed on WaitNamedPipeW(...).\n"); - return NULL; - } - } - - // The pipe connected; change to message-read mode - dwMode = PIPE_READMODE_MESSAGE; - fSuccess = SetNamedPipeHandleState( - hPipe, // pipe handle - &dwMode, // new pipe mode - NULL, // don't set maximum bytes - NULL); // don't set maximum time - if (!fSuccess) { - CloseHandle(hPipe); - DPRINT("OpenSCManagerW() - Failed on SetNamedPipeHandleState(...).\n"); - return NULL; - } + DPRINT("OpenSCManagerW() - Closing handle to event...\n"); + + CloseHandle(hStartEvent); + + // Try to open a named pipe; wait for it, if necessary + while (1) + { + DWORD dwLastError; + DPRINT("OpenSCManagerW() - attempting to open named pipe to SCM.\n"); + hPipe = CreateFileW(lpszPipeName, // pipe name + dwDesiredAccess, + 0, // no sharing + NULL, // no security attributes + OPEN_EXISTING, // opens existing pipe + 0, // default attributes + NULL); // no template file + + DPRINT("OpenSCManagerW() - handle to named pipe: %x\n", hPipe); + // Break if the pipe handle is valid + if (hPipe != INVALID_HANDLE_VALUE) + { + break; + } + + // Exit if an error other than ERROR_PIPE_BUSY occurs + dwLastError = GetLastError(); + if (dwLastError != ERROR_PIPE_BUSY) + { + DPRINT("OpenSCManagerW() - returning at 4, dwLastError %d\n", dwLastError); + return NULL; + } + + // All pipe instances are busy, so wait for 20 seconds + if (!WaitNamedPipeW(lpszPipeName, 20000)) + { + DPRINT("OpenSCManagerW() - Failed on WaitNamedPipeW(...).\n"); + return NULL; + } + } + + // The pipe connected; change to message-read mode + dwMode = PIPE_READMODE_MESSAGE; + fSuccess = SetNamedPipeHandleState( + hPipe, // pipe handle + &dwMode, // new pipe mode + NULL, // don't set maximum bytes + NULL); // don't set maximum time + if (!fSuccess) + { + CloseHandle(hPipe); + DPRINT("OpenSCManagerW() - Failed on SetNamedPipeHandleState(...).\n"); + return NULL; + } #if 0 - // Send a message to the pipe server - lpvMessage = (argc > 1) ? argv[1] : "default message"; - - fSuccess = WriteFile( - hPipe, // pipe handle - lpvMessage, // message - strlen(lpvMessage) + 1, // message length - &cbWritten, // bytes written - NULL); // not overlapped - if (!fSuccess) { - CloseHandle(hPipe); - DPRINT("OpenSCManagerW() - Failed to write to pipe.\n"); - return NULL; - } - - do { - DPRINT("OpenSCManagerW() - in I/O loop to SCM...\n"); - // Read from the pipe - fSuccess = ReadFile( - hPipe, // pipe handle - chBuf, // buffer to receive reply - 512, // size of buffer - &cbRead, // number of bytes read - NULL); // not overlapped - - if (!fSuccess && GetLastError() != ERROR_MORE_DATA) { - break; - } - - // Reply from the pipe is written to STDOUT. - if (!WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), chBuf, cbRead, &cbWritten, NULL)) { - break; - } - } while(!fSuccess); // repeat loop if ERROR_MORE_DATA - - DPRINT("OpenSCManagerW() - I/O loop completed.\n"); - //CloseHandle(hPipe); + // Send a message to the pipe server + lpvMessage = (argc > 1) ? argv[1] : "default message"; + + fSuccess = WriteFile( + hPipe, // pipe handle + lpvMessage, // message + strlen(lpvMessage) + 1, // message length + &cbWritten, // bytes written + NULL); // not overlapped + if (!fSuccess) + { + CloseHandle(hPipe); + DPRINT("OpenSCManagerW() - Failed to write to pipe.\n"); + return NULL; + } + + do + { + DPRINT("OpenSCManagerW() - in I/O loop to SCM...\n"); + // Read from the pipe + fSuccess = ReadFile( + hPipe, // pipe handle + chBuf, // buffer to receive reply + 512, // size of buffer + &cbRead, // number of bytes read + NULL); // not overlapped + + if (!fSuccess && GetLastError() != ERROR_MORE_DATA) + { + break; + } + + // Reply from the pipe is written to STDOUT. + if (!WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), chBuf, cbRead, &cbWritten, NULL)) + { + break; + } + } while(!fSuccess); // repeat loop if ERROR_MORE_DATA + + DPRINT("OpenSCManagerW() - I/O loop completed.\n"); + //CloseHandle(hPipe); #endif - DPRINT("OpenSCManagerW() - success, returning handle to pipe %x\n", hPipe); - return hPipe; - } else { - /* FIXME: Connect to remote SCM */ - DPRINT("OpenSCManagerW() - FIXME: Connect to remote SCM not implemented.\n"); - return NULL; + DPRINT("OpenSCManagerW() - success, returning handle to pipe %x\n", hPipe); + return hPipe; + } + else + { + /* FIXME: Connect to remote SCM */ + DPRINT("OpenSCManagerW() - FIXME: Connect to remote SCM not implemented.\n"); + return NULL; } } diff --git a/reactos/lib/advapi32/service/sctrl.c b/reactos/lib/advapi32/service/sctrl.c index 79fbe041ff1..ae8d0f0c55a 100644 --- a/reactos/lib/advapi32/service/sctrl.c +++ b/reactos/lib/advapi32/service/sctrl.c @@ -1,4 +1,4 @@ -/* $Id: sctrl.c,v 1.10 2003/07/10 15:05:55 chorns Exp $ +/* $Id: sctrl.c,v 1.11 2003/08/07 04:03:22 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -28,7 +28,7 @@ typedef struct { DWORD ThreadId; UNICODE_STRING ServiceName; - LPSERVICE_MAIN_FUNCTION MainFunction; + LPSERVICE_MAIN_FUNCTIONW MainFunction; LPHANDLER_FUNCTION HandlerFunction; SERVICE_STATUS ServiceStatus; } ACTIVE_SERVICE, *PACTIVE_SERVICE; @@ -139,7 +139,7 @@ ScServiceDispatcher(HANDLE hPipe, PVOID p1, PVOID p2) DWORD WINAPI ScServiceMainStub(LPVOID Context) { - LPSERVICE_MAIN_FUNCTION lpServiceProc = (LPSERVICE_MAIN_FUNCTION)Context; + LPSERVICE_MAIN_FUNCTIONW lpServiceProc = (LPSERVICE_MAIN_FUNCTIONW)Context; /* FIXME: Send argc and argv (from command line) as arguments */ @@ -266,6 +266,8 @@ SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus, BOOL STDCALL StartServiceCtrlDispatcherA(LPSERVICE_TABLE_ENTRYA lpServiceStartTable) { + // FIXME how to deal with diffs between ANSI/UNICODE +#if 0 LPSERVICE_TABLE_ENTRYW ServiceStartTableW; ANSI_STRING ServiceNameA; UNICODE_STRING ServiceNameW; @@ -319,6 +321,10 @@ StartServiceCtrlDispatcherA(LPSERVICE_TABLE_ENTRYA lpServiceStartTable) RtlFreeHeap(RtlGetProcessHeap(), 0, ServiceStartTableW); return b; +#else + UNIMPLEMENTED; + return 0; +#endif } diff --git a/reactos/lib/crtdll/makefile b/reactos/lib/crtdll/makefile index a0d6716316f..a2b108353a5 100644 --- a/reactos/lib/crtdll/makefile +++ b/reactos/lib/crtdll/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.60 2003/07/24 15:59:46 gvg Exp $ +# $Id: makefile,v 1.61 2003/08/07 04:03:22 royce Exp $ PATH_TO_TOP = ../.. @@ -16,6 +16,9 @@ TARGET_LFLAGS = -nostartfiles TARGET_CFLAGS = -D_MSVCRT_LIB_ +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = string.a kernel32.a ntdll.a TARGET_OBJECTS = $(TARGET_NAME).o diff --git a/reactos/lib/crtdll/sys_stat/stat.c b/reactos/lib/crtdll/sys_stat/stat.c index f1f5738e0ce..278f842045a 100644 --- a/reactos/lib/crtdll/sys_stat/stat.c +++ b/reactos/lib/crtdll/sys_stat/stat.c @@ -14,7 +14,7 @@ int _stat(const char* path, struct stat* buffer) HANDLE fh; WIN32_FIND_DATAA wfd; - fh = FindFirstFile(path, &wfd); + fh = FindFirstFileA(path, &wfd); if (fh == INVALID_HANDLE_VALUE) { __set_errno(ENOFILE); return -1; @@ -45,7 +45,7 @@ int _stat(const char* path, struct stat* buffer) buffer->st_size = wfd.nFileSizeLow; buffer->st_nlink = 1; - if (FindNextFile(fh, &wfd)) { + if (FindNextFileA(fh, &wfd)) { __set_errno(ENOFILE); FindClose(fh); return -1; diff --git a/reactos/lib/epsapi/makefile b/reactos/lib/epsapi/makefile index 66f46331e05..9354c510f7d 100644 --- a/reactos/lib/epsapi/makefile +++ b/reactos/lib/epsapi/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.1 2003/04/13 03:24:27 hyperion Exp $ +# $Id: makefile,v 1.2 2003/08/07 04:03:22 royce Exp $ PATH_TO_TOP = ../.. @@ -6,6 +6,9 @@ TARGET_TYPE = library TARGET_NAME = epsapi +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_OBJECTS = \ enum/drivers.o \ enum/modules.o \ diff --git a/reactos/lib/fmifs/makefile b/reactos/lib/fmifs/makefile index 60a8414f873..ff42a535809 100644 --- a/reactos/lib/fmifs/makefile +++ b/reactos/lib/fmifs/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.18 2003/04/14 01:19:06 hyperion Exp $ +# $Id: makefile,v 1.19 2003/08/07 04:03:22 royce Exp $ PATH_TO_TOP = ../.. @@ -10,6 +10,9 @@ TARGET_BASE = 0x76df0000 TARGET_CFLAGS = -fno-builtin +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostdlib -nostartfiles TARGET_SDKLIBS = vfatlib.a ntdll.a kernel32.a diff --git a/reactos/lib/freetype/Makefile b/reactos/lib/freetype/Makefile index 1575696d8ac..21374bc7180 100644 --- a/reactos/lib/freetype/Makefile +++ b/reactos/lib/freetype/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2003/05/18 21:17:33 guido Exp $ +# $Id: Makefile,v 1.5 2003/08/07 04:03:22 royce Exp $ PATH_TO_TOP = ../.. @@ -20,6 +20,9 @@ endif TARGET_CFLAGS = $(CFLAGS_DBG) -Iinclude -Wall +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + ROS_OBJECTS = rosglue.o i386/setjmplongjmp.o TARGET_OBJECTS = objs/*.o $(ROS_OBJECTS) diff --git a/reactos/lib/fslib/vfatlib/Makefile b/reactos/lib/fslib/vfatlib/Makefile index 1d4f4165c0e..cdf32cc215e 100755 --- a/reactos/lib/fslib/vfatlib/Makefile +++ b/reactos/lib/fslib/vfatlib/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 2003/04/05 19:40:41 chorns Exp $ +# $Id: Makefile,v 1.2 2003/08/07 04:03:22 royce Exp $ PATH_TO_TOP = ../../.. @@ -6,6 +6,9 @@ TARGET_TYPE = library TARGET_NAME = vfatlib +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_OBJECTS = \ vfatlib.o diff --git a/reactos/lib/gdi32/makefile b/reactos/lib/gdi32/makefile index 931f02b91ff..53e1b4a7cdd 100644 --- a/reactos/lib/gdi32/makefile +++ b/reactos/lib/gdi32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.31 2003/08/04 00:28:44 royce Exp $ +# $Id: makefile,v 1.32 2003/08/07 04:03:22 royce Exp $ PATH_TO_TOP = ../.. @@ -17,6 +17,9 @@ TARGET_CFLAGS = \ -Werror \ -fno-builtin +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib MAIN_OBJECTS = main/dllmain.o diff --git a/reactos/lib/gdi32/misc/stubsa.c b/reactos/lib/gdi32/misc/stubsa.c index a0daf383b09..576969fcf72 100644 --- a/reactos/lib/gdi32/misc/stubsa.c +++ b/reactos/lib/gdi32/misc/stubsa.c @@ -1,4 +1,4 @@ -/* $Id: stubsa.c,v 1.22 2003/08/05 15:41:02 weiden Exp $ +/* $Id: stubsa.c,v 1.23 2003/08/07 04:03:22 royce Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -850,12 +850,22 @@ int STDCALL EnumICMProfilesA( HDC a0, - ICMENUMPROC a1, + ICMENUMPROCA a1, LPARAM a2 ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + /* + * FIXME - call W32kEnumICMProfiles with NULL for lpstrBuffer + * to find out how big a buffer we need. Then allocate that buffer + * and call W32kEnumICMProfiles again to have the buffer filled. + * + * Finally, step through the buffer ( MULTI-SZ recommended for format ), + * and convert each string to ANSI, calling the user's callback function + * until we run out of strings or the user returns FALSE + */ + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } diff --git a/reactos/lib/gdi32/misc/stubsw.c b/reactos/lib/gdi32/misc/stubsw.c index 23133a8375d..c5b263e6634 100644 --- a/reactos/lib/gdi32/misc/stubsw.c +++ b/reactos/lib/gdi32/misc/stubsw.c @@ -1,4 +1,4 @@ -/* $Id: stubsw.c,v 1.18 2003/08/05 15:41:02 weiden Exp $ +/* $Id: stubsw.c,v 1.19 2003/08/07 04:03:22 royce Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -587,13 +587,22 @@ SetICMProfileW( int STDCALL EnumICMProfilesW( - HDC a0, - ICMENUMPROC a1, - LPARAM a2 + HDC hDC, + ICMENUMPROCW lpEnumICMProfilesFunc, + LPARAM lParam ) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + /* + * FIXME - call W32kEnumICMProfiles with NULL for lpstrBuffer + * to find out how big a buffer we need. Then allocate that buffer + * and call W32kEnumICMProfiles again to have the buffer filled. + * + * Finally, step through the buffer ( MULTI-SZ recommended for format ), + * and call the user's callback function until we run out of strings or + * the user returns FALSE + */ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; } diff --git a/reactos/lib/gdi32/objects/text.c b/reactos/lib/gdi32/objects/text.c index c038f57cc20..656df4d09bb 100644 --- a/reactos/lib/gdi32/objects/text.c +++ b/reactos/lib/gdi32/objects/text.c @@ -79,7 +79,7 @@ SetTextColor(HDC hDC, COLORREF color) static BOOL -MetricsCharConvert(WCHAR w, BCHAR *b) +MetricsCharConvert(WCHAR w, CHAR *b) { UNICODE_STRING WString; WCHAR WBuf[2]; diff --git a/reactos/lib/iphlpapi/iphlpapi.c b/reactos/lib/iphlpapi/iphlpapi.c index 9314e85ccd6..a16ae1b6cd4 100644 --- a/reactos/lib/iphlpapi/iphlpapi.c +++ b/reactos/lib/iphlpapi/iphlpapi.c @@ -144,13 +144,13 @@ GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen) return lErr; // Determine the size of the largest name of any adapter and the number of adapters. - lErr = RegQueryInfoKey(hAdapters, NULL, NULL, NULL, NULL, &dwAdapterLen, NULL, NULL, NULL, NULL, NULL, NULL); + lErr = RegQueryInfoKeyW(hAdapters, NULL, NULL, NULL, NULL, &dwAdapterLen, NULL, NULL, NULL, NULL, NULL, NULL); if(lErr != ERROR_SUCCESS) { RegCloseKey(hAdapters); return lErr; } - dwAdapterLen++; // RegQueryInfoKey return value does not include terminating null. + dwAdapterLen++; // RegQueryInfoKeyW return value does not include terminating null. strAdapter = (wchar_t*) malloc(dwAdapterLen * sizeof(wchar_t)); @@ -220,17 +220,17 @@ GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen) // TODO UINT DhcpEnabled // TODO PIP_ADDR_STRING CurrentIpAddress // IP_ADDR_STRING IpAddressList - dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("IPAddress"), NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpAddress, &dwSize); - dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("SubnetMask"), NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpMask, &dwSize); + dwSize = 16; lErr = RegQueryValueExW(hIpConfig, L"IPAddress", NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpAddress, &dwSize); + dwSize = 16; lErr = RegQueryValueExW(hIpConfig, L"SubnetMask", NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpMask, &dwSize); if(strstr(pCurrentAdapter->IpAddressList.IpAddress.String, "0.0.0.0") != 0) { - dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("DhcpIPAddress"), NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpAddress, &dwSize); - dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("DhcpSubnetMask"), NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpMask, &dwSize); + dwSize = 16; lErr = RegQueryValueExW(hIpConfig, L"DhcpIPAddress", NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpAddress, &dwSize); + dwSize = 16; lErr = RegQueryValueExW(hIpConfig, L"DhcpSubnetMask", NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpMask, &dwSize); } // TODO IP_ADDR_STRING GatewayList // IP_ADDR_STRING DhcpServer - dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("DhcpServer"), NULL, NULL, (BYTE*) &pCurrentAdapter->DhcpServer.IpAddress, &dwSize); - dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("DhcpSubnetMask"), NULL, NULL, (BYTE*) &pCurrentAdapter->DhcpServer.IpMask, &dwSize); + dwSize = 16; lErr = RegQueryValueExW(hIpConfig, L"DhcpServer", NULL, NULL, (BYTE*) &pCurrentAdapter->DhcpServer.IpAddress, &dwSize); + dwSize = 16; lErr = RegQueryValueExW(hIpConfig, L"DhcpSubnetMask", NULL, NULL, (BYTE*) &pCurrentAdapter->DhcpServer.IpMask, &dwSize); // TODO BOOL HaveWins // TODO IP_ADDR_STRING PrimaryWinsServer // TODO IP_ADDR_STRING SecondaryWinsServer @@ -351,60 +351,70 @@ DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen) { - DWORD result = ERROR_SUCCESS; - DWORD dwSize; - HKEY hKey; - LONG errCode; - - if (pFixedInfo == NULL || pOutBufLen == NULL) return ERROR_INVALID_PARAMETER; - - if (*pOutBufLen < sizeof(FIXED_INFO)) { - *pOutBufLen = sizeof(FIXED_INFO); - return ERROR_BUFFER_OVERFLOW; + DWORD result = ERROR_SUCCESS; + DWORD dwSize; + HKEY hKey; + LONG errCode; + + if (pFixedInfo == NULL || pOutBufLen == NULL) return ERROR_INVALID_PARAMETER; + + if (*pOutBufLen < sizeof(FIXED_INFO)) + { + *pOutBufLen = sizeof(FIXED_INFO); + return ERROR_BUFFER_OVERFLOW; + } + memset(pFixedInfo, 0, sizeof(FIXED_INFO)); + + errCode = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", 0, KEY_READ, &hKey); + if (errCode == ERROR_SUCCESS) + { + dwSize = sizeof(pFixedInfo->HostName); + errCode = RegQueryValueExA(hKey, "Hostname", NULL, NULL, (LPBYTE)&pFixedInfo->HostName, &dwSize); + dwSize = sizeof(pFixedInfo->DomainName); + errCode = RegQueryValueExA(hKey, "Domain", NULL, NULL, (LPBYTE)&pFixedInfo->DomainName, &dwSize); + if (errCode != ERROR_SUCCESS) + { + dwSize = sizeof(pFixedInfo->DomainName); + errCode = RegQueryValueExA(hKey, "DhcpDomain", NULL, NULL, (LPBYTE)&pFixedInfo->DomainName, &dwSize); } - memset(pFixedInfo, 0, sizeof(FIXED_INFO)); - - errCode = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"), 0, KEY_READ, &hKey); - if (errCode == ERROR_SUCCESS) { - dwSize = sizeof(pFixedInfo->HostName); - errCode = RegQueryValueExA(hKey, "Hostname", NULL, NULL, (LPBYTE)&pFixedInfo->HostName, &dwSize); - dwSize = sizeof(pFixedInfo->DomainName); - errCode = RegQueryValueExA(hKey, "Domain", NULL, NULL, (LPBYTE)&pFixedInfo->DomainName, &dwSize); - if (errCode != ERROR_SUCCESS) { - dwSize = sizeof(pFixedInfo->DomainName); - errCode = RegQueryValueExA(hKey, "DhcpDomain", NULL, NULL, (LPBYTE)&pFixedInfo->DomainName, &dwSize); - } - dwSize = sizeof(pFixedInfo->EnableRouting); - errCode = RegQueryValueEx(hKey, _T("IPEnableRouter"), NULL, NULL, (LPBYTE)&pFixedInfo->EnableRouting, &dwSize); - RegCloseKey(hKey); - } else { - result = ERROR_NO_DATA; // No adapter information exists for the local computer - } - - errCode = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SYSTEM\\CurrentControlSet\\Services\\NetBT\\Parameters"), 0, KEY_READ, &hKey); - if (errCode == ERROR_SUCCESS) { - dwSize = sizeof(pFixedInfo->ScopeId); - errCode = RegQueryValueExA(hKey, "ScopeId", NULL, NULL, (LPBYTE)&pFixedInfo->ScopeId, &dwSize); - if (errCode != ERROR_SUCCESS) { - dwSize = sizeof(pFixedInfo->ScopeId); - errCode = RegQueryValueExA(hKey, "DhcpScopeId", NULL, NULL, (LPBYTE)&pFixedInfo->ScopeId, &dwSize); - } - dwSize = sizeof(pFixedInfo->NodeType); - errCode = RegQueryValueEx(hKey, _T("NodeType"), NULL, NULL, (LPBYTE)&pFixedInfo->NodeType, &dwSize); - if (errCode != ERROR_SUCCESS) { - dwSize = sizeof(pFixedInfo->NodeType); - errCode = RegQueryValueExA(hKey, "DhcpNodeType", NULL, NULL, (LPBYTE)&pFixedInfo->NodeType, &dwSize); - } - dwSize = sizeof(pFixedInfo->EnableProxy); - errCode = RegQueryValueEx(hKey, _T("EnableProxy"), NULL, NULL, (LPBYTE)&pFixedInfo->EnableProxy, &dwSize); - dwSize = sizeof(pFixedInfo->EnableDns); - errCode = RegQueryValueEx(hKey, _T("EnableDNS"), NULL, NULL, (LPBYTE)&pFixedInfo->EnableDns, &dwSize); - RegCloseKey(hKey); - } else { - result = ERROR_NO_DATA; // No adapter information exists for the local computer - } - - return result; + dwSize = sizeof(pFixedInfo->EnableRouting); + errCode = RegQueryValueExW(hKey, L"IPEnableRouter", NULL, NULL, (LPBYTE)&pFixedInfo->EnableRouting, &dwSize); + RegCloseKey(hKey); + } + else + { + result = ERROR_NO_DATA; // No adapter information exists for the local computer + } + + errCode = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Services\\NetBT\\Parameters", 0, KEY_READ, &hKey); + if (errCode == ERROR_SUCCESS) + { + dwSize = sizeof(pFixedInfo->ScopeId); + errCode = RegQueryValueExA(hKey, "ScopeId", NULL, NULL, (LPBYTE)&pFixedInfo->ScopeId, &dwSize); + if (errCode != ERROR_SUCCESS) + { + dwSize = sizeof(pFixedInfo->ScopeId); + errCode = RegQueryValueExA(hKey, "DhcpScopeId", NULL, NULL, (LPBYTE)&pFixedInfo->ScopeId, &dwSize); + } + dwSize = sizeof(pFixedInfo->NodeType); + errCode = RegQueryValueExW(hKey, L"NodeType", NULL, NULL, (LPBYTE)&pFixedInfo->NodeType, &dwSize); + if (errCode != ERROR_SUCCESS) + { + dwSize = sizeof(pFixedInfo->NodeType); + errCode = RegQueryValueExA(hKey, "DhcpNodeType", NULL, NULL, (LPBYTE)&pFixedInfo->NodeType, &dwSize); + } + dwSize = sizeof(pFixedInfo->EnableProxy); + errCode = RegQueryValueExW(hKey, L"EnableProxy", NULL, NULL, (LPBYTE)&pFixedInfo->EnableProxy, &dwSize); + dwSize = sizeof(pFixedInfo->EnableDns); + errCode = RegQueryValueExW(hKey, L"EnableDNS", NULL, NULL, (LPBYTE)&pFixedInfo->EnableDns, &dwSize); + RegCloseKey(hKey); + } + else + { + result = ERROR_NO_DATA; // No adapter information exists for the local computer + } + + return result; } diff --git a/reactos/lib/iphlpapi/makefile b/reactos/lib/iphlpapi/makefile index e8e10aa50af..d1ef62ef5cd 100644 --- a/reactos/lib/iphlpapi/makefile +++ b/reactos/lib/iphlpapi/makefile @@ -10,6 +10,9 @@ TARGET_BASE = 0x777c0000 TARGET_CFLAGS = -DUNICODE -D_UNICODE +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = ntdll.a kernel32.a TARGET_OBJECTS = $(TARGET_NAME).o diff --git a/reactos/lib/iprtprio/makefile b/reactos/lib/iprtprio/makefile index 66ee0c33db6..deaab01ef7b 100644 --- a/reactos/lib/iprtprio/makefile +++ b/reactos/lib/iprtprio/makefile @@ -10,6 +10,9 @@ TARGET_BASE = 0x777c0000 TARGET_CFLAGS = -DUNICODE +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = ntdll.a kernel32.a TARGET_OBJECTS = $(TARGET_NAME).o diff --git a/reactos/lib/kbdus/makefile b/reactos/lib/kbdus/makefile index 669ee942de6..f43a685e0f5 100644 --- a/reactos/lib/kbdus/makefile +++ b/reactos/lib/kbdus/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.1 2003/07/31 16:47:08 royce Exp $ +# $Id: makefile,v 1.2 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -10,6 +10,9 @@ TARGET_BASE = 0x5500000 TARGET_CFLAGS = -I$(PATH_TO_TOP)/ntoskrnl/include +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib TARGET_SDKLIBS = diff --git a/reactos/lib/kernel32/file/find.c b/reactos/lib/kernel32/file/find.c index ab3fc9b35f6..60173496ee3 100644 --- a/reactos/lib/kernel32/file/find.c +++ b/reactos/lib/kernel32/file/find.c @@ -1,4 +1,4 @@ -/* $Id: find.c,v 1.37 2003/07/10 18:50:51 chorns Exp $ +/* $Id: find.c,v 1.38 2003/08/07 04:03:23 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -249,7 +249,7 @@ InternalFindFirstFile ( HANDLE STDCALL FindFirstFileA ( - LPCTSTR lpFileName, + LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData ) { diff --git a/reactos/lib/kernel32/makefile b/reactos/lib/kernel32/makefile index f17fbd93b91..e9683c9d30e 100644 --- a/reactos/lib/kernel32/makefile +++ b/reactos/lib/kernel32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.67 2003/06/08 21:00:04 ekohl Exp $ +# $Id: makefile,v 1.68 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -8,6 +8,9 @@ TARGET_NAME = kernel32 TARGET_BASE = 0x77f00000 +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib TARGET_SDKLIBS = rosrtl.a ntdll.a diff --git a/reactos/lib/kernel32/misc/error.c b/reactos/lib/kernel32/misc/error.c index c902c9a11ba..604c47e188d 100644 --- a/reactos/lib/kernel32/misc/error.c +++ b/reactos/lib/kernel32/misc/error.c @@ -1,4 +1,4 @@ -/* $Id: error.c,v 1.19 2003/07/10 18:50:51 chorns Exp $ +/* $Id: error.c,v 1.20 2003/08/07 04:03:23 royce Exp $ * * reactos/lib/kernel32/misc/error.c * @@ -45,7 +45,7 @@ Beep (DWORD dwFreq, DWORD dwDuration) BEEP_SET_PARAMETERS BeepSetParameters; DWORD dwReturned; - hBeep = CreateFile("\\\\.\\Beep", + hBeep = CreateFileA("\\\\.\\Beep", FILE_GENERIC_READ | FILE_GENERIC_WRITE, 0, NULL, diff --git a/reactos/lib/kernel32/misc/errormsg.c b/reactos/lib/kernel32/misc/errormsg.c index 3d192dc55ce..302c0afe6c4 100644 --- a/reactos/lib/kernel32/misc/errormsg.c +++ b/reactos/lib/kernel32/misc/errormsg.c @@ -1,4 +1,4 @@ -/* $Id: errormsg.c,v 1.6 2003/07/10 18:50:51 chorns Exp $ +/* $Id: errormsg.c,v 1.7 2003/08/07 04:03:23 royce Exp $ * * reactos/lib/kernel32/misc/errormsg.c * @@ -43,9 +43,6 @@ #define TRACE DPRINT #define FIXME DPRINT -#define strlenW lstrlen -#define strlen lstrlen - //#define MAKEINTRESOURCE(i) (LPTSTR) ((DWORD) ((WORD) (i))) //#define MAKEINTRESOURCEA(i) (LPTSTR) ((DWORD) ((WORD) (i))) //#define MAKEINTRESOURCEW(i) (LPTSTR) ((DWORD) ((WORD) (i))) @@ -206,7 +203,7 @@ static INT load_messageW( HMODULE instance, UINT id, WORD lang, { if (retval) { lstrcpynAtoW( buffer, buffer2, buflen ); - retval = strlenW( buffer ); + retval = lstrlenW( buffer ); } HeapFree( GetProcessHeap(), 0, buffer2 ); } @@ -250,7 +247,7 @@ DWORD WINAPI FormatMessageA( from = NULL; if (dwFlags & FORMAT_MESSAGE_FROM_STRING) { - from = RtlAllocateHeap(RtlGetProcessHeap(), 0, strlen((LPSTR)lpSource)+1 ); + from = RtlAllocateHeap(RtlGetProcessHeap(), 0, lstrlenA((LPSTR)lpSource)+1 ); strcpy( from, (LPSTR)lpSource ); } else { @@ -351,13 +348,13 @@ DWORD WINAPI FormatMessageA( f++; if (NULL!=(x=strchr(f,'!'))) { *x='\0'; - fmtstr=RtlAllocateHeap(RtlGetProcessHeap(),0,strlen(f)+2); + fmtstr=RtlAllocateHeap(RtlGetProcessHeap(),0,lstrlenA(f)+2); sprintf(fmtstr,"%%%s",f); f=x+1; } else { - fmtstr=RtlAllocateHeap(RtlGetProcessHeap(),0,strlen(f)+2); + fmtstr=RtlAllocateHeap(RtlGetProcessHeap(),0,lstrlenA(f)+2); sprintf(fmtstr,"%%%s",f); - f+=strlen(f); /*at \0*/ + f+=lstrlenA(f); /*at \0*/ } } else { if(!args) break; @@ -442,7 +439,7 @@ DWORD WINAPI FormatMessageA( } *t='\0'; } - talloced = strlen(target)+1; + talloced = lstrlenA(target)+1; if (nSize && talloced @@ -104,7 +104,7 @@ MultiByteToWideChar( //if (-1 == cchMultiByte) if (cchMultiByte < 0) { - InStringLength = lstrlen(lpMultiByteStr) + 1; + InStringLength = lstrlenA(lpMultiByteStr) + 1; } else { diff --git a/reactos/lib/kernel32/misc/res.c b/reactos/lib/kernel32/misc/res.c index 875f07c72c6..4d1b2e2d44d 100644 --- a/reactos/lib/kernel32/misc/res.c +++ b/reactos/lib/kernel32/misc/res.c @@ -1,4 +1,4 @@ -/* $Id: res.c,v 1.15 2003/07/10 18:50:51 chorns Exp $ +/* $Id: res.c,v 1.16 2003/08/07 04:03:23 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT : ReactOS user mode libraries @@ -120,7 +120,7 @@ FindResourceExW ( NTSTATUS Status; if ( hModule == NULL ) - hModule = GetModuleHandle(NULL); + hModule = (HINSTANCE)GetModuleHandleW(NULL); if ( !IS_INTRESOURCE(lpName) && lpName[0] == L'#' ) { lpName = MAKEINTRESOURCEW(wcstoul(lpName + 1, NULL, 10)); @@ -162,7 +162,7 @@ LoadResource ( if (hModule == NULL) { - hModule = GetModuleHandle(NULL); + hModule = (HINSTANCE)GetModuleHandleW(NULL); } Status = LdrAccessResource (hModule, hResInfo, &Data, NULL); @@ -284,11 +284,11 @@ EndUpdateResourceA ( WINBOOL STDCALL EnumResourceLanguagesW ( - HINSTANCE hModule, - LPCWSTR lpType, - LPCWSTR lpName, - ENUMRESLANGPROC lpEnumFunc, - LONG lParam + HINSTANCE hModule, + LPCWSTR lpType, + LPCWSTR lpName, + ENUMRESLANGPROCW lpEnumFunc, + LONG lParam ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -299,11 +299,11 @@ EnumResourceLanguagesW ( WINBOOL STDCALL EnumResourceLanguagesA ( - HINSTANCE hModule, - LPCSTR lpType, - LPCSTR lpName, - ENUMRESLANGPROC lpEnumFunc, - LONG lParam + HINSTANCE hModule, + LPCSTR lpType, + LPCSTR lpName, + ENUMRESLANGPROCA lpEnumFunc, + LONG lParam ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -317,10 +317,10 @@ EnumResourceLanguagesA ( WINBOOL STDCALL EnumResourceNamesW ( - HINSTANCE hModule, - LPCWSTR lpType, - ENUMRESNAMEPROC lpEnumFunc, - LONG lParam + HINSTANCE hModule, + LPCWSTR lpType, + ENUMRESNAMEPROCW lpEnumFunc, + LONG lParam ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -334,10 +334,10 @@ EnumResourceNamesW ( WINBOOL STDCALL EnumResourceNamesA ( - HINSTANCE hModule, - LPCSTR lpType, - ENUMRESNAMEPROC lpEnumFunc, - LONG lParam + HINSTANCE hModule, + LPCSTR lpType, + ENUMRESNAMEPROCA lpEnumFunc, + LONG lParam ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -351,9 +351,9 @@ EnumResourceNamesA ( WINBOOL STDCALL EnumResourceTypesW ( - HINSTANCE hModule, - ENUMRESTYPEPROC lpEnumFunc, - LONG lParam + HINSTANCE hModule, + ENUMRESTYPEPROCW lpEnumFunc, + LONG lParam ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -367,9 +367,9 @@ EnumResourceTypesW ( WINBOOL STDCALL EnumResourceTypesA ( - HINSTANCE hModule, - ENUMRESTYPEPROC lpEnumFunc, - LONG lParam + HINSTANCE hModule, + ENUMRESTYPEPROCA lpEnumFunc, + LONG lParam ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); diff --git a/reactos/lib/kernel32/misc/stubs.c b/reactos/lib/kernel32/misc/stubs.c index 0b848bfec2e..d22f299d27b 100644 --- a/reactos/lib/kernel32/misc/stubs.c +++ b/reactos/lib/kernel32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.53 2003/08/05 15:41:02 weiden Exp $ +/* $Id: stubs.c,v 1.54 2003/08/07 04:03:23 royce Exp $ * * KERNEL32.DLL stubs (unimplemented functions) * Remove from this file, if you implement them. @@ -107,7 +107,7 @@ CreateVirtualBuffer ( WINBOOL STDCALL EnumCalendarInfoW ( - CALINFO_ENUMPROC lpCalInfoEnumProc, + CALINFO_ENUMPROCW lpCalInfoEnumProc, LCID Locale, CALID Calendar, CALTYPE CalType @@ -124,10 +124,10 @@ EnumCalendarInfoW ( WINBOOL STDCALL EnumCalendarInfoA ( - CALINFO_ENUMPROC lpCalInfoEnumProc, - LCID Locale, - CALID Calendar, - CALTYPE CalType + CALINFO_ENUMPROCA lpCalInfoEnumProc, + LCID Locale, + CALID Calendar, + CALTYPE CalType ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -141,9 +141,9 @@ EnumCalendarInfoA ( WINBOOL STDCALL EnumDateFormatsW ( - DATEFMT_ENUMPROC lpDateFmtEnumProc, - LCID Locale, - DWORD dwFlags + DATEFMT_ENUMPROCW lpDateFmtEnumProc, + LCID Locale, + DWORD dwFlags ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -157,9 +157,9 @@ EnumDateFormatsW ( WINBOOL STDCALL EnumDateFormatsA ( - DATEFMT_ENUMPROC lpDateFmtEnumProc, - LCID Locale, - DWORD dwFlags + DATEFMT_ENUMPROCA lpDateFmtEnumProc, + LCID Locale, + DWORD dwFlags ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -173,8 +173,8 @@ EnumDateFormatsA ( WINBOOL STDCALL EnumSystemCodePagesW ( - CODEPAGE_ENUMPROC lpCodePageEnumProc, - DWORD dwFlags + CODEPAGE_ENUMPROCW lpCodePageEnumProc, + DWORD dwFlags ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -188,8 +188,8 @@ EnumSystemCodePagesW ( WINBOOL STDCALL EnumSystemCodePagesA ( - CODEPAGE_ENUMPROC lpCodePageEnumProc, - DWORD dwFlags + CODEPAGE_ENUMPROCA lpCodePageEnumProc, + DWORD dwFlags ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -204,8 +204,8 @@ EnumSystemCodePagesA ( WINBOOL STDCALL EnumSystemLocalesW ( - LOCALE_ENUMPROC lpLocaleEnumProc, - DWORD dwFlags + LOCALE_ENUMPROCW lpLocaleEnumProc, + DWORD dwFlags ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -219,8 +219,8 @@ EnumSystemLocalesW ( WINBOOL STDCALL EnumSystemLocalesA ( - LOCALE_ENUMPROC lpLocaleEnumProc, - DWORD dwFlags + LOCALE_ENUMPROCA lpLocaleEnumProc, + DWORD dwFlags ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -235,7 +235,7 @@ EnumSystemLocalesA ( WINBOOL STDCALL EnumTimeFormatsW ( - TIMEFMT_ENUMPROC lpTimeFmtEnumProc, + TIMEFMT_ENUMPROCW lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags ) @@ -251,9 +251,9 @@ EnumTimeFormatsW ( WINBOOL STDCALL EnumTimeFormatsA ( - TIMEFMT_ENUMPROC lpTimeFmtEnumProc, - LCID Locale, - DWORD dwFlags + TIMEFMT_ENUMPROCA lpTimeFmtEnumProc, + LCID Locale, + DWORD dwFlags ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); diff --git a/reactos/lib/lzexpand/Makefile b/reactos/lib/lzexpand/Makefile index 64a89bd9c5c..8682db04af5 100644 --- a/reactos/lib/lzexpand/Makefile +++ b/reactos/lib/lzexpand/Makefile @@ -7,6 +7,9 @@ TARGET_NAME = lz32 TARGET_BASE=0x76380000 +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = ntdll.a TARGET_OBJECTS = lzexpand_main.o diff --git a/reactos/lib/msafd/makefile b/reactos/lib/msafd/makefile index bc59a4c6232..928a9e18c83 100644 --- a/reactos/lib/msafd/makefile +++ b/reactos/lib/msafd/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.9 2003/04/14 01:19:07 hyperion Exp $ +# $Id: makefile,v 1.10 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -8,6 +8,9 @@ TARGET_NAME = msafd TARGET_BASE = 0x777a0000 +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = ntdll.a kernel32.a TARGET_CFLAGS = \ diff --git a/reactos/lib/msvcrt/Makefile b/reactos/lib/msvcrt/Makefile index 30918a62298..e3f8aabcf96 100644 --- a/reactos/lib/msvcrt/Makefile +++ b/reactos/lib/msvcrt/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.38 2003/07/16 21:54:22 royce Exp $ +# $Id: Makefile,v 1.39 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -18,6 +18,9 @@ TARGET_GCCLIBS = gcc TARGET_CFLAGS = -D_MSVCRT_LIB_ +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_OBJECTS = $(TARGET_NAME).o TARGET_CLEAN = \ diff --git a/reactos/lib/msvcrt/misc/cpp.c b/reactos/lib/msvcrt/misc/cpp.c index ad2eba7f769..76e434a5884 100644 --- a/reactos/lib/msvcrt/misc/cpp.c +++ b/reactos/lib/msvcrt/misc/cpp.c @@ -1,4 +1,4 @@ -/* $Id: cpp.c,v 1.1 2003/04/30 22:07:30 gvg Exp $ +/* $Id: cpp.c,v 1.2 2003/08/07 04:03:23 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS C runtime @@ -295,7 +295,7 @@ static void cxx_local_unwind( cxx_exception_frame* frame, cxx_function_descr *de { if (trylevel < 0 || trylevel >= descr->unwind_count) { - OutputDebugString( "invalid trylevel\n" ); + OutputDebugStringA ( "invalid trylevel\n" ); _exit(1); } handler = descr->unwind_table[trylevel].handler; @@ -461,7 +461,7 @@ static DWORD cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* fram if (descr->magic != CXX_FRAME_MAGIC) { - OutputDebugString( "invalid frame magic\n" ); + OutputDebugStringA ( "invalid frame magic\n" ); return ExceptionContinueSearch; } if (rec->ExceptionFlags & (EH_UNWINDING|EH_EXIT_UNWIND)) diff --git a/reactos/lib/msvcrt/misc/getargs.c b/reactos/lib/msvcrt/misc/getargs.c index 548faeeddfe..c1cf4ec7e5f 100644 --- a/reactos/lib/msvcrt/misc/getargs.c +++ b/reactos/lib/msvcrt/misc/getargs.c @@ -56,7 +56,7 @@ int expand(char* name, int flag) s = strpbrk(name, "*?"); if (s && flag) { - hFile = FindFirstFile(name, &fd); + hFile = FindFirstFileA(name, &fd); if (hFile != INVALID_HANDLE_VALUE) { while(s != name && *s != '/' && *s != '\\') s--; @@ -74,7 +74,7 @@ int expand(char* name, int flag) first = FALSE; } } - while(FindNextFile(hFile, &fd)); + while(FindNextFileA(hFile, &fd)); FindClose(hFile); } } diff --git a/reactos/lib/ntdll/makefile b/reactos/lib/ntdll/makefile index 3dc166712ac..0951eeb66d2 100644 --- a/reactos/lib/ntdll/makefile +++ b/reactos/lib/ntdll/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.91 2003/07/24 19:53:11 hbirr Exp $ +# $Id: makefile,v 1.92 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -10,6 +10,9 @@ TARGET_NAME = ntdll TARGET_CFLAGS = -g -D__NTDLL__ +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_ASFLAGS = -I $(PATH_TO_TOP)/include TARGET_LFLAGS = -Wl,--file-alignment,0x1000 \ diff --git a/reactos/lib/ole32/makefile b/reactos/lib/ole32/makefile index 075d03fe3c4..2b3cb1fd53f 100644 --- a/reactos/lib/ole32/makefile +++ b/reactos/lib/ole32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.6 2001/09/02 09:10:47 chorns Exp $ +# $Id: makefile,v 1.7 2003/08/07 04:03:23 royce Exp $ # # Jurgen Van Gael [jurgen.vangael@student.kuleuven.ac.be] # @@ -17,6 +17,9 @@ TARGET_DEFONLY = yes TARGET_CFLAGS = -fno-rtti -I./include +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a user32.a gdi32.a msvcrt.a TARGET_OBJECTS = \ diff --git a/reactos/lib/oleaut32/makefile b/reactos/lib/oleaut32/makefile index 13bc925dc9c..96682a29b23 100644 --- a/reactos/lib/oleaut32/makefile +++ b/reactos/lib/oleaut32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.3 2001/08/21 20:13:07 chorns Exp $ +# $Id: makefile,v 1.4 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -10,6 +10,9 @@ TARGET_NAME = oleaut32 TARGET_BASE = 0x76260000 +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = ntdll.a kernel32.a TARGET_OBJECTS = dllmain.o stubs.o diff --git a/reactos/lib/psapi/makefile b/reactos/lib/psapi/makefile index 8491b0c914b..7bae56f7cc3 100644 --- a/reactos/lib/psapi/makefile +++ b/reactos/lib/psapi/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.7 2003/04/14 01:19:07 hyperion Exp $ +# $Id: makefile,v 1.8 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -10,6 +10,9 @@ TARGET_SDKLIBS = epsapi.a ntdll.a kernel32.a TARGET_CFLAGS = -I./include +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib TARGET_BASE = 0x68F70000 diff --git a/reactos/lib/rosrtl/makefile b/reactos/lib/rosrtl/makefile index 1b303a32778..11f2e97b328 100644 --- a/reactos/lib/rosrtl/makefile +++ b/reactos/lib/rosrtl/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.8 2003/07/22 20:10:04 hyperion Exp $ +# $Id: makefile,v 1.9 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -29,6 +29,9 @@ TARGET_NAME = rosrtl TARGET_CFLAGS = -Wall -Werror +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_OBJECTS = $(THREAD_OBJECTS) $(MISC_OBJECTS) DEP_OBJECTS = $(TARGET_OBJECTS) diff --git a/reactos/lib/rpcrt4/Makefile b/reactos/lib/rpcrt4/Makefile index 762d27f4e06..c53ce0f6da3 100644 --- a/reactos/lib/rpcrt4/Makefile +++ b/reactos/lib/rpcrt4/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.5 2001/07/15 21:18:55 rex Exp $ +# $Id: Makefile,v 1.6 2003/08/07 04:03:23 royce Exp $ # # ReactOS Operating System # @@ -10,6 +10,9 @@ BASE_CFLAGS = -I../../include CFLAGS = $(CFLAGS) +# require os code to explicitly request A/W version of structs/functions +CFLAGS += -D_DISABLE_TIDENTS + midl: DLLTARGET=$(TARGET).dll diff --git a/reactos/lib/rpcrt4/midl/Makefile b/reactos/lib/rpcrt4/midl/Makefile index 067d5ca93d8..081075d0db7 100644 --- a/reactos/lib/rpcrt4/midl/Makefile +++ b/reactos/lib/rpcrt4/midl/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 2000/10/11 20:50:33 dwelch Exp $ +# $Id: Makefile,v 1.3 2003/08/07 04:03:23 royce Exp $ # # ReactOS Operating System # @@ -6,6 +6,9 @@ TARGET=midl CFLAGS = +# require os code to explicitly request A/W version of structs/functions +CFLAGS += -D_DISABLE_TIDENTS + all: midl$(EXE_POSTFIX) idl.tab.o: idl.y diff --git a/reactos/lib/secur32/Makefile b/reactos/lib/secur32/Makefile index 26db8e40744..309d9a0f287 100644 --- a/reactos/lib/secur32/Makefile +++ b/reactos/lib/secur32/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.10 2003/02/02 19:24:15 hyperion Exp $ +# $Id: Makefile,v 1.11 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -18,6 +18,9 @@ TARGET_CFLAGS = \ -fno-builtin \ -D__SECUR32__ +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib TARGET_OBJECTS = lsa.o dllmain.o diff --git a/reactos/lib/snmpapi/makefile b/reactos/lib/snmpapi/makefile index 05b4b175ffd..ee30bb5fb97 100644 --- a/reactos/lib/snmpapi/makefile +++ b/reactos/lib/snmpapi/makefile @@ -10,6 +10,9 @@ TARGET_BASE = 0x777c0000 TARGET_CFLAGS = -DUNICODE +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = ntdll.a kernel32.a TARGET_OBJECTS = $(TARGET_NAME).o diff --git a/reactos/lib/string/Makefile b/reactos/lib/string/Makefile index 34711bd9581..bb8da350a01 100644 --- a/reactos/lib/string/Makefile +++ b/reactos/lib/string/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2003/06/09 20:23:06 hbirr Exp $ +# $Id: Makefile,v 1.5 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -12,6 +12,9 @@ include Makefile.$(ARCH) TARGET_CFLAGS = -Wall -Werror +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + ifeq ($(DBG), 1) TARGET_CFLAGS += -g else diff --git a/reactos/lib/syssetup/Makefile b/reactos/lib/syssetup/Makefile index 2b4bb4812a8..9ae55b65002 100644 --- a/reactos/lib/syssetup/Makefile +++ b/reactos/lib/syssetup/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 2003/05/02 18:07:55 ekohl Exp $ +# $Id: Makefile,v 1.2 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -11,6 +11,9 @@ TARGET_BASE = 0x74A30000 TARGET_SDKLIBS = ntdll.a kernel32.a TARGET_CFLAGS = -Wall -Werror -fno-builtin + +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS TARGET_LFLAGS = -nostartfiles -nostdlib diff --git a/reactos/lib/syssetup/install.c b/reactos/lib/syssetup/install.c index 699b7a70d71..1e204aab3f7 100644 --- a/reactos/lib/syssetup/install.c +++ b/reactos/lib/syssetup/install.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: install.c,v 1.1 2003/05/02 18:07:55 ekohl Exp $ +/* $Id: install.c,v 1.2 2003/08/07 04:03:23 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -36,11 +36,11 @@ DWORD STDCALL InstallReactOS (HINSTANCE hInstance) { - OutputDebugString ("InstallReactOS() called\n"); + OutputDebugStringA ("InstallReactOS() called\n"); if (!InitializeSetupActionLog (FALSE)) { - OutputDebugString ("InitializeSetupActionLog() failed\n"); + OutputDebugStringA ("InitializeSetupActionLog() failed\n"); } LogItem (SEVERITY_INFORMATION, diff --git a/reactos/lib/tgetopt/Makefile b/reactos/lib/tgetopt/Makefile index 91c13f33e03..d6200838c76 100644 --- a/reactos/lib/tgetopt/Makefile +++ b/reactos/lib/tgetopt/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 2003/04/22 03:20:25 hyperion Exp $ +# $Id: Makefile,v 1.2 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -6,6 +6,9 @@ TARGET_TYPE = library TARGET_NAME = tgetopt +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_OBJECTS = getopt.o _wgetopt.o DEP_OBJECTS = $(TARGET_OBJECTS) diff --git a/reactos/lib/twain/Makefile b/reactos/lib/twain/Makefile index ebfcb2bca26..d5458cfaaab 100644 --- a/reactos/lib/twain/Makefile +++ b/reactos/lib/twain/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 2003/07/22 04:00:28 sedwards Exp $ +# $Id: Makefile,v 1.2 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -6,6 +6,9 @@ TARGET_TYPE = dynlink TARGET_NAME = twain_32 +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_BASE=0x76380000 TARGET_SDKLIBS = ntdll.a diff --git a/reactos/lib/user32/Makefile b/reactos/lib/user32/Makefile index 7daea093bac..d0a8f825d42 100644 --- a/reactos/lib/user32/Makefile +++ b/reactos/lib/user32/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.22 2003/07/27 11:54:42 dwelch Exp $ +# $Id: Makefile,v 1.23 2003/08/07 04:03:23 royce Exp $ PATH_TO_TOP = ../.. @@ -17,6 +17,9 @@ TARGET_CFLAGS = \ -Werror \ -fno-builtin +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib CONTROLS_OBJECTS = \ diff --git a/reactos/lib/user32/controls/scrollbar.c b/reactos/lib/user32/controls/scrollbar.c index e996b2f03bb..a4b6d09d4b8 100644 --- a/reactos/lib/user32/controls/scrollbar.c +++ b/reactos/lib/user32/controls/scrollbar.c @@ -1,4 +1,4 @@ -/* $Id: scrollbar.c,v 1.10 2003/07/26 15:48:47 dwelch Exp $ +/* $Id: scrollbar.c,v 1.11 2003/08/07 04:03:23 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -282,7 +282,7 @@ SCROLL_DrawScrollBar (HWND hwnd, HDC hdc, INT nBar, vertical = TRUE; break; case SB_CTL: - vertical = (GetWindowLong(hwnd,GWL_STYLE)&SBS_VERT) != 0; + vertical = (GetWindowLongW(hwnd,GWL_STYLE)&SBS_VERT) != 0; break; #ifdef DBG default: diff --git a/reactos/lib/user32/misc/resources.c b/reactos/lib/user32/misc/resources.c index 8e9fb3cf092..3b6cc7495ff 100644 --- a/reactos/lib/user32/misc/resources.c +++ b/reactos/lib/user32/misc/resources.c @@ -35,10 +35,10 @@ BOOL STDCALL _InternalLoadString (actual resource ids) start from 1. See (1) and (2) */ /* TODO: some sort of cache, here, would be great */ - hrsStringTable = FindResource + hrsStringTable = FindResourceW ( (HMODULE)hInstance, - MAKEINTRESOURCE((uID / 16) + 1), /* (2) */ + MAKEINTRESOURCEW((uID / 16) + 1), /* (2) */ RT_STRING ); diff --git a/reactos/lib/user32/misc/winhelp.c b/reactos/lib/user32/misc/winhelp.c index 56cd998d4f7..17492aafaac 100644 --- a/reactos/lib/user32/misc/winhelp.c +++ b/reactos/lib/user32/misc/winhelp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: winhelp.c,v 1.4 2003/07/10 21:04:31 chorns Exp $ +/* $Id: winhelp.c,v 1.5 2003/08/07 04:03:24 royce Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/misc/winhelp.c @@ -127,7 +127,7 @@ WinHelpA(HWND hWnd, LPCSTR lpszHelp, UINT uCommand, DWORD dwData) lpwh->ofsData = 0; } GlobalUnlock(hwh); - return SendMessage(hDest, WM_WINHELP, (WPARAM)hWnd, (LPARAM)hwh); + return SendMessageA(hDest, WM_WINHELP, (WPARAM)hWnd, (LPARAM)hwh); } diff --git a/reactos/lib/user32/misc/winsta.c b/reactos/lib/user32/misc/winsta.c index 72060375fd7..d7b2269ae86 100644 --- a/reactos/lib/user32/misc/winsta.c +++ b/reactos/lib/user32/misc/winsta.c @@ -1,4 +1,4 @@ -/* $Id: winsta.c,v 1.8 2003/07/10 21:04:31 chorns Exp $ +/* $Id: winsta.c,v 1.9 2003/08/07 04:03:24 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -81,7 +81,7 @@ CreateWindowStationW(LPWSTR lpwinsta, * @unimplemented */ WINBOOL STDCALL -EnumWindowStationsA(ENUMWINDOWSTATIONPROC lpEnumFunc, +EnumWindowStationsA(ENUMWINDOWSTATIONPROCA lpEnumFunc, LPARAM lParam) { UNIMPLEMENTED; @@ -93,7 +93,7 @@ EnumWindowStationsA(ENUMWINDOWSTATIONPROC lpEnumFunc, * @unimplemented */ WINBOOL STDCALL -EnumWindowStationsW(ENUMWINDOWSTATIONPROC lpEnumFunc, +EnumWindowStationsW(ENUMWINDOWSTATIONPROCW lpEnumFunc, LPARAM lParam) { UNIMPLEMENTED; diff --git a/reactos/lib/user32/user32.def b/reactos/lib/user32/user32.def index 4edec2c1894..a716be2156b 100644 --- a/reactos/lib/user32/user32.def +++ b/reactos/lib/user32/user32.def @@ -225,7 +225,6 @@ FlashWindowEx@4 FrameRect@12 FreeDDElParam@8 GetActiveWindow@0 -GetAltTabInfo@20 GetAltTabInfoA@20 GetAltTabInfoW@20 GetAncestor@8 diff --git a/reactos/lib/user32/user32.edf b/reactos/lib/user32/user32.edf index 5bdcc1c1954..60462043854 100644 --- a/reactos/lib/user32/user32.edf +++ b/reactos/lib/user32/user32.edf @@ -225,7 +225,6 @@ FlashWindowEx=FlashWindowEx@4 FrameRect=FrameRect@12 FreeDDElParam=FreeDDElParam@8 GetActiveWindow=GetActiveWindow@0 -GetAltTabInfo=GetAltTabInfo@20 GetAltTabInfoA=GetAltTabInfoA@20 GetAltTabInfoW=GetAltTabInfoW@20 GetAncestor=GetAncestor@8 diff --git a/reactos/lib/user32/windows/bitmap.c b/reactos/lib/user32/windows/bitmap.c index c297f2254d5..42e45a57814 100644 --- a/reactos/lib/user32/windows/bitmap.c +++ b/reactos/lib/user32/windows/bitmap.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: bitmap.c,v 1.11 2003/07/10 21:04:31 chorns Exp $ +/* $Id: bitmap.c,v 1.12 2003/08/07 04:03:24 royce Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -107,7 +107,7 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL { if (hinst == NULL) { - hinst = GetModuleHandle(L"USER32"); + hinst = GetModuleHandleW(L"USER32"); } hResource = FindResourceW(hinst, lpszName, RT_GROUP_ICON); if (hResource == NULL) @@ -130,9 +130,9 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL id = LookupIconIdFromDirectoryEx((PBYTE) IconResDir, TRUE, width, height, fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); - h2Resource = FindResource(hinst, - MAKEINTRESOURCE(id), - MAKEINTRESOURCE(RT_ICON)); + h2Resource = FindResourceW(hinst, + MAKEINTRESOURCEW(id), + MAKEINTRESOURCEW(RT_ICON)); hResource = LoadResource(hinst, h2Resource); if (hResource == NULL) @@ -151,7 +151,7 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL } else { - hFile = CreateFile(lpszName, + hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL, @@ -163,7 +163,7 @@ LoadIconImage(HINSTANCE hinst, LPCWSTR lpszName, INT width, INT height, UINT fuL return(NULL); } - hSection = CreateFileMapping(hFile, + hSection = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, @@ -265,7 +265,7 @@ LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad) { if (hInstance == NULL) { - hInstance = GetModuleHandle(L"USER32"); + hInstance = GetModuleHandleW(L"USER32"); } hResource = FindResourceW(hInstance, lpszName, RT_BITMAP); if (hResource == NULL) @@ -285,7 +285,7 @@ LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad) } else { - hFile = CreateFile(lpszName, + hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL, @@ -296,7 +296,7 @@ LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad) { return(NULL); } - hSection = CreateFileMapping(hFile, + hSection = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, diff --git a/reactos/lib/user32/windows/class.c b/reactos/lib/user32/windows/class.c index cc748e9b514..3ff35fd064d 100644 --- a/reactos/lib/user32/windows/class.c +++ b/reactos/lib/user32/windows/class.c @@ -1,4 +1,4 @@ -/* $Id: class.c,v 1.25 2003/08/06 16:47:35 weiden Exp $ +/* $Id: class.c,v 1.26 2003/08/07 04:03:24 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -13,6 +13,7 @@ #include #include #include +#include /* for IS_ATOM */ /* copied from menu.c */ NTSTATUS @@ -94,11 +95,17 @@ GetClassInfoW( /* - * @implemented + * @unimplemented */ DWORD STDCALL GetClassLongA(HWND hWnd, int nIndex) { + /* + * FIXME - for GCL_MENUNAME, we need to allocate a buffer + * in thread-local storage and convert the results back + * to that. Subsequent calls should be sure and clean that + * up + */ return(NtUserGetClassLong(hWnd, nIndex, TRUE)); } @@ -242,13 +249,15 @@ ATOM STDCALL RegisterClassA(CONST WNDCLASSA *lpWndClass) { WNDCLASSEXA Class; - - if(!lpWndClass) return (ATOM)0; - RtlMoveMemory ( &Class.style, lpWndClass, sizeof(WNDCLASSA)); + if ( !lpWndClass ) return (ATOM)0; + + RtlMoveMemory ( &Class.style, lpWndClass, sizeof(WNDCLASSA) ); + Class.cbSize = sizeof(WNDCLASSEXA); Class.hIconSm = INVALID_HANDLE_VALUE; - return RegisterClassExA(&Class); + + return RegisterClassExA ( &Class ); } /* @@ -263,16 +272,16 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx) NTSTATUS Status; LPWSTR ClassName = NULL; LPWSTR MenuName = NULL; - + if(!lpwcx || (lpwcx->cbSize != sizeof(WNDCLASSEXA))) return (ATOM)0; - + if(!lpwcx->lpszClassName) return (ATOM)0; - + hHeap = RtlGetProcessHeap(); RtlMoveMemory(&wndclass, lpwcx, sizeof(WNDCLASSEXW)); - - if(HIWORD(lpwcx->lpszClassName)) + + if ( !IS_ATOM(lpwcx->lpszClassName) ) { Status = HEAP_strdupA2W (hHeap, &ClassName, (LPCSTR)lpwcx->lpszClassName, NULL); if (!NT_SUCCESS (Status)) @@ -282,8 +291,8 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx) } wndclass.lpszClassName = ClassName; } - - if(HIWORD(lpwcx->lpszMenuName)) + + if ( !IS_ATOM(lpwcx->lpszMenuName) ) { Status = HEAP_strdupA2W (hHeap, &MenuName, (LPCSTR)lpwcx->lpszMenuName, NULL); if (!NT_SUCCESS (Status)) @@ -298,11 +307,12 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx) wndclass.lpszMenuName = MenuName; } - Atom = NtUserRegisterClassExWOW(&wndclass, - FALSE, - 0, - 0, - 0); + Atom = NtUserRegisterClassExWOW ( + &wndclass, + FALSE, + 0, + 0, + 0); /* free strings if neccessary */ if(MenuName) RtlFreeHeap (hHeap, 0, MenuName); @@ -325,18 +335,18 @@ RegisterClassExW(CONST WNDCLASSEXW *lpwcx) LPWSTR ClassName = NULL; LPWSTR MenuName = NULL; ULONG len; - + if(!lpwcx || (lpwcx->cbSize != sizeof(WNDCLASSEXA))) return (ATOM)0; - + if(!lpwcx->lpszClassName) return (ATOM)0; - + hHeap = RtlGetProcessHeap(); RtlMoveMemory(&wndclass, lpwcx, sizeof(WNDCLASSEXW)); - + /* copy strings if needed */ - - if(HIWORD(lpwcx->lpszClassName)) + + if ( !IS_ATOM(lpwcx->lpszClassName) ) { len = lstrlenW(lpwcx->lpszClassName); ClassName = RtlAllocateHeap (hHeap, 0, (len + 1) * sizeof(WCHAR)); @@ -345,12 +355,12 @@ RegisterClassExW(CONST WNDCLASSEXW *lpwcx) SetLastError(RtlNtStatusToDosError(STATUS_NO_MEMORY)); return 0; } - memcpy(&ClassName, &lpwcx->lpszClassName, len); - + RtlMoveMemory(&ClassName, &lpwcx->lpszClassName, len); + wndclass.lpszClassName = ClassName; } - - if(HIWORD(lpwcx->lpszMenuName)) + + if ( !IS_ATOM(lpwcx->lpszMenuName) ) { len = lstrlenW(lpwcx->lpszMenuName); MenuName = RtlAllocateHeap (hHeap, 0, (len + 1) * sizeof(WCHAR)); @@ -363,16 +373,17 @@ RegisterClassExW(CONST WNDCLASSEXW *lpwcx) SetLastError(RtlNtStatusToDosError(STATUS_NO_MEMORY)); return 0; } - memcpy(&MenuName, &lpwcx->lpszMenuName, len); - + RtlMoveMemory(&MenuName, &lpwcx->lpszMenuName, len); + wndclass.lpszMenuName = MenuName; } - Atom = NtUserRegisterClassExWOW(&wndclass, - TRUE, - 0, - 0, - 0); + Atom = NtUserRegisterClassExWOW ( + &wndclass, + TRUE, + 0, + 0, + 0); /* free strings if neccessary */ if(MenuName) RtlFreeHeap (hHeap, 0, MenuName); @@ -388,17 +399,17 @@ ATOM STDCALL RegisterClassW(CONST WNDCLASSW *lpWndClass) { WNDCLASSEXW Class; - - if(!lpWndClass) return (ATOM)0; - RtlMoveMemory(&Class.style, lpWndClass, sizeof(WNDCLASSW)); + if ( !lpWndClass ) return (ATOM)0; + + RtlMoveMemory ( &Class.style, lpWndClass, sizeof(WNDCLASSW) ); Class.cbSize = sizeof(WNDCLASSEXW); Class.hIconSm = INVALID_HANDLE_VALUE; - return RegisterClassExW(&Class); + return RegisterClassExW ( &Class ); } /* - * @mplemented + * @unimplemented */ DWORD STDCALL @@ -407,12 +418,13 @@ SetClassLongA( int nIndex, LONG dwNewLong) { + /* FIXME - handle GCL_MENUNAME special case */ return(NtUserSetClassLong(hWnd, nIndex, dwNewLong, TRUE)); } /* - * @implemented + * @unimplemented */ DWORD STDCALL @@ -421,6 +433,7 @@ SetClassLongW( int nIndex, LONG dwNewLong) { + /* FIXME - handle GCL_MENUNAME special case */ return(NtUserSetClassLong(hWnd, nIndex, dwNewLong, FALSE)); } diff --git a/reactos/lib/user32/windows/defwnd.c b/reactos/lib/user32/windows/defwnd.c index 419747aabe6..7c2d24e3506 100644 --- a/reactos/lib/user32/windows/defwnd.c +++ b/reactos/lib/user32/windows/defwnd.c @@ -1,4 +1,4 @@ -/* $Id: defwnd.c,v 1.62 2003/08/06 18:43:57 weiden Exp $ +/* $Id: defwnd.c,v 1.63 2003/08/07 04:03:24 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -79,27 +79,31 @@ static ATOM AtomInternalPos; /* FUNCTIONS *****************************************************************/ -BOOL IsMaxBoxActive(HWND hWnd) +BOOL +IsMaxBoxActive(HWND hWnd) { - ULONG uStyle = GetWindowLong( hWnd, GWL_STYLE ); + ULONG uStyle = GetWindowLongW( hWnd, GWL_STYLE ); return (uStyle & WS_MAXIMIZEBOX); } -BOOL IsCloseBoxActive( HWND hWnd ) +BOOL +IsCloseBoxActive( HWND hWnd ) { - ULONG uStyle = GetWindowLong(hWnd, GWL_STYLE ); + ULONG uStyle = GetWindowLongW(hWnd, GWL_STYLE ); return ( uStyle & WS_SYSMENU ); } -BOOL IsMinBoxActive( HWND hWnd ) +BOOL +IsMinBoxActive( HWND hWnd ) { - ULONG uStyle = GetWindowLong( hWnd, GWL_STYLE ); + ULONG uStyle = GetWindowLongW( hWnd, GWL_STYLE ); return (uStyle & WS_MINIMIZEBOX); } -INT UIGetFrameSizeX( HWND hWnd ) +INT +UIGetFrameSizeX( HWND hWnd ) { - ULONG uStyle = GetWindowLong( hWnd, GWL_STYLE ); + ULONG uStyle = GetWindowLongW( hWnd, GWL_STYLE ); if ( uStyle & WS_THICKFRAME ) return GetSystemMetrics( SM_CXSIZEFRAME ); @@ -107,9 +111,10 @@ INT UIGetFrameSizeX( HWND hWnd ) return GetSystemMetrics( SM_CXFRAME ); } -INT UIGetFrameSizeY( HWND hWnd ) +INT +UIGetFrameSizeY( HWND hWnd ) { - ULONG uStyle = GetWindowLong( hWnd, GWL_STYLE ); + ULONG uStyle = GetWindowLongW( hWnd, GWL_STYLE ); if ( uStyle & WS_THICKFRAME ) return GetSystemMetrics( SM_CYSIZEFRAME ); @@ -253,14 +258,15 @@ UserHasBigFrameStyle(ULONG Style, ULONG ExStyle) (ExStyle & WS_EX_DLGMODALFRAME)); } -void UserGetInsideRectNC( HWND hWnd, RECT *rect ) +void +UserGetInsideRectNC( HWND hWnd, RECT *rect ) { RECT WindowRect; ULONG Style; ULONG ExStyle; - Style = GetWindowLong(hWnd, GWL_STYLE); - ExStyle = GetWindowLong(hWnd, GWL_EXSTYLE); + Style = GetWindowLongW(hWnd, GWL_STYLE); + ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE); GetWindowRect(hWnd, &WindowRect); rect->top = rect->left = 0; rect->right = WindowRect.right - WindowRect.left; @@ -298,19 +304,20 @@ void UserGetInsideRectNC( HWND hWnd, RECT *rect ) } } -VOID UserDrawSysMenuButton( HWND hWnd, HDC hDC, BOOL down ) +VOID +UserDrawSysMenuButton( HWND hWnd, HDC hDC, BOOL down ) { RECT Rect; HDC hDcMem; HBITMAP hSavedBitmap; - hbSysMenu = LoadBitmap(0, MAKEINTRESOURCE(OBM_CLOSE)); + hbSysMenu = (HBITMAP)LoadBitmapW(0, MAKEINTRESOURCEW(OBM_CLOSE)); UserGetInsideRectNC(hWnd, &Rect); hDcMem = CreateCompatibleDC(hDC); hSavedBitmap = SelectObject(hDcMem, hbSysMenu); BitBlt(hDC, Rect.left + 2, Rect.top + 2, 16, 16, hDcMem, - (GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD) ? + (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD) ? GetSystemMetrics(SM_CXSIZE): 0, 0, SRCCOPY); SelectObject(hDcMem, hSavedBitmap); DeleteDC(hDcMem); @@ -319,114 +326,119 @@ VOID UserDrawSysMenuButton( HWND hWnd, HDC hDC, BOOL down ) /* FIXME: Cache bitmaps, then just bitblt instead of calling DFC() (and wasting precious CPU cycles) every time */ -static void UserDrawCaptionButton( HWND hWnd, HDC hDC, BOOL bDown, ULONG Type ) +static void +UserDrawCaptionButton( HWND hWnd, HDC hDC, BOOL bDown, ULONG Type ) { + RECT rect; + INT iBmpWidth = GetSystemMetrics(SM_CXSIZE) - 2; + INT iBmpHeight = GetSystemMetrics(SM_CYSIZE) - 4; - RECT rect; - INT iBmpWidth = GetSystemMetrics(SM_CXSIZE) - 2; - INT iBmpHeight = GetSystemMetrics(SM_CYSIZE) - 4; - - INT OffsetX = UIGetFrameSizeX( hWnd ); - INT OffsetY = UIGetFrameSizeY( hWnd ); + INT OffsetX = UIGetFrameSizeX( hWnd ); + INT OffsetY = UIGetFrameSizeY( hWnd ); - if(!(GetWindowLong( hWnd, GWL_STYLE ) & WS_SYSMENU)) - { - return; - } + if(!(GetWindowLongW( hWnd, GWL_STYLE ) & WS_SYSMENU)) + { + return; + } - GetWindowRect( hWnd, &rect ); - - rect.right = rect.right - rect.left; - rect.bottom = rect.bottom - rect.top; - rect.left = rect.top = 0; + GetWindowRect( hWnd, &rect ); - switch(Type) - { - case DFCS_CAPTIONMIN: - { - if ((GetWindowLong( hWnd, GWL_EXSTYLE ) & WS_EX_TOOLWINDOW) == TRUE) - return; /* ToolWindows don't have min/max buttons */ - - SetRect(&rect, - rect.right - OffsetX - (iBmpWidth*3) - 5, - OffsetY + 2, - rect.right - (iBmpWidth * 2) - OffsetX - 5, - rect.top + iBmpHeight + OffsetY + 2 ); - DrawFrameControl( hDC, &rect, DFC_CAPTION, - DFCS_CAPTIONMIN | (bDown ? DFCS_PUSHED : 0) | - (IsMinBoxActive(hWnd) ? 0 : DFCS_INACTIVE) ); - break; - } - case DFCS_CAPTIONMAX: - { - if ((GetWindowLong( hWnd, GWL_EXSTYLE ) & WS_EX_TOOLWINDOW) == TRUE) - return; /* ToolWindows don't have min/max buttons */ - SetRect(&rect, - rect.right - OffsetX - (iBmpWidth*2) - 5, - OffsetY + 2, - rect.right - iBmpWidth - OffsetX - 5, - rect.top + iBmpHeight + OffsetY + 2 ); - - DrawFrameControl( hDC, &rect, DFC_CAPTION, - (IsZoomed(hWnd) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX) | - (bDown ? DFCS_PUSHED : 0) | - (IsMaxBoxActive(hWnd) ? 0 : DFCS_INACTIVE) ); - break; - } - case DFCS_CAPTIONCLOSE: - { - SetRect(&rect, - rect.right - OffsetX - iBmpWidth - 3, - OffsetY + 2, - rect.right - OffsetX - 3, - rect.top + iBmpHeight + OffsetY + 2 ); - - DrawFrameControl( hDC, &rect, DFC_CAPTION, - (DFCS_CAPTIONCLOSE | - (bDown ? DFCS_PUSHED : 0) | - (IsCloseBoxActive(hWnd) ? 0 : DFCS_INACTIVE)) ); - } - } -} + rect.right = rect.right - rect.left; + rect.bottom = rect.bottom - rect.top; + rect.left = rect.top = 0; -static void UserDrawCaptionNC( HDC hDC, RECT *rect, HWND hWnd, - DWORD style, BOOL active ) -{ - RECT r = *rect; - WCHAR buffer[256]; - /* FIXME: Implement and Use DrawCaption() */ - SelectObject( hDC, GetSysColorBrush(active ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION) ); - - PatBlt(hDC,rect->left + GetSystemMetrics(SM_CXFRAME), rect->top + - GetSystemMetrics(SM_CYFRAME), rect->right - (GetSystemMetrics(SM_CXFRAME) * 2), (rect->top + - GetSystemMetrics(SM_CYCAPTION)) - 1, PATCOPY ); - - if (style & WS_SYSMENU) + switch(Type) + { + case DFCS_CAPTIONMIN: { - UserDrawSysMenuButton( hWnd, hDC, FALSE); - r.left += GetSystemMetrics(SM_CXSIZE) + 1; - UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONCLOSE); - r.right -= GetSystemMetrics(SM_CXSMSIZE) + 1; - UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONMIN); - UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONMAX); + if ((GetWindowLongW( hWnd, GWL_EXSTYLE ) & WS_EX_TOOLWINDOW) == TRUE) + return; /* ToolWindows don't have min/max buttons */ + + SetRect(&rect, + rect.right - OffsetX - (iBmpWidth*3) - 5, + OffsetY + 2, + rect.right - (iBmpWidth * 2) - OffsetX - 5, + rect.top + iBmpHeight + OffsetY + 2 ); + DrawFrameControl( hDC, &rect, DFC_CAPTION, + DFCS_CAPTIONMIN | (bDown ? DFCS_PUSHED : 0) | + (IsMinBoxActive(hWnd) ? 0 : DFCS_INACTIVE) ); + break; } - if (GetWindowTextW( hWnd, buffer, sizeof(buffer)/sizeof(buffer[0]) )) + case DFCS_CAPTIONMAX: { - NONCLIENTMETRICSW nclm; - HFONT hFont, hOldFont; - - nclm.cbSize = sizeof(nclm); - SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, 0, &nclm, 0); - SetTextColor(hDC, SysColours[ active ? COLOR_CAPTIONTEXT : COLOR_INACTIVECAPTIONTEXT]); - SetBkMode( hDC, TRANSPARENT ); - if (style & WS_EX_TOOLWINDOW) - hFont = CreateFontIndirectW(&nclm.lfSmCaptionFont); - else - hFont = CreateFontIndirectW(&nclm.lfCaptionFont); - hOldFont = SelectObject(hDC, hFont); - TextOutW(hDC, r.left + (GetSystemMetrics(SM_CXDLGFRAME) * 2), rect->top + (nclm.lfCaptionFont.lfHeight / 2), buffer, wcslen(buffer)); - DeleteObject (SelectObject (hDC, hOldFont)); + if ((GetWindowLongW( hWnd, GWL_EXSTYLE ) & WS_EX_TOOLWINDOW) == TRUE) + return; /* ToolWindows don't have min/max buttons */ + SetRect(&rect, + rect.right - OffsetX - (iBmpWidth*2) - 5, + OffsetY + 2, + rect.right - iBmpWidth - OffsetX - 5, + rect.top + iBmpHeight + OffsetY + 2 ); + + DrawFrameControl( hDC, &rect, DFC_CAPTION, + (IsZoomed(hWnd) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX) | + (bDown ? DFCS_PUSHED : 0) | + (IsMaxBoxActive(hWnd) ? 0 : DFCS_INACTIVE) ); + break; } + case DFCS_CAPTIONCLOSE: + { + SetRect(&rect, + rect.right - OffsetX - iBmpWidth - 3, + OffsetY + 2, + rect.right - OffsetX - 3, + rect.top + iBmpHeight + OffsetY + 2 ); + + DrawFrameControl( hDC, &rect, DFC_CAPTION, + (DFCS_CAPTIONCLOSE | + (bDown ? DFCS_PUSHED : 0) | + (IsCloseBoxActive(hWnd) ? 0 : DFCS_INACTIVE)) ); + } + } +} + +static void +UserDrawCaptionNC ( + HDC hDC, + RECT *rect, + HWND hWnd, + DWORD style, + BOOL active ) +{ + RECT r = *rect; + WCHAR buffer[256]; + /* FIXME: Implement and Use DrawCaption() */ + SelectObject( hDC, GetSysColorBrush(active ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION) ); + + PatBlt(hDC,rect->left + GetSystemMetrics(SM_CXFRAME), rect->top + + GetSystemMetrics(SM_CYFRAME), rect->right - (GetSystemMetrics(SM_CXFRAME) * 2), (rect->top + + GetSystemMetrics(SM_CYCAPTION)) - 1, PATCOPY ); + + if (style & WS_SYSMENU) + { + UserDrawSysMenuButton( hWnd, hDC, FALSE); + r.left += GetSystemMetrics(SM_CXSIZE) + 1; + UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONCLOSE); + r.right -= GetSystemMetrics(SM_CXSMSIZE) + 1; + UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONMIN); + UserDrawCaptionButton( hWnd, hDC, FALSE, DFCS_CAPTIONMAX); + } + if (GetWindowTextW( hWnd, buffer, sizeof(buffer)/sizeof(buffer[0]) )) + { + NONCLIENTMETRICSW nclm; + HFONT hFont, hOldFont; + + nclm.cbSize = sizeof(nclm); + SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, 0, &nclm, 0); + SetTextColor(hDC, SysColours[ active ? COLOR_CAPTIONTEXT : COLOR_INACTIVECAPTIONTEXT]); + SetBkMode( hDC, TRANSPARENT ); + if (style & WS_EX_TOOLWINDOW) + hFont = CreateFontIndirectW(&nclm.lfSmCaptionFont); + else + hFont = CreateFontIndirectW(&nclm.lfCaptionFont); + hOldFont = SelectObject(hDC, hFont); + TextOutW(hDC, r.left + (GetSystemMetrics(SM_CXDLGFRAME) * 2), rect->top + (nclm.lfCaptionFont.lfHeight / 2), buffer, wcslen(buffer)); + DeleteObject (SelectObject (hDC, hOldFont)); + } } @@ -439,7 +451,8 @@ UserDrawFrameNC(HWND hWnd, RECT* rect, BOOL dlgFrame, BOOL active) } -void SCROLL_DrawScrollBar (HWND hWnd, HDC hDC, INT nBar, BOOL arrows, BOOL interior); +void +SCROLL_DrawScrollBar (HWND hWnd, HDC hDC, INT nBar, BOOL arrows, BOOL interior); VOID DefWndDoPaintNC(HWND hWnd, HRGN clip) @@ -452,8 +465,8 @@ DefWndDoPaintNC(HWND hWnd, HRGN clip) int wFrame = 0; Active = GetWindowLongW(hWnd, GWL_STYLE) & WIN_NCACTIVATED; - Style = GetWindowLong(hWnd, GWL_STYLE); - ExStyle = GetWindowLong(hWnd, GWL_EXSTYLE); + Style = GetWindowLongW(hWnd, GWL_STYLE); + ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE); hDC = GetDCEx(hWnd, (clip > (HRGN)1) ? clip : 0, DCX_USESTYLE | DCX_WINDOW | ((clip > (HRGN)1) ? (DCX_INTERSECTRGN | DCX_KEEPCLIPRGN) : 0)); @@ -532,8 +545,8 @@ LRESULT DefWndHitTestNC(HWND hWnd, POINT Point) { RECT WindowRect; - ULONG Style = GetWindowLong(hWnd, GWL_STYLE); - ULONG ExStyle = GetWindowLong(hWnd, GWL_EXSTYLE); + ULONG Style = GetWindowLongW(hWnd, GWL_STYLE); + ULONG ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE); GetWindowRect(hWnd, &WindowRect); if (!PtInRect(&WindowRect, Point)) @@ -717,9 +730,9 @@ DefWndHandleLButtonDownNC(HWND hWnd, WPARAM wParam, LPARAM lParam) } case HTSYSMENU: { - if (GetWindowLong(hWnd, GWL_STYLE) & WS_SYSMENU) + if (GetWindowLongW(hWnd, GWL_STYLE) & WS_SYSMENU) { - if (!(GetWindowLong(hWnd, GWL_STYLE) & WS_MINIMIZE)) + if (!(GetWindowLongW(hWnd, GWL_STYLE) & WS_MINIMIZE)) { HDC hDC = GetWindowDC(hWnd); UserDrawSysMenuButton(hWnd, hDC, TRUE); @@ -852,7 +865,7 @@ DefWndHandleSetCursor(HWND hWnd, WPARAM wParam, LPARAM lParam) case HTCLIENT: { - HICON hCursor = (HICON)GetClassLong(hWnd, GCL_HCURSOR); + HICON hCursor = (HICON)GetClassLongW(hWnd, GCL_HCURSOR); if (hCursor) { SetCursor(hCursor); @@ -895,7 +908,7 @@ DefWndStartSizeMove(HWND hWnd, WPARAM wParam, POINT *capturePoint) POINT pt; MSG msg; RECT rectWindow; - ULONG Style = GetWindowLong(hWnd, GWL_STYLE); + ULONG Style = GetWindowLongW(hWnd, GWL_STYLE); GetWindowRect(hWnd, &rectWindow); @@ -919,7 +932,7 @@ DefWndStartSizeMove(HWND hWnd, WPARAM wParam, POINT *capturePoint) { while(!hittest) { - GetMessage(&msg, NULL, 0, 0); + GetMessageW(&msg, NULL, 0, 0); switch(msg.message) { case WM_MOUSEMOVE: @@ -1012,8 +1025,8 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) HCURSOR hDragCursor = 0, hOldCursor = 0; POINT minTrack, maxTrack; POINT capturePoint, pt; - ULONG Style = GetWindowLong(hwnd, GWL_STYLE); - ULONG ExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); + ULONG Style = GetWindowLongW(hwnd, GWL_STYLE); + ULONG ExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE); BOOL thickframe = UserHasThickFrameStyle(Style, ExStyle); BOOL iconic = Style & WS_MINIMIZE; BOOL moved = FALSE; @@ -1124,8 +1137,8 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) if( iconic ) /* create a cursor for dragging */ { - HICON hIcon = (HICON)GetClassLong(hwnd, GCL_HICON); - if(!hIcon) hIcon = (HICON)SendMessage( hwnd, WM_QUERYDRAGICON, 0, 0L); + HICON hIcon = (HICON)GetClassLongW(hwnd, GCL_HICON); + if(!hIcon) hIcon = (HICON)SendMessageW( hwnd, WM_QUERYDRAGICON, 0, 0L); if( hIcon ) hDragCursor = CursorIconToCursor( hIcon, TRUE ); if( !hDragCursor ) iconic = FALSE; } @@ -1140,7 +1153,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) { int dx = 0, dy = 0; - GetMessage(&msg, 0, 0, 0); + GetMessageW(&msg, 0, 0, 0); /* Exit on button-up, Return, or Esc */ if ((msg.message == WM_LBUTTONUP) || @@ -1383,15 +1396,15 @@ DefWndNCCalcSize(HWND hWnd, RECT* Rect) Result |= WVR_HREDRAW; } - if (!(GetWindowLong(hWnd, GWL_STYLE) & WS_MINIMIZE)) + if (!(GetWindowLongW(hWnd, GWL_STYLE) & WS_MINIMIZE)) { - DefWndAdjustRect(&TmpRect, GetWindowLong(hWnd, GWL_STYLE), - FALSE, GetWindowLong(hWnd, GWL_EXSTYLE)); + DefWndAdjustRect(&TmpRect, GetWindowLongW(hWnd, GWL_STYLE), + FALSE, GetWindowLongW(hWnd, GWL_EXSTYLE)); Rect->left -= TmpRect.left; Rect->top -= TmpRect.top; Rect->right -= TmpRect.right; Rect->bottom -= TmpRect.bottom; - if (UserHasMenu(hWnd, GetWindowLong(hWnd, GWL_EXSTYLE))) + if (UserHasMenu(hWnd, GetWindowLongW(hWnd, GWL_EXSTYLE))) { Rect->top += MenuGetMenuBarHeight(hWnd, Rect->right - Rect->left, @@ -1497,7 +1510,7 @@ User32DefWindowProc(HWND hWnd, case WM_CONTEXTMENU: { - if (GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD) + if (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD) { if (bUnicode) { @@ -1516,7 +1529,7 @@ User32DefWindowProc(HWND hWnd, Pt.x = SLOWORD(lParam); Pt.y = SHIWORD(lParam); - if (GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD) + if (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD) { ScreenToClient(GetParent(hWnd), &Pt); } @@ -1568,7 +1581,7 @@ User32DefWindowProc(HWND hWnd, GetSystemMetrics(SM_CYICON)) / 2; DrawIcon(hDC, x, y, hIcon); } - if (GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_CLIENTEDGE) + if (GetWindowLongW(hWnd, GWL_EXSTYLE) & WS_EX_CLIENTEDGE) { RECT WindowRect; GetClientRect(hWnd, &WindowRect); @@ -1607,7 +1620,7 @@ User32DefWindowProc(HWND hWnd, case WM_MOUSEACTIVATE: { - if (GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD) + if (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD) { LONG Ret; if (bUnicode) @@ -1632,7 +1645,7 @@ User32DefWindowProc(HWND hWnd, { /* Check if the window is minimized. */ if (LOWORD(lParam) != WA_INACTIVE && - !(GetWindowLong(hWnd, GWL_STYLE) & WS_MINIMIZE)) + !(GetWindowLongW(hWnd, GWL_STYLE) & WS_MINIMIZE)) { SetFocus(hWnd); } @@ -1641,7 +1654,7 @@ User32DefWindowProc(HWND hWnd, case WM_MOUSEWHEEL: { - if (GetWindowLong(hWnd, GWL_STYLE & WS_CHILD)) + if (GetWindowLongW(hWnd, GWL_STYLE & WS_CHILD)) { if (bUnicode) { @@ -1677,7 +1690,7 @@ User32DefWindowProc(HWND hWnd, case WM_SETCURSOR: { - if (GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD) + if (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD) { if (LOWORD(lParam) < HTLEFT || LOWORD(lParam) > HTBOTTOMRIGHT) { @@ -1766,7 +1779,7 @@ User32DefWindowProc(HWND hWnd, } for (Len = 1; Len < 64; Len++) { - if ((hIcon = LoadIconW(NULL, MAKEINTRESOURCE(Len))) != NULL) + if ((hIcon = LoadIconW(NULL, MAKEINTRESOURCEW(Len))) != NULL) { return((LRESULT)hIcon); } @@ -2022,7 +2035,7 @@ DefWindowProcW(HWND hWnd, if (WindowTextAtom != 0) { WindowTextAtom = - (LPWSTR)(DWORD)GlobalAddAtom(L"USER32!WindowTextAtomW"); + (LPWSTR)(DWORD)GlobalAddAtomW(L"USER32!WindowTextAtomW"); } if (WindowTextAtom != 0 && (WindowText = GetPropW(hWnd, WindowTextAtom)) == NULL) diff --git a/reactos/lib/user32/windows/menu.c b/reactos/lib/user32/windows/menu.c index a0e524ae46f..8abd9b4385b 100644 --- a/reactos/lib/user32/windows/menu.c +++ b/reactos/lib/user32/windows/menu.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: menu.c,v 1.20 2003/08/06 18:43:57 weiden Exp $ +/* $Id: menu.c,v 1.21 2003/08/07 04:03:24 royce Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/menu.c @@ -255,18 +255,18 @@ MenuInit(VOID) return FALSE; } - hMenuFont = CreateFontIndirect(&ncm.lfMenuFont); + hMenuFont = CreateFontIndirectW(&ncm.lfMenuFont); if(hMenuFont == NULL) { - DbgPrint("MenuInit(): CreateFontIndirect(hMenuFont) failed!\n"); + DbgPrint("MenuInit(): CreateFontIndirectW(hMenuFont) failed!\n"); return FALSE; } ncm.lfMenuFont.lfWeight = max(ncm.lfMenuFont.lfWeight + 300, 1000); - hMenuFontBold = CreateFontIndirect(&ncm.lfMenuFont); + hMenuFontBold = CreateFontIndirectW(&ncm.lfMenuFont); if(hMenuFontBold == NULL) { - DbgPrint("MenuInit(): CreateFontIndirect(hMenuFontBold) failed!\n"); + DbgPrint("MenuInit(): CreateFontIndirectW(hMenuFontBold) failed!\n"); return FALSE; } } @@ -697,7 +697,7 @@ GetSubMenu( int nPos) { MENUITEMINFOW mi; - mi.cbSize = sizeof(MENUITEMINFO); + mi.cbSize = sizeof(mi); mi.fMask = MIIM_SUBMENU; if(NtUserMenuItemInfo(hMenu, (UINT)nPos, MF_BYPOSITION, &mi, FALSE)) { @@ -756,8 +756,8 @@ InsertMenuItemA( NTSTATUS Status; HANDLE hHeap = RtlGetProcessHeap(); - if((lpmii->cbSize == sizeof(MENUITEMINFO)) || - (lpmii->cbSize == sizeof(MENUITEMINFO) - sizeof(HBITMAP))) + if((lpmii->cbSize == sizeof(MENUITEMINFOA)) || + (lpmii->cbSize == sizeof(MENUITEMINFOA) - sizeof(HBITMAP))) { memcpy(&mi, lpmii, lpmii->cbSize); @@ -799,8 +799,12 @@ InsertMenuItemW( ULONG len = 0; HANDLE hHeap = RtlGetProcessHeap(); - if((lpmii->cbSize == sizeof(MENUITEMINFO)) || - (lpmii->cbSize == sizeof(MENUITEMINFO) - sizeof(HBITMAP))) + // while we could just pass 'lpmii' to win32k, we make a copy so that + // if a bad user passes bad data, we crash his process instead of the + // entire kernel + + if((lpmii->cbSize == sizeof(MENUITEMINFOW)) || + (lpmii->cbSize == sizeof(MENUITEMINFOW) - sizeof(HBITMAP))) { memcpy(&mi, lpmii, lpmii->cbSize); @@ -854,8 +858,9 @@ STDCALL IsMenu( HMENU hMenu) { + DWORD ret; SetLastError(ERROR_SUCCESS); - DWORD ret = NtUserBuildMenuItemList(hMenu, NULL, 0, 0); + ret = NtUserBuildMenuItemList(hMenu, NULL, 0, 0); return ((ret == -1) || (GetLastError() == ERROR_INVALID_MENU_HANDLE)); } diff --git a/reactos/lib/user32/windows/messagebox.c b/reactos/lib/user32/windows/messagebox.c index 4684b71d7fc..ae00457474a 100644 --- a/reactos/lib/user32/windows/messagebox.c +++ b/reactos/lib/user32/windows/messagebox.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: messagebox.c,v 1.9 2003/07/28 23:23:17 ekohl Exp $ +/* $Id: messagebox.c,v 1.10 2003/08/07 04:03:24 royce Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/messagebox.c @@ -47,8 +47,6 @@ #define MSGBOX_IDTEXT 100 #define IDS_ERROR 2 -#define RT_DIALOGA MAKEINTRESOURCEA(5) -#define RT_DIALOGW MAKEINTRESOURCEW(5) #define IDI_HANDA MAKEINTRESOURCEA(32513) #define IDI_HANDW MAKEINTRESOURCEW(32513) #define IDI_QUESTIONA MAKEINTRESOURCEA(32514) @@ -389,8 +387,8 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMS lpmb) if(lpmb->dwStyle & MB_RIGHT) { hItem = GetDlgItem(hwnd, MSGBOX_IDTEXT); - SetWindowLong(hItem, GWL_STYLE, - GetWindowLong(hItem, GWL_STYLE) | SS_RIGHT); + SetWindowLongW(hItem, GWL_STYLE, + GetWindowLongW(hItem, GWL_STYLE) | SS_RIGHT); } /* handle modal MessageBoxes */ diff --git a/reactos/lib/user32/windows/nonclient.c b/reactos/lib/user32/windows/nonclient.c index fedc3e0e1ea..600fc72e76e 100644 --- a/reactos/lib/user32/windows/nonclient.c +++ b/reactos/lib/user32/windows/nonclient.c @@ -60,8 +60,8 @@ void NC_GetInsideRect( HWND hwnd, RECT *rect ) DWORD Style, ExStyle; GetWindowRect(hwnd, rect); - Style = GetWindowLong(hwnd, GWL_STYLE); - ExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); + Style = GetWindowLongW(hwnd, GWL_STYLE); + ExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE); rect->top = rect->left = 0; rect->right = rect->right - rect->left; @@ -353,8 +353,8 @@ static void NC_DoNCPaint95( int has_menu; /* FIXME: Determine has_menu */ - Style = GetWindowLong(hwnd, GWL_STYLE); - ExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); + Style = GetWindowLongW(hwnd, GWL_STYLE); + ExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE); GetWindowRect(hwnd, &WindowRect); GetClientRect(hwnd, &ClientRect); diff --git a/reactos/lib/user32/windows/prop.c b/reactos/lib/user32/windows/prop.c index a8eec2d41b2..3c20c0b48c7 100644 --- a/reactos/lib/user32/windows/prop.c +++ b/reactos/lib/user32/windows/prop.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: prop.c,v 1.8 2003/07/10 21:04:32 chorns Exp $ +/* $Id: prop.c,v 1.9 2003/08/07 04:03:24 royce Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -39,7 +39,7 @@ * @unimplemented */ int STDCALL -EnumPropsA(HWND hWnd, PROPENUMPROC lpEnumFunc) +EnumPropsA(HWND hWnd, PROPENUMPROCA lpEnumFunc) { UNIMPLEMENTED; return 0; @@ -50,7 +50,7 @@ EnumPropsA(HWND hWnd, PROPENUMPROC lpEnumFunc) * @unimplemented */ int STDCALL -EnumPropsExA(HWND hWnd, PROPENUMPROCEX lpEnumFunc, LPARAM lParam) +EnumPropsExA(HWND hWnd, PROPENUMPROCEXA lpEnumFunc, LPARAM lParam) { UNIMPLEMENTED; return 0; @@ -61,7 +61,7 @@ EnumPropsExA(HWND hWnd, PROPENUMPROCEX lpEnumFunc, LPARAM lParam) * @unimplemented */ int STDCALL -EnumPropsExW(HWND hWnd, PROPENUMPROCEX lpEnumFunc, LPARAM lParam) +EnumPropsExW(HWND hWnd, PROPENUMPROCEXW lpEnumFunc, LPARAM lParam) { UNIMPLEMENTED; return 0; @@ -72,7 +72,7 @@ EnumPropsExW(HWND hWnd, PROPENUMPROCEX lpEnumFunc, LPARAM lParam) * @unimplemented */ int STDCALL -EnumPropsW(HWND hWnd, PROPENUMPROC lpEnumFunc) +EnumPropsW(HWND hWnd, PROPENUMPROCW lpEnumFunc) { UNIMPLEMENTED; return 0; diff --git a/reactos/lib/user32/windows/window.c b/reactos/lib/user32/windows/window.c index 7ee2396e55e..536ac225267 100644 --- a/reactos/lib/user32/windows/window.c +++ b/reactos/lib/user32/windows/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.51 2003/08/05 15:41:03 weiden Exp $ +/* $Id: window.c,v 1.52 2003/08/07 04:03:24 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -274,7 +274,7 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength) if (CallbackArgs->Proc == NULL) { /* FIXME: handle ANSI windows vs Unicode windows */ - CallbackArgs->Proc = (WNDPROC)GetWindowLong(CallbackArgs->Wnd, + CallbackArgs->Proc = (WNDPROC)GetWindowLongW(CallbackArgs->Wnd, GWL_WNDPROC); } Result = CallWindowProcW(CallbackArgs->Proc, CallbackArgs->Wnd, @@ -960,21 +960,6 @@ FindWindowExW(HWND hwndParent, } -/* - * @unimplemented - */ -WINBOOL STDCALL -GetAltTabInfo(HWND hwnd, - int iItem, - PALTTABINFO pati, - LPTSTR pszItemText, - UINT cchItemText) -{ - UNIMPLEMENTED; - return FALSE; -} - - /* * @unimplemented */ @@ -1229,15 +1214,15 @@ GetWindowTextLengthW(HWND hWnd) /* - * @unimplemented + * @implemented */ int STDCALL -GetWindowTextW(HWND hWnd, - LPWSTR lpString, - int nMaxCount) +GetWindowTextW( + HWND hWnd, + LPWSTR lpString, + int nMaxCount) { - UNIMPLEMENTED; - return 0; + return(SendMessageW(hWnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString)); } DWORD STDCALL @@ -1300,15 +1285,15 @@ IsWindowUnicode(HWND hWnd) WINBOOL STDCALL IsWindowVisible(HWND hWnd) { - while (GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD) + while (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD) { - if (!(GetWindowLong(hWnd, GWL_STYLE) & WS_VISIBLE)) + if (!(GetWindowLongW(hWnd, GWL_STYLE) & WS_VISIBLE)) { return(FALSE); } hWnd = GetAncestor(hWnd, GA_PARENT); } - return(GetWindowLong(hWnd, GWL_STYLE) & WS_VISIBLE); + return(GetWindowLongW(hWnd, GWL_STYLE) & WS_VISIBLE); } @@ -1318,7 +1303,7 @@ IsWindowVisible(HWND hWnd) WINBOOL STDCALL IsZoomed(HWND hWnd) { - ULONG uStyle = GetWindowLong(hWnd, GWL_STYLE); + ULONG uStyle = GetWindowLongW(hWnd, GWL_STYLE); return (uStyle & WS_MAXIMIZE); } @@ -1378,9 +1363,13 @@ RealChildWindowFromPoint(HWND hwndParent, */ UINT RealGetWindowClass(HWND hwnd, - LPTSTR pszType, + PVOID pszType, UINT cchType) { + /* + * FIXME - I don't think this function should exist... + * see RealGetWindowClassA & RealGetWindowClassW + */ UNIMPLEMENTED; return 0; } diff --git a/reactos/lib/user32/windows/winpos.c b/reactos/lib/user32/windows/winpos.c index 982c26dc60a..f7a79e8f1e8 100644 --- a/reactos/lib/user32/windows/winpos.c +++ b/reactos/lib/user32/windows/winpos.c @@ -1,4 +1,4 @@ -/* $Id: winpos.c,v 1.7 2003/07/27 11:54:41 dwelch Exp $ +/* $Id: winpos.c,v 1.8 2003/08/07 04:03:24 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -37,7 +37,7 @@ WinPosShowIconTitle(HWND hWnd, BOOL bShow) lpPos->IconTitle = hWnd = NULL; /*ICONTITLE_Create( pWnd );*/ if( bShow ) { - ULONG Style = GetWindowLong(hWnd, GWL_STYLE); + ULONG Style = GetWindowLongW(hWnd, GWL_STYLE); if( !(Style & WS_VISIBLE) ) { SendMessageA( hWnd, WM_SHOWWINDOW, TRUE, 0 ); @@ -57,8 +57,8 @@ WinPosGetMinMaxInfo(HWND hWnd, POINT* MaxSize, POINT* MaxPos, MINMAXINFO MinMax; INT XInc, YInc; INTERNALPOS* Pos; - ULONG Style = GetWindowLong(hWnd, GWL_STYLE); - ULONG ExStyle = GetWindowLong(hWnd, GWL_EXSTYLE); + ULONG Style = GetWindowLongW(hWnd, GWL_STYLE); + ULONG ExStyle = GetWindowLongW(hWnd, GWL_EXSTYLE); /* Get default values. */ MinMax.ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN); @@ -101,7 +101,7 @@ WinPosGetMinMaxInfo(HWND hWnd, POINT* MaxSize, POINT* MaxPos, MinMax.ptMaxPosition.y -= YInc; } - SendMessage(hWnd, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax); + SendMessageW(hWnd, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax); MinMax.ptMaxTrackSize.x = max(MinMax.ptMaxTrackSize.x, MinMax.ptMinTrackSize.x); diff --git a/reactos/lib/version/makefile b/reactos/lib/version/makefile index 556f999de58..9d2b430c0c9 100644 --- a/reactos/lib/version/makefile +++ b/reactos/lib/version/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.11 2003/02/02 19:24:16 hyperion Exp $ +# $Id: makefile,v 1.12 2003/08/07 04:03:24 royce Exp $ PATH_TO_TOP = ../.. @@ -10,6 +10,9 @@ TARGET_BASE = 0x77a90000 TARGET_CFLAGS = -fno-builtin +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostdlib -nostartfiles TARGET_SDKLIBS = kernel32.a ntdll.a diff --git a/reactos/lib/winedbgc/Makefile b/reactos/lib/winedbgc/Makefile index 04a9a60ee8c..81a80912858 100644 --- a/reactos/lib/winedbgc/Makefile +++ b/reactos/lib/winedbgc/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.3 2003/02/21 14:47:34 robd Exp $ +# $Id: Makefile,v 1.4 2003/08/07 04:03:24 royce Exp $ PATH_TO_TOP = ../.. @@ -13,6 +13,9 @@ TARGET_NAME = winedbgc #TARGET_CFLAGS = -g -D__NTDLL__ TARGET_CFLAGS = -D__NTDLL__ +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -Wl,--file-alignment,0x1000 \ -Wl,--section-alignment,0x1000 \ -nostartfiles diff --git a/reactos/lib/winmm/Makefile b/reactos/lib/winmm/Makefile index 20b428913c8..7433f6789a0 100644 --- a/reactos/lib/winmm/Makefile +++ b/reactos/lib/winmm/Makefile @@ -10,6 +10,9 @@ TARGET_BASE = 0x777c0000 TARGET_CFLAGS = +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = ntdll.a kernel32.a TARGET_OBJECTS = \ diff --git a/reactos/lib/winspool/Makefile b/reactos/lib/winspool/Makefile index 19d4732bf80..dcee53683e1 100644 --- a/reactos/lib/winspool/Makefile +++ b/reactos/lib/winspool/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 2003/04/30 20:44:06 gvg Exp $ +# $Id: Makefile,v 1.2 2003/08/07 04:03:24 royce Exp $ PATH_TO_TOP = ../.. @@ -19,6 +19,9 @@ TARGET_CFLAGS = \ -DLE \ -DDBG +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib TARGET_SDKLIBS = kernel32.a diff --git a/reactos/lib/ws2_32/makefile b/reactos/lib/ws2_32/makefile index 2fe2d61c955..dbbf0407608 100644 --- a/reactos/lib/ws2_32/makefile +++ b/reactos/lib/ws2_32/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.11 2003/04/14 01:19:07 hyperion Exp $ +# $Id: makefile,v 1.12 2003/08/07 04:03:24 royce Exp $ PATH_TO_TOP = ../.. @@ -17,6 +17,9 @@ TARGET_CFLAGS = \ -DLE \ -DDBG +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a diff --git a/reactos/lib/ws2_32/misc/event.c b/reactos/lib/ws2_32/misc/event.c index 506f703df36..3a54902f9c8 100644 --- a/reactos/lib/ws2_32/misc/event.c +++ b/reactos/lib/ws2_32/misc/event.c @@ -49,11 +49,11 @@ WSACreateEvent(VOID) return FALSE; } - Event = CreateEvent(NULL, TRUE, FALSE, NULL); + Event = CreateEventW(NULL, TRUE, FALSE, NULL); if (Event == INVALID_HANDLE_VALUE) WSASetLastError(WSA_INVALID_HANDLE); - + return (WSAEVENT)Event; } diff --git a/reactos/lib/ws2help/makefile b/reactos/lib/ws2help/makefile index 530ed19e20e..664fde0da15 100644 --- a/reactos/lib/ws2help/makefile +++ b/reactos/lib/ws2help/makefile @@ -15,6 +15,9 @@ TARGET_CFLAGS = \ -fno-builtin \ -DUNICODE +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib TARGET_SDKLIBS = ntdll.a kernel32.a ws2_32.a diff --git a/reactos/lib/wshirda/makefile b/reactos/lib/wshirda/makefile index a66aa2b783a..e7021dfe44b 100644 --- a/reactos/lib/wshirda/makefile +++ b/reactos/lib/wshirda/makefile @@ -10,6 +10,9 @@ TARGET_BASE = 0x777c0000 TARGET_CFLAGS = -DUNICODE +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = ntdll.a kernel32.a TARGET_OBJECTS = $(TARGET_NAME).o diff --git a/reactos/lib/wsock32/Makefile b/reactos/lib/wsock32/Makefile index 0ad2f3a1bfa..b67a739e92b 100644 --- a/reactos/lib/wsock32/Makefile +++ b/reactos/lib/wsock32/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 2003/04/03 22:44:19 gvg Exp $ +# $Id: Makefile,v 1.2 2003/08/07 04:03:24 royce Exp $ PATH_TO_TOP = ../.. @@ -17,6 +17,9 @@ TARGET_CFLAGS = \ -DLE \ -DDBG +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS = -nostartfiles -nostdlib TARGET_SDKLIBS = kernel32.a diff --git a/reactos/lib/wsock32/stubs.c b/reactos/lib/wsock32/stubs.c index 36eb4274d52..b120dc52dd1 100644 --- a/reactos/lib/wsock32/stubs.c +++ b/reactos/lib/wsock32/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.2 2003/07/10 21:41:56 chorns Exp $ +/* $Id: stubs.c,v 1.3 2003/08/07 04:03:24 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS WinSock DLL @@ -25,7 +25,7 @@ AcceptEx(SOCKET ListenSocket, LPDWORD BytesReceived, LPOVERLAPPED Overlapped) { - OutputDebugString(L"w32sock AcceptEx stub called\n"); + OutputDebugStringW(L"w32sock AcceptEx stub called\n"); return FALSE; } @@ -40,7 +40,7 @@ EnumProtocolsA(LPINT ProtocolCount, LPVOID ProtocolBuffer, LPDWORD BufferLength) { - OutputDebugString(L"w32sock EnumProtocolsA stub called\n"); + OutputDebugStringW(L"w32sock EnumProtocolsA stub called\n"); return SOCKET_ERROR; } @@ -55,7 +55,7 @@ EnumProtocolsW(LPINT ProtocolCount, LPVOID ProtocolBuffer, LPDWORD BufferLength) { - OutputDebugString(L"w32sock EnumProtocolsW stub called\n"); + OutputDebugStringW(L"w32sock EnumProtocolsW stub called\n"); return SOCKET_ERROR; } @@ -75,7 +75,7 @@ GetAcceptExSockaddrs(PVOID OutputBuffer, LPSOCKADDR* RemoteSockaddr, LPINT RemoteSockaddrLength) { - OutputDebugString(L"w32sock GetAcceptExSockaddrs stub called\n"); + OutputDebugStringW(L"w32sock GetAcceptExSockaddrs stub called\n"); } @@ -95,7 +95,7 @@ GetAddressByNameA(DWORD NameSpace, LPSTR AliasBuffer, LPDWORD AliasBufferLength) { - OutputDebugString(L"w32sock GetAddressByNameA stub called\n"); + OutputDebugStringW(L"w32sock GetAddressByNameA stub called\n"); return SOCKET_ERROR; } @@ -117,7 +117,7 @@ GetAddressByNameW(DWORD NameSpace, LPWSTR AliasBuffer, LPDWORD AliasBufferLength) { - OutputDebugString(L"w32sock GetAddressByNameW stub called\n"); + OutputDebugStringW(L"w32sock GetAddressByNameW stub called\n"); return SOCKET_ERROR; } @@ -132,7 +132,7 @@ GetNameByTypeA(LPGUID ServiceType, LPSTR ServiceName, DWORD NameLength) { - OutputDebugString(L"w32sock GetNameByTypeA stub called\n"); + OutputDebugStringW(L"w32sock GetNameByTypeA stub called\n"); return SOCKET_ERROR; } @@ -147,7 +147,7 @@ GetNameByTypeW(LPGUID ServiceType, LPWSTR ServiceName, DWORD NameLength) { - OutputDebugString(L"w32sock GetNameByTypeW stub called\n"); + OutputDebugStringW(L"w32sock GetNameByTypeW stub called\n"); return SOCKET_ERROR; } @@ -166,7 +166,7 @@ GetServiceA(DWORD NameSpace, LPDWORD BufferSize, LPVOID /* Really LPSERVICE_ASYNC_INFO */ ServiceAsyncInfo) { - OutputDebugString(L"w32sock GetServiceA stub called\n"); + OutputDebugStringW(L"w32sock GetServiceA stub called\n"); return SOCKET_ERROR; } @@ -185,7 +185,7 @@ GetServiceW(DWORD NameSpace, LPDWORD BufferSize, LPVOID /* Really LPSERVICE_ASYNC_INFO */ ServiceAsyncInfo) { - OutputDebugString(L"w32sock GetServiceW stub called\n"); + OutputDebugStringW(L"w32sock GetServiceW stub called\n"); return SOCKET_ERROR; } @@ -199,7 +199,7 @@ STDCALL GetTypeByNameA(LPSTR ServiceName, LPGUID ServiceType) { - OutputDebugString(L"w32sock GetTypeByNameA stub called\n"); + OutputDebugStringW(L"w32sock GetTypeByNameA stub called\n"); return SOCKET_ERROR; } @@ -213,7 +213,7 @@ STDCALL GetTypeByNameW(LPWSTR ServiceName, LPGUID ServiceType) { - OutputDebugString(L"w32sock GetTypeByNameW stub called\n"); + OutputDebugStringW(L"w32sock GetTypeByNameW stub called\n"); return SOCKET_ERROR; } @@ -231,7 +231,7 @@ SetServiceA(DWORD NameSpace, LPVOID /* Really LPSERVICE_ASYNC_INFOA */ ServiceAsyncInfo, LPDWORD dwStatusFlags) { - OutputDebugString(L"w32sock SetServiceA stub called\n"); + OutputDebugStringW(L"w32sock SetServiceA stub called\n"); return SOCKET_ERROR; } @@ -249,7 +249,7 @@ SetServiceW(DWORD NameSpace, LPVOID /* Really LPSERVICE_ASYNC_INFOW */ ServiceAsyncInfo, LPDWORD dwStatusFlags) { - OutputDebugString(L"w32sock SetServiceW stub called\n"); + OutputDebugStringW(L"w32sock SetServiceW stub called\n"); return SOCKET_ERROR; } @@ -268,7 +268,7 @@ TransmitFile(SOCKET Socket, LPVOID /* really LPTRANSMIT_FILE_BUFFERS */ TransmitBuffers, DWORD Flags) { - OutputDebugString(L"w32sock TransmitFile stub called\n"); + OutputDebugStringW(L"w32sock TransmitFile stub called\n"); return FALSE; } @@ -287,7 +287,7 @@ WSAAsyncGetHostByAddr(HWND Wnd, char *Buf, int BufLen) { - OutputDebugString(L"w32sock WSAAsyncGetHostByAddr stub called\n"); + OutputDebugStringW(L"w32sock WSAAsyncGetHostByAddr stub called\n"); return NULL; } @@ -304,7 +304,7 @@ WSAAsyncGetHostByName(HWND Wnd, char *Buf, int BufLen) { - OutputDebugString(L"w32sock WSAAsyncGetHostByName stub called\n"); + OutputDebugStringW(L"w32sock WSAAsyncGetHostByName stub called\n"); return NULL; } @@ -321,7 +321,7 @@ WSAAsyncGetProtoByName(HWND Wnd, char *Buf, int Buflen) { - OutputDebugString(L"w32sock WSAAsyncGetProtoByName stub called\n"); + OutputDebugStringW(L"w32sock WSAAsyncGetProtoByName stub called\n"); return NULL; } @@ -338,7 +338,7 @@ WSAAsyncGetProtoByNumber(HWND Wnd, char *Buf, int BufLen) { - OutputDebugString(L"w32sock WSAAsyncGetProtoByNumber stub called\n"); + OutputDebugStringW(L"w32sock WSAAsyncGetProtoByNumber stub called\n"); return NULL; } @@ -356,7 +356,7 @@ WSAAsyncGetServByName(HWND Wnd, char *Buf, int BufLen) { - OutputDebugString(L"w32sock WSAAsyncGetServByName stub called\n"); + OutputDebugStringW(L"w32sock WSAAsyncGetServByName stub called\n"); return NULL; } @@ -374,7 +374,7 @@ WSAAsyncGetServByPort(HWND Wnd, char *Buf, int BufLen) { - OutputDebugString(L"w32sock WSAAsyncGetServByPort stub called\n"); + OutputDebugStringW(L"w32sock WSAAsyncGetServByPort stub called\n"); return NULL; } @@ -390,7 +390,7 @@ WSAAsyncSelect(SOCKET Sock, UINT Msg, LONG Event) { - OutputDebugString(L"w32sock WSAAsyncSelect stub called\n"); + OutputDebugStringW(L"w32sock WSAAsyncSelect stub called\n"); return SOCKET_ERROR; } @@ -403,7 +403,7 @@ int STDCALL WSACancelAsyncRequest(HANDLE AsyncTaskHandle) { - OutputDebugString(L"w32sock WSACancelAsyncRequest stub called\n"); + OutputDebugStringW(L"w32sock WSACancelAsyncRequest stub called\n"); return SOCKET_ERROR; } @@ -416,7 +416,7 @@ int STDCALL WSACancelBlockingCall() { - OutputDebugString(L"w32sock WSACancelBlockingCall stub called\n"); + OutputDebugStringW(L"w32sock WSACancelBlockingCall stub called\n"); return SOCKET_ERROR; } @@ -429,7 +429,7 @@ int STDCALL WSACleanup() { - OutputDebugString(L"w32sock WSACleanup stub called\n"); + OutputDebugStringW(L"w32sock WSACleanup stub called\n"); return SOCKET_ERROR; } @@ -442,7 +442,7 @@ int STDCALL WSAGetLastError(void) { - OutputDebugString(L"w32sock WSAGetLastError stub called\n"); + OutputDebugStringW(L"w32sock WSAGetLastError stub called\n"); return WSANOTINITIALISED; } @@ -455,7 +455,7 @@ BOOL STDCALL WSAIsBlocking(VOID) { - OutputDebugString(L"w32sock WSAIsBlocking stub called\n"); + OutputDebugStringW(L"w32sock WSAIsBlocking stub called\n"); return FALSE; } @@ -471,7 +471,7 @@ WSARecvEx(SOCKET Sock, int Len, int *Flags) { - OutputDebugString(L"w32sock WSARecvEx stub called\n"); + OutputDebugStringW(L"w32sock WSARecvEx stub called\n"); return SOCKET_ERROR; } @@ -484,7 +484,7 @@ FARPROC STDCALL WSASetBlockingHook(FARPROC BlockFunc) { - OutputDebugString(L"w32sock WSASetBlockingHook stub called\n"); + OutputDebugStringW(L"w32sock WSASetBlockingHook stub called\n"); return NULL; } @@ -496,7 +496,7 @@ WSASetBlockingHook(FARPROC BlockFunc) void STDCALL WSASetLastError(int Error) { - OutputDebugString(L"w32sock WSASetLastError stub called\n"); + OutputDebugStringW(L"w32sock WSASetLastError stub called\n"); } @@ -508,7 +508,7 @@ STDCALL WSAStartup(WORD VersionRequested, LPWSADATA WSAData) { - OutputDebugString(L"w32sock WSAStartup stub called\n"); + OutputDebugStringW(L"w32sock WSAStartup stub called\n"); return WSASYSNOTREADY; } @@ -521,7 +521,7 @@ int STDCALL WSAUnhookBlockingHook(void) { - OutputDebugString(L"w32sock WSAUnhookBlockingHook stub called\n"); + OutputDebugStringW(L"w32sock WSAUnhookBlockingHook stub called\n"); return SOCKET_ERROR; } @@ -534,7 +534,7 @@ int STDCALL WSApSetPostRoutine(LPVOID /* really LPWPUPOSTMESSAGE */ PostRoutine) { - OutputDebugString(L"w32sock WSApSetPostRoutine stub called\n"); + OutputDebugStringW(L"w32sock WSApSetPostRoutine stub called\n"); return SOCKET_ERROR; } @@ -548,7 +548,7 @@ STDCALL __WSAFDIsSet(SOCKET Sock, fd_set *Set) { - OutputDebugString(L"w32sock __WSAFDIsSet stub called\n"); + OutputDebugStringW(L"w32sock __WSAFDIsSet stub called\n"); return 0; } @@ -563,7 +563,7 @@ accept(SOCKET Sock, struct sockaddr *Addr, int *AddrLen) { - OutputDebugString(L"w32sock accept stub called\n"); + OutputDebugStringW(L"w32sock accept stub called\n"); return INVALID_SOCKET; } @@ -578,7 +578,7 @@ bind(SOCKET Sock, CONST LPSOCKADDR Name, INT NameLen) { - OutputDebugString(L"w32sock bind stub called\n"); + OutputDebugStringW(L"w32sock bind stub called\n"); return SOCKET_ERROR; } @@ -591,7 +591,7 @@ int STDCALL closesocket(SOCKET Sock) { - OutputDebugString(L"w32sock closesocket stub called\n"); + OutputDebugStringW(L"w32sock closesocket stub called\n"); return SOCKET_ERROR; } @@ -606,7 +606,7 @@ connect(SOCKET Sock, CONST LPSOCKADDR Name, INT NameLen) { - OutputDebugString(L"w32sock connect stub called\n"); + OutputDebugStringW(L"w32sock connect stub called\n"); return SOCKET_ERROR; } @@ -623,7 +623,7 @@ dn_expand(unsigned char *MessagePtr, unsigned char *ExpandDomNam, int Length) { - OutputDebugString(L"w32sock dn_expand stub called\n"); + OutputDebugStringW(L"w32sock dn_expand stub called\n"); return SOCKET_ERROR; } @@ -638,7 +638,7 @@ gethostbyaddr(CONST CHAR *Addr, INT Len, INT Type) { - OutputDebugString(L"w32sock gethostbyaddr stub called\n"); + OutputDebugStringW(L"w32sock gethostbyaddr stub called\n"); return NULL; } @@ -651,7 +651,7 @@ struct hostent * STDCALL gethostbyname(const char *Name) { - OutputDebugString(L"w32sock gethostbyname stub called\n"); + OutputDebugStringW(L"w32sock gethostbyname stub called\n"); return NULL; } @@ -665,7 +665,7 @@ STDCALL gethostname(char *Name, int NameLen) { - OutputDebugString(L"w32sock gethostname stub called\n"); + OutputDebugStringW(L"w32sock gethostname stub called\n"); return SOCKET_ERROR; } @@ -678,7 +678,7 @@ struct netent * STDCALL getnetbyname(char *Name) { - OutputDebugString(L"w32sock getnetbyname stub called\n"); + OutputDebugStringW(L"w32sock getnetbyname stub called\n"); return NULL; } @@ -693,7 +693,7 @@ getpeername(SOCKET Sock, struct sockaddr *Name, int *NameLen) { - OutputDebugString(L"w32sock getpeername stub called\n"); + OutputDebugStringW(L"w32sock getpeername stub called\n"); return SOCKET_ERROR; } @@ -706,7 +706,7 @@ LPPROTOENT STDCALL getprotobyname(CONST CHAR *Name) { - OutputDebugString(L"w32sock getprotobyname stub called\n"); + OutputDebugStringW(L"w32sock getprotobyname stub called\n"); return NULL; } @@ -719,7 +719,7 @@ LPPROTOENT STDCALL getprotobynumber(INT Number) { - OutputDebugString(L"w32sock getprotobynumber stub called\n"); + OutputDebugStringW(L"w32sock getprotobynumber stub called\n"); return NULL; } @@ -733,7 +733,7 @@ STDCALL getservbyname(const char *Name, const char *Proto) { - OutputDebugString(L"w32sock getservbyname stub called\n"); + OutputDebugStringW(L"w32sock getservbyname stub called\n"); return NULL; } @@ -747,7 +747,7 @@ STDCALL getservbyport(int Port, const char *Proto) { - OutputDebugString(L"w32sock getservbyport stub called\n"); + OutputDebugStringW(L"w32sock getservbyport stub called\n"); return NULL; } @@ -762,7 +762,7 @@ getsockname(SOCKET Sock, struct sockaddr *Name, int *NameLen) { - OutputDebugString(L"w32sock getsockname stub called\n"); + OutputDebugStringW(L"w32sock getsockname stub called\n"); return SOCKET_ERROR; } @@ -779,7 +779,7 @@ getsockopt(SOCKET Sock, char *OptVal, int *OptLen) { - OutputDebugString(L"w32sock getsockopt stub called\n"); + OutputDebugStringW(L"w32sock getsockopt stub called\n"); return SOCKET_ERROR; } @@ -818,7 +818,7 @@ ULONG STDCALL inet_addr(CONST CHAR *cp) { - OutputDebugString(L"w32sock inet_addr stub called\n"); + OutputDebugStringW(L"w32sock inet_addr stub called\n"); return INADDR_NONE; } @@ -831,7 +831,7 @@ unsigned long STDCALL inet_network(const char *cp) { - OutputDebugString(L"w32sock inet_network stub called\n"); + OutputDebugStringW(L"w32sock inet_network stub called\n"); return INADDR_NONE; } @@ -844,7 +844,7 @@ char * STDCALL inet_ntoa(struct in_addr in) { - OutputDebugString(L"w32sock inet_ntoa stub called\n"); + OutputDebugStringW(L"w32sock inet_ntoa stub called\n"); return NULL; } @@ -859,7 +859,7 @@ ioctlsocket(SOCKET Sock, LONG Cmd, ULONG *Argp) { - OutputDebugString(L"w32sock ioctlsocket stub called\n"); + OutputDebugStringW(L"w32sock ioctlsocket stub called\n"); return SOCKET_ERROR; } @@ -873,7 +873,7 @@ STDCALL listen(SOCKET Sock, int BackLog) { - OutputDebugString(L"w32sock listen stub called\n"); + OutputDebugStringW(L"w32sock listen stub called\n"); return SOCKET_ERROR; } @@ -917,7 +917,7 @@ rcmd(char **AHost, char *Cmd, int *Fd2p) { - OutputDebugString(L"w32sock rcmd stub called\n"); + OutputDebugStringW(L"w32sock rcmd stub called\n"); return INVALID_SOCKET; } @@ -933,7 +933,7 @@ recv(SOCKET Sock, int Len, int Flags) { - OutputDebugString(L"w32sock recv stub called\n"); + OutputDebugStringW(L"w32sock recv stub called\n"); return SOCKET_ERROR; } @@ -951,7 +951,7 @@ recvfrom(SOCKET Sock, struct sockaddr *From, int *FromLen) { - OutputDebugString(L"w32sock recvfrom stub called\n"); + OutputDebugStringW(L"w32sock recvfrom stub called\n"); return SOCKET_ERROR; } @@ -969,7 +969,7 @@ rexec(char **AHost, char *Cmd, int *Fd2p) { - OutputDebugString(L"w32sock rexec stub called\n"); + OutputDebugStringW(L"w32sock rexec stub called\n"); return INVALID_SOCKET; } @@ -982,7 +982,7 @@ SOCKET STDCALL rresvport(int *port) { - OutputDebugString(L"w32sock rresvport stub called\n"); + OutputDebugStringW(L"w32sock rresvport stub called\n"); return INVALID_SOCKET; } @@ -995,7 +995,7 @@ void STDCALL s_perror(const char *str) { - OutputDebugString(L"w32sock s_perror stub called\n"); + OutputDebugStringW(L"w32sock s_perror stub called\n"); } @@ -1010,7 +1010,7 @@ select(INT NumFds, LPFD_SET ExceptFds, CONST LPTIMEVAL TimeOut) { - OutputDebugString(L"w32sock select stub called\n"); + OutputDebugStringW(L"w32sock select stub called\n"); return SOCKET_ERROR; } @@ -1026,7 +1026,7 @@ send(SOCKET Sock, int Len, int Flags) { - OutputDebugString(L"w32sock send stub called\n"); + OutputDebugStringW(L"w32sock send stub called\n"); return SOCKET_ERROR; } @@ -1044,7 +1044,7 @@ sendto(SOCKET Sock, CONST LPSOCKADDR To, INT ToLen) { - OutputDebugString(L"w32sock sendto stub called\n"); + OutputDebugStringW(L"w32sock sendto stub called\n"); return SOCKET_ERROR; } @@ -1057,7 +1057,7 @@ int STDCALL sethostname(char *Name, int NameLen) { - OutputDebugString(L"w32sock sethostname stub called\n"); + OutputDebugStringW(L"w32sock sethostname stub called\n"); return SOCKET_ERROR; } @@ -1074,7 +1074,7 @@ setsockopt(SOCKET Sock, const char *OptVal, int OptLen) { - OutputDebugString(L"w32sock setsockopt stub called\n"); + OutputDebugStringW(L"w32sock setsockopt stub called\n"); return SOCKET_ERROR; } @@ -1088,7 +1088,7 @@ STDCALL shutdown(SOCKET Sock, int How) { - OutputDebugString(L"w32sock shutdown stub called\n"); + OutputDebugStringW(L"w32sock shutdown stub called\n"); return SOCKET_ERROR; } @@ -1103,7 +1103,7 @@ socket(int AF, int Type, int Protocol) { - OutputDebugString(L"w32sock socket stub called\n"); + OutputDebugStringW(L"w32sock socket stub called\n"); return INVALID_SOCKET; } diff --git a/reactos/lib/zlib/Makefile b/reactos/lib/zlib/Makefile index 4946b1b085b..6ab42cc7fa1 100644 --- a/reactos/lib/zlib/Makefile +++ b/reactos/lib/zlib/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2003/04/14 01:19:08 hyperion Exp $ +# $Id: Makefile,v 1.5 2003/08/07 04:03:24 royce Exp $ PATH_TO_TOP = ../.. @@ -10,6 +10,9 @@ TARGET_CFLAGS = \ -MMD -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ -Wstrict-prototypes -Wmissing-prototypes +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_OBJECTS = \ adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o \ inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o diff --git a/reactos/ntoskrnl/Makefile b/reactos/ntoskrnl/Makefile index 52fcedee049..cb86968d50b 100644 --- a/reactos/ntoskrnl/Makefile +++ b/reactos/ntoskrnl/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.102 2003/07/20 22:10:38 ekohl Exp $ +# $Id: Makefile,v 1.103 2003/08/07 04:03:24 royce Exp $ # # ReactOS Operating System # @@ -43,6 +43,9 @@ endif # ASFLAGS += -D__USE_W32API -D_NTOSKRNL_ # CFLAGS += -D__USE_W32API -D_NTOSKRNL_ +# require os code to explicitly request A/W version of structs/functions +CFLAGS += -D_DISABLE_TIDENTS + # # Build configuration # diff --git a/reactos/subsys/csrss/makefile b/reactos/subsys/csrss/makefile index f0a6a2a78b1..0b16162ac07 100644 --- a/reactos/subsys/csrss/makefile +++ b/reactos/subsys/csrss/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.21 2003/01/07 17:37:22 robd Exp $ +# $Id: makefile,v 1.22 2003/08/07 04:03:24 royce Exp $ PATH_TO_TOP = ../.. @@ -13,6 +13,9 @@ TARGET_INSTALLDIR = system32 TARGET_CFLAGS = -D__NTAPP__ +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + OBJECTS_API = \ api/process.o \ api/wapi.o \ diff --git a/reactos/subsys/ntvdm/makefile b/reactos/subsys/ntvdm/makefile index 15375599214..92f1fc261a6 100644 --- a/reactos/subsys/ntvdm/makefile +++ b/reactos/subsys/ntvdm/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.1 2002/10/28 13:59:59 robd Exp $ +# $Id: makefile,v 1.2 2003/08/07 04:03:24 royce Exp $ PATH_TO_TOP = ../.. @@ -10,6 +10,9 @@ TARGET_NAME = ntvdm TARGET_INSTALLDIR = system32 +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_SDKLIBS = ntdll.a kernel32.a user32.a gdi32.a advapi32.a TARGET_OBJECTS = $(TARGET_NAME).o diff --git a/reactos/subsys/ntvdm/ntvdm.c b/reactos/subsys/ntvdm/ntvdm.c index f414786639a..935782c0db2 100644 --- a/reactos/subsys/ntvdm/ntvdm.c +++ b/reactos/subsys/ntvdm/ntvdm.c @@ -1,4 +1,4 @@ -/* $Id: ntvdm.c,v 1.2 2003/01/12 01:54:40 robd Exp $ +/* $Id: ntvdm.c,v 1.3 2003/08/07 04:03:24 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -33,7 +33,7 @@ void PrintString(char* fmt,...) vsprintf(buffer, fmt, ap); va_end(ap); - OutputDebugString(buffer); + OutputDebugStringA(buffer); } /* @@ -95,7 +95,7 @@ BOOL StartVDM(PVDM_CONTROL_BLOCK vdm) { BOOL Result; - STARTUPINFO StartupInfo; + STARTUPINFOA StartupInfo; StartupInfo.cb = sizeof(StartupInfo); StartupInfo.lpReserved = NULL; @@ -105,7 +105,7 @@ StartVDM(PVDM_CONTROL_BLOCK vdm) StartupInfo.cbReserved2 = 0; StartupInfo.lpReserved2 = 0; - Result = CreateProcess(vdm->CommandLine, + Result = CreateProcessA(vdm->CommandLine, NULL, NULL, NULL, @@ -276,15 +276,15 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho NTSTATUS Status; BOOL vdmStarted = FALSE; - CHAR WelcomeMsg[] = "ReactOS Virtual DOS Machine support.\n"; - CHAR PromptMsg[] = "Type r to run, s to shutdown or q to quit now."; + WCHAR WelcomeMsg[] = L"ReactOS Virtual DOS Machine support.\n"; + WCHAR PromptMsg[] = L"Type r to run, s to shutdown or q to quit now."; CHAR InputBuffer[255]; AllocConsole(); - SetConsoleTitle("ntvdm"); - - WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), - WelcomeMsg, strlen(WelcomeMsg), // wcslen(WelcomeMsg), + SetConsoleTitleW(L"ntvdm"); + + WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), + WelcomeMsg, lstrlenW(WelcomeMsg), // wcslen(WelcomeMsg), &Result, NULL); if (!CreateVDM(&VdmCB)) { @@ -305,18 +305,18 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho //SetLastError(); return 3; } - - GetSystemDirectory(VdmCB.CommandLine, MAX_PATH); + + GetSystemDirectoryA(VdmCB.CommandLine, MAX_PATH); strcat(VdmCB.CommandLine, "\\hello.exe"); - GetWindowsDirectory(VdmCB.CurrentDirectory, MAX_PATH); + GetWindowsDirectoryA(VdmCB.CurrentDirectory, MAX_PATH); for (;;) { - WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), - PromptMsg, strlen(PromptMsg), // wcslen(PromptMsg), + WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), + PromptMsg, lstrlenW(PromptMsg), // wcslen(PromptMsg), &Result, NULL); i = 0; do { - ReadConsole(GetStdHandle(STD_INPUT_HANDLE), + ReadConsoleA(GetStdHandle(STD_INPUT_HANDLE), &InputBuffer[i], 1, &Result, NULL); if (++i >= (sizeof(InputBuffer) - 1)) { diff --git a/reactos/subsys/smss/makefile b/reactos/subsys/smss/makefile index b37d23ce772..5afb362ff00 100644 --- a/reactos/subsys/smss/makefile +++ b/reactos/subsys/smss/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.9 2001/08/21 20:13:17 chorns Exp $ +# $Id: makefile,v 1.10 2003/08/07 04:03:24 royce Exp $ PATH_TO_TOP = ../.. @@ -12,6 +12,9 @@ TARGET_INSTALLDIR = system32 TARGET_CFLAGS = -D__NTAPP__ +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_OBJECTS = $(TARGET_NAME).o init.o smapi.o include $(PATH_TO_TOP)/rules.mak diff --git a/reactos/subsys/win32k/include/class.h b/reactos/subsys/win32k/include/class.h index 008bfef35e2..91d09c0b0a3 100644 --- a/reactos/subsys/win32k/include/class.h +++ b/reactos/subsys/win32k/include/class.h @@ -54,4 +54,4 @@ W32kGetClassLong(struct _WINDOW_OBJECT *WindowObject, ULONG Offset, BOOL Ansi); #endif /* __WIN32K_CLASS_H */ -/* EOF */ +/* EOF */ \ No newline at end of file diff --git a/reactos/subsys/win32k/include/menu.h b/reactos/subsys/win32k/include/menu.h index 687ff13a024..48bae84616b 100644 --- a/reactos/subsys/win32k/include/menu.h +++ b/reactos/subsys/win32k/include/menu.h @@ -259,5 +259,4 @@ NtUserTrackPopupMenuEx( #endif /* __WIN32K_MENU_H */ -/* EOF */ - +/* EOF */ \ No newline at end of file diff --git a/reactos/subsys/win32k/makefile b/reactos/subsys/win32k/makefile index 7161158e01e..efec3a35d21 100644 --- a/reactos/subsys/win32k/makefile +++ b/reactos/subsys/win32k/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.71 2003/07/31 23:15:07 weiden Exp $ +# $Id: makefile,v 1.72 2003/08/07 04:03:25 royce Exp $ PATH_TO_TOP = ../.. @@ -29,6 +29,9 @@ TARGET_CFLAGS =\ -DUNICODE \ -Wall +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + TARGET_LFLAGS =\ $(PATH_TO_TOP)/dk/nkm/lib/freetype.a \ $(PATH_TO_TOP)/dk/w32/lib/rosrtl.a \ @@ -90,7 +93,7 @@ include $(TOOLS_PATH)/helper.mk # Automatic dependency tracking DEP_OBJECTS := $(TARGET_OBJECTS) DEP_EXCLUDE_FILTER := main/svctabm.d -#include $(PATH_TO_TOP)/tools/depend.mk +include $(PATH_TO_TOP)/tools/depend.mk main/svctabm.o: main/svctab.c diff --git a/reactos/subsys/win32k/ntuser/class.c b/reactos/subsys/win32k/ntuser/class.c index bc9e65586ba..ca70b31ac35 100644 --- a/reactos/subsys/win32k/ntuser/class.c +++ b/reactos/subsys/win32k/ntuser/class.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: class.c,v 1.23 2003/08/06 16:47:35 weiden Exp $ +/* $Id: class.c,v 1.24 2003/08/07 04:03:25 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -263,73 +263,75 @@ W32kCreateClass(CONST WNDCLASSEXW *lpwcx, } RTL_ATOM STDCALL -NtUserRegisterClassExWOW(CONST WNDCLASSEXW *lpwcx, - BOOL bUnicodeClass, - DWORD Unknown3, - DWORD Unknown4, - DWORD Unknown5) +NtUserRegisterClassExWOW( + CONST WNDCLASSEXW *lpwcx, + BOOL bUnicodeClass, + DWORD Unknown3, + DWORD Unknown4, + DWORD Unknown5) + /* * FUNCTION: * Registers a new class with the window manager * ARGUMENTS: - * lpcxw = Win32 extended window class structure (unicode) - * bUnicodeClass = Wether to send ANSI or unicode strings + * lpwcx = Win32 extended window class structure + * bUnicodeClass = Whether to send ANSI or unicode strings * to window procedures * RETURNS: * Atom identifying the new class */ { - PWINSTATION_OBJECT WinStaObject; - PWNDCLASS_OBJECT ClassObject; - NTSTATUS Status; - RTL_ATOM Atom; - DPRINT("About to open window station handle (0x%X)\n", - PROCESS_WINDOW_STATION()); - Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(), - KernelMode, - 0, - &WinStaObject); - if (!NT_SUCCESS(Status)) - { - DPRINT("Validation of window station handle (0x%X) failed\n", - PROCESS_WINDOW_STATION()); - return((RTL_ATOM)0); - } - if (!IS_ATOM(lpwcx->lpszClassName)) + PWINSTATION_OBJECT WinStaObject; + PWNDCLASS_OBJECT ClassObject; + NTSTATUS Status; + RTL_ATOM Atom; + DPRINT("About to open window station handle (0x%X)\n", + PROCESS_WINDOW_STATION()); + Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(), + KernelMode, + 0, + &WinStaObject); + if (!NT_SUCCESS(Status)) + { + DPRINT("Validation of window station handle (0x%X) failed\n", + PROCESS_WINDOW_STATION()); + return((RTL_ATOM)0); + } + if (!IS_ATOM(lpwcx->lpszClassName)) + { + Status = RtlAddAtomToAtomTable(WinStaObject->AtomTable, + (LPWSTR)lpwcx->lpszClassName, + &Atom); + if (!NT_SUCCESS(Status)) { - Status = RtlAddAtomToAtomTable(WinStaObject->AtomTable, - (LPWSTR)lpwcx->lpszClassName, - &Atom); - if (!NT_SUCCESS(Status)) - { - ObDereferenceObject(WinStaObject); - DPRINT("Failed adding class name (%wS) to atom table\n", - lpwcx->lpszClassName); - SetLastNtError(Status); - return((RTL_ATOM)0); - } - } - else - { - Atom = (RTL_ATOM)(ULONG)lpwcx->lpszClassName; - } - ClassObject = W32kCreateClass(lpwcx, bUnicodeClass, Atom); - if (ClassObject == NULL) + ObDereferenceObject(WinStaObject); + DPRINT("Failed adding class name (%wS) to atom table\n", + lpwcx->lpszClassName); + SetLastNtError(Status); + return((RTL_ATOM)0); + } + } + else + { + Atom = (RTL_ATOM)(ULONG)lpwcx->lpszClassName; + } + ClassObject = W32kCreateClass(lpwcx, bUnicodeClass, Atom); + if (ClassObject == NULL) + { + if (!IS_ATOM(lpwcx->lpszClassName)) { - if (!IS_ATOM(lpwcx->lpszClassName)) - { - RtlDeleteAtomFromAtomTable(WinStaObject->AtomTable, Atom); - } - ObDereferenceObject(WinStaObject); - DPRINT("Failed creating window class object\n"); - SetLastNtError(STATUS_INSUFFICIENT_RESOURCES); - return((RTL_ATOM)0); - } - ExAcquireFastMutex(&PsGetWin32Process()->ClassListLock); - InsertTailList(&PsGetWin32Process()->ClassListHead, &ClassObject->ListEntry); - ExReleaseFastMutex(&PsGetWin32Process()->ClassListLock); - ObDereferenceObject(WinStaObject); - return(Atom); + RtlDeleteAtomFromAtomTable(WinStaObject->AtomTable, Atom); + } + ObDereferenceObject(WinStaObject); + DPRINT("Failed creating window class object\n"); + SetLastNtError(STATUS_INSUFFICIENT_RESOURCES); + return((RTL_ATOM)0); + } + ExAcquireFastMutex(&PsGetWin32Process()->ClassListLock); + InsertTailList(&PsGetWin32Process()->ClassListHead, &ClassObject->ListEntry); + ExReleaseFastMutex(&PsGetWin32Process()->ClassListLock); + ObDereferenceObject(WinStaObject); + return(Atom); } ULONG FASTCALL diff --git a/reactos/subsys/win32k/objects/icm.c b/reactos/subsys/win32k/objects/icm.c index e5c6aaebdc0..09c815bd9de 100644 --- a/reactos/subsys/win32k/objects/icm.c +++ b/reactos/subsys/win32k/objects/icm.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: icm.c,v 1.7 2003/08/05 15:41:03 weiden Exp $ */ +/* $Id: icm.c,v 1.8 2003/08/07 04:03:25 royce Exp $ */ #undef WIN32_LEAN_AND_MEAN #include @@ -61,11 +61,17 @@ W32kDeleteColorSpace(HCOLORSPACE hColorSpace) INT STDCALL -W32kEnumICMProfiles(HDC hDC, - ICMENUMPROC EnumICMProfilesFunc, - LPARAM lParam) +W32kEnumICMProfiles(HDC hDC, + LPWSTR lpstrBuffer, + UINT cch ) { + /* + * FIXME - build list of file names into lpstrBuffer. + * (MULTI-SZ would probably be best format) + * return (needed) length of buffer in bytes + */ UNIMPLEMENTED; + return 0; } HCOLORSPACE -- 2.17.1