Author: sginsberg
Date: Sun Jul 26 17:36:35 2009
New Revision: 42233
URL:
http://svn.reactos.org/svn/reactos?rev=42233&view=rev
Log:
- Misc fixes for msvc:
- C89 compliance for "dbgprint"
- Fix more calling convention declarations in the DDK and gdi32
- Define noreturn attribute for crt's abort compatibly
- Fix some of the mess in psdk's intrinsics -- this needs some major clean up.
- Define DbgPrintEx the same way in debug.h as in NDK and DDK
- UUID doesn't need Wine-specific types -- include standard PSDK headers.
Modified:
trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c
trunk/reactos/dll/win32/gdi32/include/gdi32p.h
trunk/reactos/include/crt/process.h
trunk/reactos/include/ddk/ddkmapi.h
trunk/reactos/include/ddk/hidclass.h
trunk/reactos/include/psdk/winbase.h
trunk/reactos/include/psdk/winnt.h
trunk/reactos/include/reactos/debug.h
trunk/reactos/lib/sdk/uuid/uuid.rbuild
Modified: trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c [iso-8859-1] Sun Jul 26
17:36:35 2009
@@ -35,6 +35,7 @@
{
char psBuffer[128];
char psBuffer2[128];
+ char *nlptr2;
char cmd[255];
char test[300];
FILE *pPipe;
@@ -60,7 +61,7 @@
{
while(fgets(psBuffer2, 128, pPipe2))
{
- char *nlptr2 = strchr(psBuffer2, '\n');
+ nlptr2 = strchr(psBuffer2, '\n');
if (nlptr2)
*nlptr2 = '\0';
puts(psBuffer2);
Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/include/gd…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] Sun Jul 26 17:36:35 2009
@@ -115,36 +115,36 @@
} LOCALFONT, *PLOCALFONT;
// sdk/winspool.h
-typedef BOOL WINAPI (*ABORTPRINTER) (HANDLE);
-typedef BOOL WINAPI (*CLOSEPRINTER) (HANDLE);
-typedef BOOL WINAPI (*CLOSESPOOLFILEHANDLE) (HANDLE, HANDLE); // W2k8
-typedef HANDLE WINAPI (*COMMITSPOOLDATA) (HANDLE,HANDLE,DWORD); // W2k8
-typedef LONG WINAPI (*DOCUMENTPROPERTIESW)
(HWND,HANDLE,LPWSTR,PDEVMODEW,PDEVMODEW,DWORD);
-typedef BOOL WINAPI (*ENDDOCPRINTER) (HANDLE);
-typedef BOOL WINAPI (*ENDPAGEPRINTER) (HANDLE);
-typedef BOOL WINAPI (*GETPRINTERW) (HANDLE,DWORD,LPBYTE,DWORD,LPDWORD);
-typedef BOOL WINAPI (*GETPRINTERDRIVERW) (HANDLE,LPWSTR,DWORD,LPBYTE,DWORD,LPDWORD);
-typedef HANDLE WINAPI (*GETSPOOLFILEHANDLE) (HANDLE); // W2k8
-typedef BOOL WINAPI (*ISVALIDDEVMODEW) (PDEVMODEW,size_t);
-typedef BOOL WINAPI (*OPENPRINTERW) (LPWSTR,PHANDLE,LPPRINTER_DEFAULTSW);
-typedef BOOL WINAPI (*READPRINTER) (HANDLE,PVOID,DWORD,PDWORD);
-typedef BOOL WINAPI (*RESETPRINTERW) (HANDLE,LPPRINTER_DEFAULTSW);
-typedef LPWSTR WINAPI (*STARTDOCDLGW) (HANDLE,DOCINFOW *);
-typedef DWORD WINAPI (*STARTDOCPRINTERW) (HANDLE,DWORD,PBYTE);
-typedef BOOL WINAPI (*STARTPAGEPRINTER) (HANDLE);
+typedef BOOL (WINAPI *ABORTPRINTER) (HANDLE);
+typedef BOOL (WINAPI *CLOSEPRINTER) (HANDLE);
+typedef BOOL (WINAPI *CLOSESPOOLFILEHANDLE) (HANDLE, HANDLE); // W2k8
+typedef HANDLE (WINAPI *COMMITSPOOLDATA) (HANDLE,HANDLE,DWORD); // W2k8
+typedef LONG (WINAPI *DOCUMENTPROPERTIESW)
(HWND,HANDLE,LPWSTR,PDEVMODEW,PDEVMODEW,DWORD);
+typedef BOOL (WINAPI *ENDDOCPRINTER) (HANDLE);
+typedef BOOL (WINAPI *ENDPAGEPRINTER) (HANDLE);
+typedef BOOL (WINAPI *GETPRINTERW) (HANDLE,DWORD,LPBYTE,DWORD,LPDWORD);
+typedef BOOL (WINAPI *GETPRINTERDRIVERW) (HANDLE,LPWSTR,DWORD,LPBYTE,DWORD,LPDWORD);
+typedef HANDLE (WINAPI *GETSPOOLFILEHANDLE) (HANDLE); // W2k8
+typedef BOOL (WINAPI *ISVALIDDEVMODEW) (PDEVMODEW,size_t);
+typedef BOOL (WINAPI *OPENPRINTERW) (LPWSTR,PHANDLE,LPPRINTER_DEFAULTSW);
+typedef BOOL (WINAPI *READPRINTER) (HANDLE,PVOID,DWORD,PDWORD);
+typedef BOOL (WINAPI *RESETPRINTERW) (HANDLE,LPPRINTER_DEFAULTSW);
+typedef LPWSTR (WINAPI *STARTDOCDLGW) (HANDLE,DOCINFOW *);
+typedef DWORD (WINAPI *STARTDOCPRINTERW) (HANDLE,DWORD,PBYTE);
+typedef BOOL (WINAPI *STARTPAGEPRINTER) (HANDLE);
// ddk/winsplp.h
-typedef BOOL WINAPI (*SEEKPRINTER) (HANDLE,LARGE_INTEGER,PLARGE_INTEGER,DWORD,BOOL);
-typedef BOOL WINAPI (*SPLREADPRINTER) (HANDLE,LPBYTE *,DWORD);
+typedef BOOL (WINAPI *SEEKPRINTER) (HANDLE,LARGE_INTEGER,PLARGE_INTEGER,DWORD,BOOL);
+typedef BOOL (WINAPI *SPLREADPRINTER) (HANDLE,LPBYTE *,DWORD);
// Same as ddk/winsplp.h DriverUnloadComplete?
-typedef BOOL WINAPI (*SPLDRIVERUNLOADCOMPLETE) (LPWSTR);
+typedef BOOL (WINAPI *SPLDRIVERUNLOADCOMPLETE) (LPWSTR);
// Driver support:
// DrvDocumentEvent api/winddiui.h not W2k8 DocumentEventAW
-typedef INT WINAPI (*DOCUMENTEVENT) (HANDLE,HDC,INT,ULONG,PVOID,ULONG,PVOID);
+typedef INT (WINAPI *DOCUMENTEVENT) (HANDLE,HDC,INT,ULONG,PVOID,ULONG,PVOID);
// DrvQueryColorProfile
-typedef BOOL WINAPI (*QUERYCOLORPROFILE) (HANDLE,PDEVMODEW,ULONG,VOID*,ULONG,FLONG);
+typedef BOOL (WINAPI *QUERYCOLORPROFILE) (HANDLE,PDEVMODEW,ULONG,VOID*,ULONG,FLONG);
// Unknown:
-typedef DWORD WINAPI (*QUERYSPOOLMODE) (HANDLE,DWORD,DWORD);
-typedef DWORD WINAPI (*QUERYREMOTEFONTS) (DWORD,DWORD,DWORD);
+typedef DWORD (WINAPI *QUERYSPOOLMODE) (HANDLE,DWORD,DWORD);
+typedef DWORD (WINAPI *QUERYREMOTEFONTS) (DWORD,DWORD,DWORD);
extern CLOSEPRINTER fpClosePrinter;
Modified: trunk/reactos/include/crt/process.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/process.h?rev=…
==============================================================================
--- trunk/reactos/include/crt/process.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/process.h [iso-8859-1] Sun Jul 26 17:36:35 2009
@@ -40,7 +40,7 @@
#pragma push_macro("abort")
#undef abort
#endif
- void __cdecl __declspec(noreturn) abort(void);
+ __declspec(noreturn) void __cdecl abort(void);
#if __MINGW_GNUC_PREREQ(4,4)
#pragma pop_macro("abort")
#undef abort
Modified: trunk/reactos/include/ddk/ddkmapi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ddkmapi.h?rev=…
==============================================================================
--- trunk/reactos/include/ddk/ddkmapi.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/ddkmapi.h [iso-8859-1] Sun Jul 26 17:36:35 2009
@@ -95,8 +95,8 @@
#define DDNOTIFY_CLOSEVIDEOPORT 0x0200
#define DDNOTIFY_CLOSECAPTURE 0x0400
-typedef DWORD (*LPDXAPI)(DWORD dwFunctionNum, LPVOID lpvInBuffer, DWORD cbInBuffer,
LPVOID lpvOutBuffer, DWORD cbOutBuffer);
-typedef ULONG (*LPDD_NOTIFYCALLBACK) (DWORD dwFlags, PVOID pContext, DWORD dwParam1,
DWORD dwParam2);
+typedef DWORD (PASCAL *LPDXAPI)(DWORD dwFunctionNum, LPVOID lpvInBuffer, DWORD
cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer);
+typedef ULONG (PASCAL *LPDD_NOTIFYCALLBACK) (DWORD dwFlags, PVOID pContext, DWORD
dwParam1, DWORD dwParam2);
typedef struct _DDCAPBUFFINFO
{
Modified: trunk/reactos/include/ddk/hidclass.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/hidclass.h?rev…
==============================================================================
--- trunk/reactos/include/ddk/hidclass.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/hidclass.h [iso-8859-1] Sun Jul 26 17:36:35 2009
@@ -98,11 +98,11 @@
DeviceObjectRemoved
};
-typedef VOID DDKAPI (*PHID_STATUS_CHANGE)(
+typedef VOID (DDKAPI *PHID_STATUS_CHANGE)(
PVOID Context,
enum DeviceObjectState State);
-typedef NTSTATUS DDKAPI (*PHIDP_GETCAPS)(
+typedef NTSTATUS (DDKAPI *PHIDP_GETCAPS)(
IN PHIDP_PREPARSED_DATA PreparsedData,
OUT PHIDP_CAPS Capabilities);
Modified: trunk/reactos/include/psdk/winbase.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/winbase.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winbase.h [iso-8859-1] Sun Jul 26 17:36:35 2009
@@ -1835,6 +1835,52 @@
#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
+#if !defined(InterlockedAnd)
+#define InterlockedAnd InterlockedAnd_Inline
+FORCEINLINE
+LONG
+InterlockedAnd_Inline(IN OUT volatile LONG *Target,
+ IN LONG Set)
+{
+ LONG i;
+ LONG j;
+
+ j = *Target;
+ do {
+ i = j;
+ j = _InterlockedCompareExchange((volatile long *)Target,
+ i & Set,
+ i);
+
+ } while (i != j);
+
+ return j;
+}
+#endif
+
+#if !defined(InterlockedOr)
+#define InterlockedOr InterlockedOr_Inline
+FORCEINLINE
+LONG
+InterlockedOr_Inline(IN OUT volatile LONG *Target,
+ IN LONG Set)
+{
+ LONG i;
+ LONG j;
+
+ j = *Target;
+ do {
+ i = j;
+ j = _InterlockedCompareExchange((volatile long *)Target,
+ i | Set,
+ i);
+
+ } while (i != j);
+
+ return j;
+}
+#endif
+
#else // !(defined (_M_AMD64) || defined (_M_IA64))
LONG WINAPI InterlockedOr(IN OUT LONG volatile *,LONG);
@@ -1871,52 +1917,6 @@
VOID WINAPI InitializeSListHead(PSLIST_HEADER);
USHORT WINAPI QueryDepthSList(PSLIST_HEADER);
-
-#if !defined(InterlockedAnd)
-#define InterlockedAnd InterlockedAnd_Inline
-FORCEINLINE
-LONG
-InterlockedAnd_Inline(IN OUT volatile LONG *Target,
- IN LONG Set)
-{
- LONG i;
- LONG j;
-
- j = *Target;
- do {
- i = j;
- j = _InterlockedCompareExchange((volatile long *)Target,
- i & Set,
- i);
-
- } while (i != j);
-
- return j;
-}
-#endif
-
-#if !defined(InterlockedOr)
-#define InterlockedOr InterlockedOr_Inline
-FORCEINLINE
-LONG
-InterlockedOr_Inline(IN OUT volatile LONG *Target,
- IN LONG Set)
-{
- LONG i;
- LONG j;
-
- j = *Target;
- do {
- i = j;
- j = _InterlockedCompareExchange((volatile long *)Target,
- i | Set,
- i);
-
- } while (i != j);
-
- return j;
-}
-#endif
#endif /* __INTERLOCKED_DECLARED */
Modified: trunk/reactos/include/psdk/winnt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=4…
==============================================================================
--- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Sun Jul 26 17:36:35 2009
@@ -4901,7 +4901,7 @@
#if (_MSC_FULL_VER >= 13012035)
-DWORD __readfsdword(DWORD);
+unsigned long __readfsdword(const unsigned long Offset);
#pragma intrinsic(__readfsdword)
__inline PVOID GetCurrentFiber(void) { return (PVOID)(ULONG_PTR)__readfsdword(0x10); }
Modified: trunk/reactos/include/reactos/debug.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/debug.h?re…
==============================================================================
--- trunk/reactos/include/reactos/debug.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/debug.h [iso-8859-1] Sun Jul 26 17:36:35 2009
@@ -31,6 +31,7 @@
IN ...
);
+NTSYSAPI
ULONG
__cdecl
DbgPrintEx(
Modified: trunk/reactos/lib/sdk/uuid/uuid.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/uuid/uuid.rbuild?r…
==============================================================================
--- trunk/reactos/lib/sdk/uuid/uuid.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/uuid/uuid.rbuild [iso-8859-1] Sun Jul 26 17:36:35 2009
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="uuid" type="staticlibrary">
- <include base="ReactOS">include/reactos/wine</include>
<file>uuid.c</file>
</module>