Author: tkreuzer Date: Sat Aug 30 22:26:42 2014 New Revision: 64000
URL: http://svn.reactos.org/svn/reactos?rev=64000&view=rev Log: [PSDK/...] - Add/improve some definitions in ntdef.h - fix definition of SUBLANG_SINDHI_PAKISTAN in winnt.h - enable ARRAYSIZE in winnt.h - #undef ARRAYSIZE in certain wine code to avoid redefinition - Use PCCH instead of PCCHAR in ext2lib (PCCHAR is ntdef.h only) - remove obsolete definitions from smss.h
Modified: trunk/reactos/base/system/smss/smss.h trunk/reactos/dll/directx/wine/quartz/filtermapper.c trunk/reactos/dll/win32/mscoree/corruntimehost.c trunk/reactos/dll/win32/ole32/compobj.c trunk/reactos/dll/win32/rpcrt4/rpc_transport.c trunk/reactos/dll/win32/winhttp/request.c trunk/reactos/dll/win32/wininet/http.c trunk/reactos/include/psdk/ntdef.h trunk/reactos/include/psdk/winnt.h trunk/reactos/lib/fslib/ext2lib/Disk.c trunk/reactos/win32ss/user/user32/windows/spy.c
Modified: trunk/reactos/base/system/smss/smss.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/smss.h?rev... ============================================================================== --- trunk/reactos/base/system/smss/smss.h [iso-8859-1] (original) +++ trunk/reactos/base/system/smss/smss.h [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -18,13 +18,6 @@ #include <winbase.h> #include <winreg.h>
-#define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0])) -#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A) -#ifdef ENABLE_RTL_NUMBER_OF_V2 -#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V2(A) -#else -#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A) -#endif #define NTOS_MODE_USER #include <ndk/iofuncs.h> #include <ndk/obfuncs.h>
Modified: trunk/reactos/dll/directx/wine/quartz/filtermapper.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/quartz/fil... ============================================================================== --- trunk/reactos/dll/directx/wine/quartz/filtermapper.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/quartz/filtermapper.c [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -24,6 +24,7 @@ #include <initguid.h> #include <fil_data.h>
+#undef ARRAYSIZE #define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))
typedef struct FilterMapper3Impl @@ -1164,7 +1165,7 @@
if (FAILED(hr)) return hr; - + while(IEnumMoniker_Next(ppEnumMoniker, 1, &IMon, &nb) == S_OK) { IMoniker_Release(IMon); @@ -1184,7 +1185,7 @@ return E_OUTOFMEMORY; } ZeroMemory(regfilters, nb_mon * sizeof(REGFILTER)); /* will prevent bad free of Name in case of error. */ - + IEnumMoniker_Reset(ppEnumMoniker); while(IEnumMoniker_Next(ppEnumMoniker, 1, &IMon, &nb) == S_OK) { @@ -1238,7 +1239,7 @@ CoTaskMemFree(regfilters[idx].Name); CoTaskMemFree(regfilters); IEnumMoniker_Release(ppEnumMoniker); - + return hr; }
@@ -1259,7 +1260,7 @@ { strcpyW(wszKeyName, wszFilterSlash); strcatW(wszKeyName, wszClsid); - + lRet = RegCreateKeyExW(HKEY_CLASSES_ROOT, wszKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL); hr = HRESULT_FROM_WIN32(lRet); } @@ -1275,7 +1276,7 @@ { strcpyW(wszKeyName, wszClsidSlash); strcatW(wszKeyName, wszClsid); - + lRet = RegCreateKeyExW(HKEY_CLASSES_ROOT, wszKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL); hr = HRESULT_FROM_WIN32(lRet); } @@ -1286,7 +1287,7 @@ hr = HRESULT_FROM_WIN32(lRet); RegCloseKey(hKey); } - + CoTaskMemFree(wszClsid);
return hr; @@ -1346,7 +1347,7 @@ strcpyW(wszPinsKeyName, wszPins); strcatW(wszPinsKeyName, wszSlash); strcatW(wszPinsKeyName, szName); - + lRet = RegCreateKeyExW(hKey, wszPinsKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hPinsKey, NULL); hr = HRESULT_FROM_WIN32(lRet); CoTaskMemFree(wszPinsKeyName);
Modified: trunk/reactos/dll/win32/mscoree/corruntimehost.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mscoree/corruntim... ============================================================================== --- trunk/reactos/dll/win32/mscoree/corruntimehost.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mscoree/corruntimehost.c [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -1205,6 +1205,7 @@ }
#define CHARS_IN_GUID 39 +#undef ARRAYSIZE #define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))
HRESULT create_monodata(REFIID riid, LPVOID *ppObj )
Modified: trunk/reactos/dll/win32/ole32/compobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compobj.c?r... ============================================================================== --- trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -43,6 +43,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
+#undef ARRAYSIZE #define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))
/**************************************************************************** @@ -1173,7 +1174,7 @@ return ret; }
-/* The given OXID must be local to this process: +/* The given OXID must be local to this process: * * The ref parameter is here mostly to ensure people remember that * they get one, you should normally take a ref for thread safety. @@ -2482,7 +2483,7 @@ * PARAMS * riid [I] Interface whose proxy/stub CLSID is to be returned. * pclsid [O] Where to store returned proxy/stub CLSID. - * + * * RETURNS * S_OK * E_OUTOFMEMORY @@ -2594,7 +2595,7 @@ * PARAMS * riid [I] Interface whose proxy/stub CLSID is to be registered. * rclsid [I] CLSID of the proxy/stub. - * + * * RETURNS * Success: S_OK * Failure: E_OUTOFMEMORY @@ -3576,14 +3577,14 @@ if (!apt) return CO_E_NOTINITIALIZED;
stubmgr = get_stub_manager_from_object(apt, pUnk); - + if (stubmgr) { if (fLock) stub_manager_ext_addref(stubmgr, 1, FALSE); else stub_manager_ext_release(stubmgr, 1, FALSE, fLastUnlockReleases); - + stub_manager_int_release(stubmgr);
return S_OK; @@ -4036,7 +4037,7 @@ FIXME("(%p, %p): stub\n", pUnk, pvReserved); return S_OK; } - + /*********************************************************************** * CoQueryProxyBlanket [OLE32.@] *
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_transport.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_transp... ============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -79,6 +79,7 @@
#define DEFAULT_NCACN_HTTP_TIMEOUT (60 * 1000)
+#undef ARRAYSIZE #define ARRAYSIZE(a) (sizeof((a)) / sizeof((a)[0]))
WINE_DEFAULT_DEBUG_CHANNEL(rpc); @@ -407,7 +408,7 @@ }
static void rpcrt4_conn_np_handoff(RpcConnection_np *old_npc, RpcConnection_np *new_npc) -{ +{ /* because of the way named pipes work, we'll transfer the connected pipe * to the child, then reopen the server binding to continue listening */
@@ -448,7 +449,7 @@ strcat(strcpy(pname, prefix), old_conn->Endpoint); status = rpcrt4_conn_create_pipe(old_conn, pname); I_RpcFree(pname); - + return status; }
@@ -714,9 +715,9 @@ HANDLE *objs = prev_array; RpcConnection_np *conn; RpcServerProtseq_np *npps = CONTAINING_RECORD(protseq, RpcServerProtseq_np, common); - + EnterCriticalSection(&protseq->cs); - + /* open and count connections */ *count = 1; conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); @@ -726,7 +727,7 @@ (*count)++; conn = CONTAINING_RECORD(conn->common.Next, RpcConnection_np, common); } - + /* make array of connections */ if (objs) objs = HeapReAlloc(GetProcessHeap(), 0, objs, *count*sizeof(HANDLE)); @@ -738,7 +739,7 @@ LeaveCriticalSection(&protseq->cs); return NULL; } - + objs[0] = npps->mgr_event; *count = 1; conn = CONTAINING_RECORD(protseq->conn, RpcConnection_np, common); @@ -763,7 +764,7 @@ DWORD res; RpcConnection *cconn; RpcConnection_np *conn; - + if (!objs) return -1;
@@ -1472,7 +1473,7 @@ conn->Next = protseq->conn; protseq->conn = first_connection; LeaveCriticalSection(&protseq->cs); - + TRACE("listening on %s\n", endpoint); return RPC_S_OK; } @@ -1638,7 +1639,7 @@ RpcServerProtseq_sock *sockps = CONTAINING_RECORD(protseq, RpcServerProtseq_sock, common);
EnterCriticalSection(&protseq->cs); - + /* open and count connections */ *count = 1; conn = (RpcConnection_tcp *)protseq->conn; @@ -1647,7 +1648,7 @@ (*count)++; conn = (RpcConnection_tcp *)conn->common.Next; } - + /* make array of connections */ if (poll_info) poll_info = HeapReAlloc(GetProcessHeap(), 0, poll_info, *count*sizeof(*poll_info)); @@ -1689,10 +1690,10 @@ unsigned int i; RpcConnection *cconn; RpcConnection_tcp *conn; - + if (!poll_info) return -1; - + ret = poll(poll_info, count, -1); if (ret < 0) {
Modified: trunk/reactos/dll/win32/winhttp/request.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/request.c... ============================================================================== --- trunk/reactos/dll/win32/winhttp/request.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/request.c [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -1197,6 +1197,7 @@ return ret; }
+#undef ARRAYSIZE #define ARRAYSIZE(array) (sizeof(array) / sizeof((array)[0]))
static const WCHAR basicW[] = {'B','a','s','i','c',0};
Modified: trunk/reactos/dll/win32/wininet/http.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?re... ============================================================================== --- trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -123,6 +123,7 @@
#define COLLECT_TIME 60000
+#undef ARRAYSIZE #define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))
struct HttpAuthInfo @@ -1299,7 +1300,7 @@
TRACE("%p, %s, %i, %i\n", hHttpRequest, debugstr_wn(lpszHeader, dwHeaderLength), dwHeaderLength, dwModifier);
- if (!lpszHeader) + if (!lpszHeader) return TRUE;
request = (http_request_t*) get_handle_object( hHttpRequest ); @@ -3841,13 +3842,13 @@ info_mod &= ~ modifier_flags[i].val; } } - + if (info_mod) { TRACE(" Unknown (%08x)", info_mod); } TRACE("\n"); } - + request = (http_request_t*) get_handle_object( hHttpRequest ); if (NULL == request || request->hdr.htype != WH_HHTTPREQ) { @@ -4943,7 +4944,7 @@ else requestString = build_request_header(request, request->verb, request->path, request->version, TRUE);
- + TRACE("Request header -> %s\n", debugstr_w(requestString) );
res = open_http_connection(request, &reusing_connection); @@ -4991,7 +4992,7 @@
INTERNET_SendCallback(&request->hdr, request->hdr.dwContext, INTERNET_STATUS_RECEIVING_RESPONSE, NULL, 0); - + if (HTTP_GetResponseHeaders(request, &responseLen)) { http_release_netconn(request, FALSE); @@ -6038,7 +6039,7 @@ /* REPLACE wins out over ADD */ if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) dwModifier &= ~HTTP_ADDHDR_FLAG_ADD; - + if (dwModifier & HTTP_ADDHDR_FLAG_ADD) index = -1; else
Modified: trunk/reactos/include/psdk/ntdef.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntdef.h?rev=64... ============================================================================== --- trunk/reactos/include/psdk/ntdef.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntdef.h [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -91,95 +91,96 @@
/* Helper macro to enable gcc's extension. */ #ifndef __GNU_EXTENSION -#ifdef __GNUC__ -#define __GNU_EXTENSION __extension__ -#else -#define __GNU_EXTENSION -#endif + #ifdef __GNUC__ + #define __GNU_EXTENSION __extension__ + #else + #define __GNU_EXTENSION + #endif #endif
#ifndef DUMMYUNIONNAME -#if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS) -#define _ANONYMOUS_UNION -#define _UNION_NAME(x) x -#define DUMMYUNIONNAME u -#define DUMMYUNIONNAME1 u1 -#define DUMMYUNIONNAME2 u2 -#define DUMMYUNIONNAME3 u3 -#define DUMMYUNIONNAME4 u4 -#define DUMMYUNIONNAME5 u5 -#define DUMMYUNIONNAME6 u6 -#define DUMMYUNIONNAME7 u7 -#define DUMMYUNIONNAME8 u8 -#define DUMMYUNIONNAME9 u9 -#else -#define _ANONYMOUS_UNION __GNU_EXTENSION -#define _UNION_NAME(x) -#define DUMMYUNIONNAME -#define DUMMYUNIONNAME1 -#define DUMMYUNIONNAME2 -#define DUMMYUNIONNAME3 -#define DUMMYUNIONNAME4 -#define DUMMYUNIONNAME5 -#define DUMMYUNIONNAME6 -#define DUMMYUNIONNAME7 -#define DUMMYUNIONNAME8 -#define DUMMYUNIONNAME9 -#endif /* NONAMELESSUNION */ + #if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS) + #define _ANONYMOUS_UNION + #define _UNION_NAME(x) x + #define DUMMYUNIONNAME u + #define DUMMYUNIONNAME1 u1 + #define DUMMYUNIONNAME2 u2 + #define DUMMYUNIONNAME3 u3 + #define DUMMYUNIONNAME4 u4 + #define DUMMYUNIONNAME5 u5 + #define DUMMYUNIONNAME6 u6 + #define DUMMYUNIONNAME7 u7 + #define DUMMYUNIONNAME8 u8 + #define DUMMYUNIONNAME9 u9 + #else + #define _ANONYMOUS_UNION __GNU_EXTENSION + #define _UNION_NAME(x) + #define DUMMYUNIONNAME + #define DUMMYUNIONNAME1 + #define DUMMYUNIONNAME2 + #define DUMMYUNIONNAME3 + #define DUMMYUNIONNAME4 + #define DUMMYUNIONNAME5 + #define DUMMYUNIONNAME6 + #define DUMMYUNIONNAME7 + #define DUMMYUNIONNAME8 + #define DUMMYUNIONNAME9 + #endif /* NONAMELESSUNION */ #endif /* !DUMMYUNIONNAME */
#ifndef DUMMYSTRUCTNAME -#if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS) -#define _ANONYMOUS_STRUCT -#define _STRUCT_NAME(x) x -#define DUMMYSTRUCTNAME s -#define DUMMYSTRUCTNAME1 s1 -#define DUMMYSTRUCTNAME2 s2 -#define DUMMYSTRUCTNAME3 s3 -#define DUMMYSTRUCTNAME4 s4 -#define DUMMYSTRUCTNAME5 s5 -#else -#define _ANONYMOUS_STRUCT __GNU_EXTENSION -#define _STRUCT_NAME(x) -#define DUMMYSTRUCTNAME -#define DUMMYSTRUCTNAME1 -#define DUMMYSTRUCTNAME2 -#define DUMMYSTRUCTNAME3 -#define DUMMYSTRUCTNAME4 -#define DUMMYSTRUCTNAME5 -#endif /* NONAMELESSUNION */ + #if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS) + #define _ANONYMOUS_STRUCT + #define _STRUCT_NAME(x) x + #define DUMMYSTRUCTNAME s + #define DUMMYSTRUCTNAME1 s1 + #define DUMMYSTRUCTNAME2 s2 + #define DUMMYSTRUCTNAME3 s3 + #define DUMMYSTRUCTNAME4 s4 + #define DUMMYSTRUCTNAME5 s5 + #else + #define _ANONYMOUS_STRUCT __GNU_EXTENSION + #define _STRUCT_NAME(x) + #define DUMMYSTRUCTNAME + #define DUMMYSTRUCTNAME1 + #define DUMMYSTRUCTNAME2 + #define DUMMYSTRUCTNAME3 + #define DUMMYSTRUCTNAME4 + #define DUMMYSTRUCTNAME5 + #endif /* NONAMELESSUNION */ #endif /* DUMMYSTRUCTNAME */
#if defined(STRICT_GS_ENABLED) -#pragma strict_gs_check(push, on) + #pragma strict_gs_check(push, on) #endif
#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) || defined(_M_ARM) -#define ALIGNMENT_MACHINE -#define UNALIGNED __unaligned -#if defined(_WIN64) -#define UNALIGNED64 __unaligned -#else -#define UNALIGNED64 -#endif -#else -#undef ALIGNMENT_MACHINE -#define UNALIGNED -#define UNALIGNED64 + #define ALIGNMENT_MACHINE + #define UNALIGNED __unaligned + #if defined(_WIN64) + #define UNALIGNED64 __unaligned + #else + #define UNALIGNED64 + #endif +#else + #undef ALIGNMENT_MACHINE + #define UNALIGNED + #define UNALIGNED64 #endif
#if defined(_WIN64) || defined(_M_ALPHA) -#define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG) -#define MEMORY_ALLOCATION_ALIGNMENT 16 -#else -#define MAX_NATURAL_ALIGNMENT sizeof(ULONG) -#define MEMORY_ALLOCATION_ALIGNMENT 8 -#endif - -#if defined(_M_MRX000) && !(defined(MIDL_PASS) || defined(RC_INVOKED)) && defined(ENABLE_RESTRICTED) -#define RESTRICTED_POINTER __restrict -#else -#define RESTRICTED_POINTER + #define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG) + #define MEMORY_ALLOCATION_ALIGNMENT 16 +#else + #define MAX_NATURAL_ALIGNMENT sizeof(ULONG) + #define MEMORY_ALLOCATION_ALIGNMENT 8 +#endif + +/* C99 restrict support */ +#if defined(ENABLE_RESTRICTED) && defined(_M_MRX000) && !defined(MIDL_PASS) && !defined(RC_INVOKED) + #define RESTRICTED_POINTER __restrict +#else + #define RESTRICTED_POINTER #endif
#define ARGUMENT_PRESENT(ArgumentPointer) \ @@ -187,66 +188,66 @@
/* Returns the base address of a structure from a structure member */ #ifndef CONTAINING_RECORD -#define CONTAINING_RECORD(address, type, field) \ - ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field)))) + #define CONTAINING_RECORD(address, type, field) \ + ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field)))) #endif
/* Returns the byte offset of the specified structure's member */ #ifndef __GNUC__ -#define FIELD_OFFSET(Type, Field) ((LONG)(LONG_PTR)&(((Type*) 0)->Field)) -#else -#define FIELD_OFFSET(Type, Field) ((LONG)__builtin_offsetof(Type, Field)) + #define FIELD_OFFSET(Type, Field) ((LONG)(LONG_PTR)&(((Type*) 0)->Field)) +#else + #define FIELD_OFFSET(Type, Field) ((LONG)__builtin_offsetof(Type, Field)) #endif
/* Returns the type's alignment */ #if defined(_MSC_VER) -#define TYPE_ALIGNMENT(t) __alignof(t) -#else -#define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test) + #define TYPE_ALIGNMENT(t) __alignof(t) +#else + #define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test) #endif
#if defined(_AMD64_) || defined(_X86_) -#define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(ULONG) + #define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(ULONG) #elif defined(_IA64_) || defined(_ARM_) -#define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT(ULONG)) -#else -#error "unknown architecture" + #define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT(ULONG)) +#else + #error "unknown architecture" #endif
#if defined(_WIN64) -#define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(ULONG) + #define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(ULONG) #endif
#ifdef __cplusplus -#define EXTERN_C extern "C" -#else -#define EXTERN_C extern + #define EXTERN_C extern "C" +#else + #define EXTERN_C extern #endif
/* Calling Conventions */ #if defined(_MANAGED) -#define FASTCALL __stdcall + #define FASTCALL __stdcall #elif defined(_M_IX86) -#define FASTCALL __fastcall -#else -#define FASTCALL + #define FASTCALL __fastcall +#else + #define FASTCALL #endif
#define NTAPI __stdcall
#ifndef STDMETHODCALLTYPE -#define STDMETHODCALLTYPE __stdcall -#define STDMETHODVCALLTYPE __cdecl -#define STDAPICALLTYPE __stdcall -#define STDAPIVCALLTYPE __cdecl -#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE -#define STDAPI_(t) EXTERN_C t STDAPICALLTYPE -#define STDMETHODIMP HRESULT STDMETHODCALLTYPE -#define STDMETHODIMP_(t) t STDMETHODCALLTYPE -#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE -#define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE -#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE -#define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE + #define STDMETHODCALLTYPE __stdcall + #define STDMETHODVCALLTYPE __cdecl + #define STDAPICALLTYPE __stdcall + #define STDAPIVCALLTYPE __cdecl + #define STDAPI EXTERN_C HRESULT STDAPICALLTYPE + #define STDAPI_(t) EXTERN_C t STDAPICALLTYPE + #define STDMETHODIMP HRESULT STDMETHODCALLTYPE + #define STDMETHODIMP_(t) t STDMETHODCALLTYPE + #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE + #define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE + #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE + #define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE #endif /* !STDMETHODCALLTYPE */
#define STDOVERRIDEMETHODIMP __override STDMETHODIMP @@ -258,7 +259,6 @@ #define IFACEMETHODIMPV __override STDMETHODIMPV #define IFACEMETHODIMPV_(t) __override STDMETHODIMPV_(t)
- /* Import and Export Specifiers */
/* Done the same way as in windef.h for now */ @@ -266,138 +266,147 @@ #define DECLSPEC_NORETURN __declspec(noreturn)
#ifndef DECLSPEC_ADDRSAFE -#if defined(_MSC_VER) && (defined(_M_ALPHA) || defined(_M_AXP64)) -#define DECLSPEC_ADDRSAFE __declspec(address_safe) -#else -#define DECLSPEC_ADDRSAFE -#endif + #if defined(_MSC_VER) && (defined(_M_ALPHA) || defined(_M_AXP64)) + #define DECLSPEC_ADDRSAFE __declspec(address_safe) + #else + #define DECLSPEC_ADDRSAFE + #endif #endif /* DECLSPEC_ADDRSAFE */
#ifndef DECLSPEC_NOTHROW -#if !defined(MIDL_PASS) -#define DECLSPEC_NOTHROW __declspec(nothrow) -#else -#define DECLSPEC_NOTHROW -#endif + #if !defined(MIDL_PASS) + #define DECLSPEC_NOTHROW __declspec(nothrow) + #else + #define DECLSPEC_NOTHROW + #endif #endif
#ifndef NOP_FUNCTION -#if defined(_MSC_VER) -#define NOP_FUNCTION __noop -#else -#define NOP_FUNCTION (void)0 -#endif + #if defined(_MSC_VER) + #define NOP_FUNCTION __noop + #else + #define NOP_FUNCTION (void)0 + #endif #endif
#if !defined(_NTSYSTEM_) -#define NTSYSAPI DECLSPEC_IMPORT -#define NTSYSCALLAPI DECLSPEC_IMPORT -#else -#define NTSYSAPI -#if defined(_NTDLLBUILD_) -#define NTSYSCALLAPI -#else -#define NTSYSCALLAPI DECLSPEC_ADDRSAFE -#endif + #define NTSYSAPI DECLSPEC_IMPORT + #define NTSYSCALLAPI DECLSPEC_IMPORT +#else + #define NTSYSAPI + #if defined(_NTDLLBUILD_) + #define NTSYSCALLAPI + #else + #define NTSYSCALLAPI DECLSPEC_ADDRSAFE + #endif #endif
/* Inlines */ #ifndef FORCEINLINE -#if defined(_MSC_VER) -#define FORCEINLINE __forceinline -#elif ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) -# define FORCEINLINE extern inline __attribute__((__always_inline__,__gnu_inline__)) -#else -# define FORCEINLINE extern __inline__ __attribute__((__always_inline__)) -#endif +# if defined(_MSC_VER) +# define FORCEINLINE __forceinline +# elif ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) +# define FORCEINLINE extern inline __attribute__((__always_inline__,__gnu_inline__)) +# else +# define FORCEINLINE extern __inline__ __attribute__((__always_inline__)) +# endif #endif /* FORCEINLINE */
#ifndef DECLSPEC_NOINLINE -#if (_MSC_VER >= 1300) -#define DECLSPEC_NOINLINE __declspec(noinline) -#elif defined(__GNUC__) -#define DECLSPEC_NOINLINE __attribute__((noinline)) -#else -#define DECLSPEC_NOINLINE -#endif +# if (_MSC_VER >= 1300) +# define DECLSPEC_NOINLINE __declspec(noinline) +# elif defined(__GNUC__) +# define DECLSPEC_NOINLINE __attribute__((noinline)) +# else +# define DECLSPEC_NOINLINE +# endif #endif /* DECLSPEC_NOINLINE */
#if !defined(_M_CEE_PURE) -#define NTAPI_INLINE NTAPI -#else -#define NTAPI_INLINE -#endif - -/* Use to specify structure alignment */ +# define NTAPI_INLINE NTAPI +#else +# define NTAPI_INLINE +#endif + +/* Use to specify structure alignment. Note: VS and GCC behave slightly + different. Therefore it is important to stick to the following rules: + - If you want a struct to be aligned, put DECLSPEC_ALIGN after "struct": + "typedef struct DECLSPEC_ALIGN(16) _FOO { ... } FOO, *PFOO;" + _alignof(PFOO) is sizeof(void*) here as usual. + - If you don't want the struct, but only the typedef to be aligned, + use an extra typedef. + struct _BAR { ... }; + typedef DECLSPEC_ALIGN(16) struct _BAR BAR, *ALIGNEDPBAR; + _alignof(ALIGNEDPBAR) is 16 now! */ #ifndef DECLSPEC_ALIGN -#if defined(_MSC_VER) && !defined(MIDL_PASS) -#define DECLSPEC_ALIGN(x) __declspec(align(x)) -#elif defined(__GNUC__) -#define DECLSPEC_ALIGN(x) __attribute__ ((__aligned__(x))) -#else -#define DECLSPEC_ALIGN(x) -#endif +# if defined(_MSC_VER) && !defined(MIDL_PASS) +# define DECLSPEC_ALIGN(x) __declspec(align(x)) +# elif defined(__GNUC__) +# define DECLSPEC_ALIGN(x) __attribute__ ((__aligned__(x))) +# else +# define DECLSPEC_ALIGN(x) +# endif #endif /* DECLSPEC_ALIGN */
#ifndef SYSTEM_CACHE_ALIGNMENT_SIZE -#if defined(_AMD64_) || defined(_X86_) -#define SYSTEM_CACHE_ALIGNMENT_SIZE 64 -#else -#define SYSTEM_CACHE_ALIGNMENT_SIZE 128 -#endif +# if defined(_AMD64_) || defined(_X86_) +# define SYSTEM_CACHE_ALIGNMENT_SIZE 64 +# else +# define SYSTEM_CACHE_ALIGNMENT_SIZE 128 +# endif #endif
#ifndef DECLSPEC_CACHEALIGN -#define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE) +# define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE) #endif
#ifndef DECLSPEC_UUID -#if defined(_MSC_VER) && defined(__cplusplus) -#define DECLSPEC_UUID(x) __declspec(uuid(x)) -#else -#define DECLSPEC_UUID(x) -#endif +# if defined(_MSC_VER) && defined(__cplusplus) +# define DECLSPEC_UUID(x) __declspec(uuid(x)) +# else +# define DECLSPEC_UUID(x) +# endif #endif
#ifndef DECLSPEC_NOVTABLE -#if defined(_MSC_VER) && defined(__cplusplus) -#define DECLSPEC_NOVTABLE __declspec(novtable) -#else -#define DECLSPEC_NOVTABLE -#endif +# if defined(_MSC_VER) && defined(__cplusplus) +# define DECLSPEC_NOVTABLE __declspec(novtable) +# else +# define DECLSPEC_NOVTABLE +# endif #endif
#ifndef DECLSPEC_SELECTANY -#if defined(_MSC_VER) || defined(__GNUC__) -#define DECLSPEC_SELECTANY __declspec(selectany) -#else -#define DECLSPEC_SELECTANY -#endif +# if defined(_MSC_VER) || defined(__GNUC__) +# define DECLSPEC_SELECTANY __declspec(selectany) +# else +# define DECLSPEC_SELECTANY +# endif #endif
#ifndef DECLSPEC_DEPRECATED -#if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(MIDL_PASS) -#define DECLSPEC_DEPRECATED __declspec(deprecated) -#define DEPRECATE_SUPPORTED -#else -#define DECLSPEC_DEPRECATED -#undef DEPRECATE_SUPPORTED -#endif +# if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(MIDL_PASS) +# define DECLSPEC_DEPRECATED __declspec(deprecated) +# define DEPRECATE_SUPPORTED +# else +# define DECLSPEC_DEPRECATED +# undef DEPRECATE_SUPPORTED +# endif #endif
#ifdef DEPRECATE_DDK_FUNCTIONS -#ifdef _NTDDK_ -#define DECLSPEC_DEPRECATED_DDK DECLSPEC_DEPRECATED -#ifdef DEPRECATE_SUPPORTED -#define PRAGMA_DEPRECATED_DDK 1 -#endif -#else -#define DECLSPEC_DEPRECATED_DDK -#define PRAGMA_DEPRECATED_DDK 1 -#endif -#else -#define DECLSPEC_DEPRECATED_DDK -#define PRAGMA_DEPRECATED_DDK 0 +# ifdef _NTDDK_ +# define DECLSPEC_DEPRECATED_DDK DECLSPEC_DEPRECATED +# ifdef DEPRECATE_SUPPORTED +# define PRAGMA_DEPRECATED_DDK 1 +# endif +# else +# define DECLSPEC_DEPRECATED_DDK +# define PRAGMA_DEPRECATED_DDK 1 +# endif +#else +# define DECLSPEC_DEPRECATED_DDK +# define PRAGMA_DEPRECATED_DDK 0 #endif
/* Use to silence unused variable warnings when it is intentional */ @@ -408,15 +417,12 @@
/* min/max helper macros */ #ifndef NOMINMAX - -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif - +# ifndef min +# define min(a,b) (((a) < (b)) ? (a) : (b)) +# endif +# ifndef max +# define max(a,b) (((a) > (b)) ? (a) : (b)) +# endif #endif /* NOMINMAX */
/* Tell windef.h that we have defined some basic types */ @@ -429,21 +435,27 @@ /* Handle Type */ typedef void *HANDLE, **PHANDLE;; #ifdef STRICT -#define DECLARE_HANDLE(n) typedef struct n##__{int unused;} *n -#else -#define DECLARE_HANDLE(n) typedef HANDLE n +# define DECLARE_HANDLE(n) typedef struct n##__{int unused;} *n +#else +# define DECLARE_HANDLE(n) typedef HANDLE n #endif
/* Upper-Case Versions of Some Standard C Types */ #ifndef VOID -#define VOID void +# define VOID void typedef char CHAR; typedef short SHORT; + +# if defined(__ROS_LONG64__) && !defined(_M_AMD64) +typedef int LONG; +# else typedef long LONG; -#if !defined(MIDL_PASS) +# endif + +# if !defined(MIDL_PASS) typedef int INT; -#endif -#endif +# endif /* !MIDL_PASS */ +#endif /* VOID */
/* Avoid redefinition in windef.h */ #define BASETYPES @@ -474,7 +486,7 @@ typedef signed char SCHAR, *PSCHAR;
#ifndef _HRESULT_DEFINED -#define _HRESULT_DEFINED +# define _HRESULT_DEFINED typedef _Return_type_success_(return >= 0) LONG HRESULT; #endif
@@ -533,18 +545,19 @@ typedef const UCSCHAR *PCUCSCHAR, *PCUCSSTR; typedef UCSCHAR UNALIGNED *PUUCSCHAR, *PUUCSSTR; typedef const UCSCHAR UNALIGNED *PCUUCSCHAR, *PCUUCSSTR; -#define UCSCHAR_INVALID_CHARACTER (0xffffffff) -#define MIN_UCSCHAR (0) -#define MAX_UCSCHAR (0x0010FFFF) +# define UCSCHAR_INVALID_CHARACTER (0xffffffff) +# define MIN_UCSCHAR (0) +# define MAX_UCSCHAR (0x0010FFFF) #endif /* _WIN32_WINNT >= 0x0600 */
#ifdef UNICODE
-#ifndef _TCHAR_DEFINED +# ifndef _TCHAR_DEFINED typedef WCHAR TCHAR, *PTCHAR; typedef WCHAR TUCHAR, *PTUCHAR; -#define _TCHAR_DEFINED -#endif /* !_TCHAR_DEFINED */ +# define _TCHAR_DEFINED +# endif /* !_TCHAR_DEFINED */ + typedef LPWCH LPTCH, PTCH; typedef LPCWCH LPCTCH, PCTCH; typedef LPWSTR PTSTR, LPTSTR; @@ -561,15 +574,15 @@ typedef PCNZWCH PCNZTCH; typedef PUNZWCH PUNZTCH; typedef PCUNZWCH PCUNZTCH; -#define __TEXT(quote) L##quote +# define __TEXT(quote) L##quote
#else /* UNICODE */
-#ifndef _TCHAR_DEFINED +# ifndef _TCHAR_DEFINED typedef char TCHAR, *PTCHAR; typedef unsigned char TUCHAR, *PTUCHAR; -#define _TCHAR_DEFINED -#endif /* !_TCHAR_DEFINED */ +# define _TCHAR_DEFINED +# endif /* !_TCHAR_DEFINED */ typedef LPCH LPTCH, PTCH; typedef LPCCH LPCTCH, PCTCH; typedef LPSTR PTSTR, LPTSTR, PUTSTR, LPUTSTR; @@ -579,10 +592,11 @@ typedef PZPSTR PZPTSTR; typedef PNZCH PNZTCH, PUNZTCH; typedef PCNZCH PCNZTCH, PCUNZTCH; -#define __TEXT(quote) quote // r_winnt - -#endif /* UNICODE */ // r_winnt -#define TEXT(quote) __TEXT(quote) // r_winnt +#define __TEXT(quote) quote + +#endif /* UNICODE */ + +#define TEXT(quote) __TEXT(quote)
/* Cardinal Data Types */ typedef char CCHAR; @@ -591,17 +605,25 @@ typedef ULONG CLONG, *PCLONG;
/* NLS basics (Locale and Language Ids) */ -typedef unsigned long LCID, *PLCID; -typedef unsigned short LANGID; +typedef ULONG LCID, *PLCID; +typedef USHORT LANGID;
#ifndef __COMPARTMENT_ID_DEFINED__ -#define __COMPARTMENT_ID_DEFINED__ +# define __COMPARTMENT_ID_DEFINED__ typedef enum { UNSPECIFIED_COMPARTMENT_ID = 0, DEFAULT_COMPARTMENT_ID } COMPARTMENT_ID, *PCOMPARTMENT_ID; #endif /* __COMPARTMENT_ID_DEFINED__ */ + +#ifndef __OBJECTID_DEFINED +# define __OBJECTID_DEFINED +typedef struct _OBJECTID { + GUID Lineage; + ULONG Uniquifier; +} OBJECTID; +#endif
#ifdef _MSC_VER #pragma warning(push) @@ -617,6 +639,16 @@ double DoNotUseThisField; } DUMMYUNIONNAME; } QUAD, *PQUAD, UQUAD, *PUQUAD; + +typedef struct +#if defined(_M_IA64) +DECLSPEC_ALIGN(16) +#endif +_FLOAT128 { + __int64 LowPart; + __int64 HighPart; +} FLOAT128; +typedef FLOAT128 *PFLOAT128;
/* Large Integer Unions */ #if defined(MIDL_PASS) @@ -668,6 +700,12 @@ LONG HighPart; } LUID, *PLUID;
+#define APPLICATION_ERROR_MASK 0x20000000 +#define ERROR_SEVERITY_SUCCESS 0x00000000 +#define ERROR_SEVERITY_INFORMATIONAL 0x40000000 +#define ERROR_SEVERITY_WARNING 0x80000000 +#define ERROR_SEVERITY_ERROR 0xC0000000 + /* Native API Return Value Macros */ #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) #define NT_INFORMATION(Status) ((((ULONG)(Status)) >> 30) == 1) @@ -675,6 +713,43 @@ #define NT_ERROR(Status) ((((ULONG)(Status)) >> 30) == 3)
/* String Types */ +typedef struct _STRING { + USHORT Length; + USHORT MaximumLength; +#ifdef MIDL_PASS + [size_is(MaximumLength), length_is(Length) ] +#endif + _Field_size_bytes_part_opt_(MaximumLength, Length) PCHAR Buffer; +} STRING, *PSTRING, + ANSI_STRING, *PANSI_STRING, + OEM_STRING, *POEM_STRING; + +typedef CONST STRING* PCOEM_STRING; +typedef STRING CANSI_STRING; +typedef PSTRING PCANSI_STRING; + +typedef struct _STRING32 { + USHORT Length; + USHORT MaximumLength; + ULONG Buffer; +} STRING32, *PSTRING32, + UNICODE_STRING32, *PUNICODE_STRING32, + ANSI_STRING32, *PANSI_STRING32; + +typedef struct _STRING64 { + USHORT Length; + USHORT MaximumLength; + ULONGLONG Buffer; +} STRING64, *PSTRING64, + UNICODE_STRING64, *PUNICODE_STRING64, + ANSI_STRING64, *PANSI_STRING64; + +typedef struct _CSTRING { + USHORT Length; + USHORT MaximumLength; + CONST CHAR *Buffer; +} CSTRING, *PCSTRING; + typedef struct _UNICODE_STRING { USHORT Length; USHORT MaximumLength; @@ -686,49 +761,44 @@ } UNICODE_STRING, *PUNICODE_STRING; typedef const UNICODE_STRING* PCUNICODE_STRING;
+typedef USHORT RTL_STRING_LENGTH_TYPE; + +#ifdef __cplusplus +extern "C++" template<typename _Type> struct _RTL_remove_const_template; +extern "C++" template<typename _Type> struct _RTL_remove_const_template<const _Type&> { typedef _Type type; }; +#define _RTL_CONSTANT_STRING_remove_const_macro(s) \ + (const_cast<_RTL_remove_const_template<decltype((s)[0])>::type*>(s)) +extern "C++" template<class _Ty> struct _RTL_CONSTANT_STRING_type_check_template; +extern "C++" template<class _Ty, int _Count> struct _RTL_CONSTANT_STRING_type_check_template<const _Ty (&)[_Count]> { typedef char type; }; +#define _RTL_CONSTANT_STRING_type_check(s) _RTL_CONSTANT_STRING_type_check_template<decltype(s)>::type +#else +# define _RTL_CONSTANT_STRING_remove_const_macro(s) (s) +char _RTL_CONSTANT_STRING_type_check(const void *s); +#endif +#define RTL_CONSTANT_STRING(s) { \ + sizeof(s)-sizeof((s)[0]), \ + sizeof(s) / sizeof(_RTL_CONSTANT_STRING_type_check(s)), \ + _RTL_CONSTANT_STRING_remove_const_macro(s) } + +#define DECLARE_UNICODE_STRING_SIZE(_var, _size) \ + WCHAR _var ## _buffer[_size]; \ + __pragma(warning(push)) __pragma(warning(disable:4221)) __pragma(warning(disable:4204)) \ + UNICODE_STRING _var = { 0, (_size) * sizeof(WCHAR) , _var ## _buffer } \ + __pragma(warning(pop)) + +#define DECLARE_CONST_UNICODE_STRING(_var, _string) \ + const WCHAR _var##_buffer[] = _string; \ + __pragma(warning(push)) __pragma(warning(disable:4221)) __pragma(warning(disable:4204)) \ + const UNICODE_STRING _var = { sizeof(_string) - sizeof(WCHAR), sizeof(_string), (PWCH)_var##_buffer } \ + __pragma(warning(pop)) + +#define DECLARE_GLOBAL_CONST_UNICODE_STRING(_var, _str) \ + extern const __declspec(selectany) UNICODE_STRING _var = RTL_CONSTANT_STRING(_str) + +#define ANSI_NULL ((CHAR)0) #define UNICODE_NULL ((WCHAR)0) #define UNICODE_STRING_MAX_BYTES ((USHORT) 65534) #define UNICODE_STRING_MAX_CHARS (32767) - -typedef struct _CSTRING { - USHORT Length; - USHORT MaximumLength; - CONST CHAR *Buffer; -} CSTRING, *PCSTRING; -#define ANSI_NULL ((CHAR)0) - -typedef struct _STRING { - USHORT Length; - USHORT MaximumLength; -#ifdef MIDL_PASS - [size_is(MaximumLength), length_is(Length) ] -#endif - _Field_size_bytes_part_opt_(MaximumLength, Length) PCHAR Buffer; -} STRING, *PSTRING; - -typedef STRING ANSI_STRING; -typedef PSTRING PANSI_STRING; -typedef STRING OEM_STRING; -typedef PSTRING POEM_STRING; -typedef CONST STRING* PCOEM_STRING; -typedef STRING CANSI_STRING; -typedef PSTRING PCANSI_STRING; - -typedef struct _STRING32 { - USHORT Length; - USHORT MaximumLength; - ULONG Buffer; -} STRING32, *PSTRING32, - UNICODE_STRING32, *PUNICODE_STRING32, - ANSI_STRING32, *PANSI_STRING32; - -typedef struct _STRING64 { - USHORT Length; - USHORT MaximumLength; - ULONGLONG Buffer; -} STRING64, *PSTRING64, - UNICODE_STRING64, *PUNICODE_STRING64, - ANSI_STRING64, *PANSI_STRING64;
/* Object Attributes */ typedef struct _OBJECT_ATTRIBUTES { @@ -873,24 +943,6 @@ #define RTL_FIELD_TYPE(type, field) (((type*)0)->field) #define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8) #define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field))) - -#ifdef __cplusplus -extern "C++" template<typename _Type> struct _RTL_remove_const_template; -extern "C++" template<typename _Type> struct _RTL_remove_const_template<const _Type&> { typedef _Type type; }; -#define _RTL_CONSTANT_STRING_remove_const_macro(s) \ - (const_cast<_RTL_remove_const_template<decltype((s)[0])>::type*>(s)) -extern "C++" template<class _Ty> struct _RTL_CONSTANT_STRING_type_check_template; -extern "C++" template<class _Ty, int _Count> struct _RTL_CONSTANT_STRING_type_check_template<const _Ty (&)[_Count]> { typedef char type; }; -#define _RTL_CONSTANT_STRING_type_check(s) _RTL_CONSTANT_STRING_type_check_template<decltype(s)>::type -#else -#define _RTL_CONSTANT_STRING_remove_const_macro(s) (s) -char _RTL_CONSTANT_STRING_type_check(const void *s); -#endif -#define RTL_CONSTANT_STRING(s) { \ - sizeof(s)-sizeof((s)[0]), \ - sizeof(s) / sizeof(_RTL_CONSTANT_STRING_type_check(s)), \ - _RTL_CONSTANT_STRING_remove_const_macro(s) } - #define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
#define RTL_SIZEOF_THROUGH_FIELD(type, field) \ @@ -915,6 +967,7 @@ #else #define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A) #endif + #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A) #define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A)
@@ -927,9 +980,9 @@ : (FIELD_OFFSET(type, field1) - FIELD_OFFSET(type, field2) - RTL_FIELD_SIZE(type, field2)))
#if defined(__cplusplus) -#define RTL_CONST_CAST(type) const_cast<type> -#else -#define RTL_CONST_CAST(type) (type) +# define RTL_CONST_CAST(type) const_cast<type> +#else +# define RTL_CONST_CAST(type) (type) #endif
/* Type Limits */ @@ -951,14 +1004,14 @@
#if defined(MIDL_PASS)|| defined(RC_INVOKED) || defined(_M_CEE_PURE) /* Use native math */ -#define Int64ShllMod32(a,b) ((unsigned __int64)(a)<<(b)) -#define Int64ShraMod32(a,b) (((__int64)(a))>>(b)) -#define Int64ShrlMod32(a,b) (((unsigned __int64)(a))>>(b)) +# define Int64ShllMod32(a,b) ((unsigned __int64)(a)<<(b)) +# define Int64ShraMod32(a,b) (((__int64)(a))>>(b)) +# define Int64ShrlMod32(a,b) (((unsigned __int64)(a))>>(b)) #else /* Use intrinsics */ -#define Int64ShllMod32(a,b) __ll_lshift(a,b) -#define Int64ShraMod32(a,b) __ll_rshift(a,b) -#define Int64ShrlMod32(a,b) __ull_rshift(a,b) +# define Int64ShllMod32(a,b) __ll_lshift(a,b) +# define Int64ShraMod32(a,b) __ll_rshift(a,b) +# define Int64ShrlMod32(a,b) __ull_rshift(a,b) #endif
#define RotateLeft32 _rotl @@ -967,10 +1020,10 @@ #define RotateRight64 _rotr64
#if defined(_M_AMD64) -#define RotateLeft8 _rotl8 -#define RotateLeft16 _rotl16 -#define RotateRight8 _rotr8 -#define RotateRight16 _rotr16 +# define RotateLeft8 _rotl8 +# define RotateLeft16 _rotl16 +# define RotateRight8 _rotr8 +# define RotateRight16 _rotr16 #endif /* _M_AMD64 */
/* C_ASSERT Definition */ @@ -1104,7 +1157,7 @@ #define PRIMARYLANGID(lgid) ((USHORT)(lgid) & 0x3ff) #define SUBLANGID(lgid) ((USHORT)(lgid) >> 10) #define MAKELCID(lgid, srtid) ((ULONG)((((ULONG)((USHORT)(srtid))) << 16) | \ - ((ULONG)((USHORT)(lgid))))) + ((ULONG)((USHORT)(lgid))))) #define MAKESORTLCID(lgid, srtid, ver) \ ((ULONG)((MAKELCID(lgid, srtid)) | \ (((ULONG)((USHORT)(ver))) << 20))) @@ -1132,9 +1185,9 @@ #define LANG_BASQUE 0x2d #define LANG_BELARUSIAN 0x23 #define LANG_BENGALI 0x45 -#define LANG_BRETON 0x7e #define LANG_BOSNIAN 0x1a #define LANG_BOSNIAN_NEUTRAL 0x781a +#define LANG_BRETON 0x7e #define LANG_BULGARIAN 0x02 #define LANG_CATALAN 0x03 #define LANG_CENTRAL_KURDISH 0x92 @@ -1521,8 +1574,8 @@ #define SORT_GEORGIAN_TRADITIONAL 0x0 #define SORT_GEORGIAN_MODERN 0x1
-#define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT)) -#define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)) +#define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT) +#define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)
#define LOCALE_SYSTEM_DEFAULT MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT) #define LOCALE_USER_DEFAULT MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)
Modified: trunk/reactos/include/psdk/winnt.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=64... ============================================================================== --- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -1379,7 +1379,7 @@ #define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01 #define SUBLANG_TSWANA_SOUTH_AFRICA 0x01 #define SUBLANG_SINDHI_AFGHANISTAN 0x02 -#define SUBLANG_SINDHI_PAKISTAN 0x01 +#define SUBLANG_SINDHI_PAKISTAN 0x02 #define SUBLANG_SINHALESE_SRI_LANKA 0x01 #define SUBLANG_SLOVAK_SLOVAKIA 0x01 #define SUBLANG_SLOVENIAN_SLOVENIA 0x01 @@ -1676,8 +1676,8 @@ #else #define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A) #endif -//#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A) -//#define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A) +#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A) +#define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A)
#define RTL_FIELD_TYPE(type, field) (((type*)0)->field) #define RTL_NUMBER_OF_FIELD(type, field) (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field)))
Modified: trunk/reactos/lib/fslib/ext2lib/Disk.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/ext2lib/Disk.c?re... ============================================================================== --- trunk/reactos/lib/fslib/ext2lib/Disk.c [iso-8859-1] (original) +++ trunk/reactos/lib/fslib/ext2lib/Disk.c [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -15,7 +15,7 @@
/* FUNCTIONS *************************************************************/
-PCCHAR +PCCH Ext2StatusToString ( IN NTSTATUS Status ) { switch (Status) @@ -953,14 +953,14 @@ * Length : Data Length to be read * Buffer : ... * - * RETURNS: + * RETURNS: * Success: STATUS_SUCCESS * Fail: ... * - * NOTES: + * NOTES: * Both Length and Offset should be SECTOR_SIZE aligned. */ -NTSTATUS +NTSTATUS Ext2ReadDisk( PEXT2_FILESYS Ext2Sys, ULONGLONG Offset, ULONG Length, @@ -1023,11 +1023,11 @@ goto errorout; }
- RtlCopyMemory( Buffer, + RtlCopyMemory( Buffer, (PUCHAR)NonPagedBuffer + (ULONG)(Offset - Address.QuadPart), Length ); } - + errorout:
if (NonPagedBuffer) @@ -1047,11 +1047,11 @@ * Length : Data Length to be written * Buffer : Data to be written ... * - * RETURNS: + * RETURNS: * Success: STATUS_SUCCESS * Fail: ... * - * NOTES: + * NOTES: * Both Length and Offset should be SECTOR_SIZE aligned. */
@@ -1151,10 +1151,10 @@ * ARGUMENTS: * VolumeHandle: Volume handle. * - * RETURNS: + * RETURNS: * Success or Fail * - * NOTES: + * NOTES: * N/A */
@@ -1200,10 +1200,10 @@ * ARGUMENTS: * VolumeHandle: Volume handle. * - * RETURNS: + * RETURNS: * Success or Fail * - * NOTES: + * NOTES: * N/A */
Modified: trunk/reactos/win32ss/user/user32/windows/spy.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/windows... ============================================================================== --- trunk/reactos/win32ss/user/user32/windows/spy.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/spy.c [iso-8859-1] Sat Aug 30 22:26:42 2014 @@ -31,6 +31,7 @@
#define SPY_MAX_MSGNUM WM_USER #define SPY_INDENT_UNIT 4 /* 4 spaces */ +#undef ARRAYSIZE #define ARRAYSIZE(a) ((sizeof(a) / sizeof((a)[0])))
#define DEBUG_SPY 0 @@ -2095,7 +2096,7 @@ { INT index; if (offset < 0 && offset % 2 == 0 && ((index = -(offset + 8) / 2) < - sizeof(ClassLongOffsetNames) / sizeof(*ClassLongOffsetNames))) + sizeof(ClassLongOffsetNames) / sizeof(*ClassLongOffsetNames))) { return ClassLongOffsetNames[index]; } @@ -2680,4 +2681,4 @@ break; } SetLastError( save_error ); -} +}