- Fix definition of RTL_CRITICAL_SECTION_DEBUG.
authorAlex Ionescu <aionescu@gmail.com>
Fri, 26 Jan 2007 07:22:19 +0000 (07:22 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Fri, 26 Jan 2007 07:22:19 +0000 (07:22 +0000)
- Fix all MSVC warnings in kernel32.
- Re-enable PCH.
- Disable Rtl*CondVar calls, since we can't target Vista *AND* 2003 due to linker problems. We'll need a way to create multiple DLL versions if we're going to attempt this.
- Make ASSERTs always valid in kernel32 as long as DBG is set.
- Fix Windows-loading hack, it seems there's only two levels of SEH. Eitherways, I think I've found a cleaner way to make it load nicely, so this hack will go away soon.

svn path=/trunk/; revision=25633

34 files changed:
reactos/dll/win32/kernel32/file/cnotify.c
reactos/dll/win32/kernel32/file/dir.c
reactos/dll/win32/kernel32/file/dosdev.c
reactos/dll/win32/kernel32/file/file.c
reactos/dll/win32/kernel32/file/find.c
reactos/dll/win32/kernel32/file/lock.c
reactos/dll/win32/kernel32/file/npipe.c
reactos/dll/win32/kernel32/file/volume.c
reactos/dll/win32/kernel32/include/debug.h
reactos/dll/win32/kernel32/include/kernel32.h
reactos/dll/win32/kernel32/k32.h
reactos/dll/win32/kernel32/kernel32.rbuild
reactos/dll/win32/kernel32/mem/global.c
reactos/dll/win32/kernel32/mem/heap.c
reactos/dll/win32/kernel32/misc/actctx.c
reactos/dll/win32/kernel32/misc/comm.c
reactos/dll/win32/kernel32/misc/computername.c
reactos/dll/win32/kernel32/misc/console.c
reactos/dll/win32/kernel32/misc/dllmain.c
reactos/dll/win32/kernel32/misc/env.c
reactos/dll/win32/kernel32/misc/errormsg.c
reactos/dll/win32/kernel32/misc/lang.c
reactos/dll/win32/kernel32/misc/lcformat.c
reactos/dll/win32/kernel32/misc/ldr.c
reactos/dll/win32/kernel32/misc/lzexpand_main.c
reactos/dll/win32/kernel32/misc/nls.c
reactos/dll/win32/kernel32/misc/profile.c
reactos/dll/win32/kernel32/process/create.c
reactos/dll/win32/kernel32/process/proc.c
reactos/dll/win32/kernel32/string/lstring.c
reactos/dll/win32/kernel32/synch/condvar.c
reactos/dll/win32/kernel32/synch/timer.c
reactos/dll/win32/kernel32/thread/thread.c
reactos/include/psdk/winnt.h

index 4e95d4d..6dd6a9c 100644 (file)
@@ -119,7 +119,7 @@ FindFirstChangeNotificationW (
                                         NULL,//Buffer,
                                         0,//BufferLength,
                                         dwNotifyFilter,
                                         NULL,//Buffer,
                                         0,//BufferLength,
                                         dwNotifyFilter,
-                                        bWatchSubtree);
+                                        (BOOLEAN)bWatchSubtree);
    if (!NT_SUCCESS(Status))
    {
       SetLastErrorByStatus(Status);
    if (!NT_SUCCESS(Status))
    {
       SetLastErrorByStatus(Status);
@@ -200,7 +200,7 @@ ReadDirectoryChangesW(
       lpBuffer,
       nBufferLength,
       dwNotifyFilter,
       lpBuffer,
       nBufferLength,
       dwNotifyFilter,
-      bWatchSubtree
+      (BOOLEAN)bWatchSubtree
       );
 
    if (!NT_SUCCESS(Status))
       );
 
    if (!NT_SUCCESS(Status))
index 3c2a6ad..43f8650 100644 (file)
@@ -781,7 +781,7 @@ GetShortPathNameW (
             BOOLEAN spaces;
             memcpy(ustr_buf, longpath + lp, tmplen * sizeof(WCHAR));
             ustr_buf[tmplen] = '\0';
             BOOLEAN spaces;
             memcpy(ustr_buf, longpath + lp, tmplen * sizeof(WCHAR));
             ustr_buf[tmplen] = '\0';
-            ustr.Length = tmplen * sizeof(WCHAR);
+            ustr.Length = (USHORT)tmplen * sizeof(WCHAR);
             if (RtlIsNameLegalDOS8Dot3(&ustr, NULL, &spaces) && !spaces)
             {
                 sp += tmplen;
             if (RtlIsNameLegalDOS8Dot3(&ustr, NULL, &spaces) && !spaces)
             {
                 sp += tmplen;
@@ -889,7 +889,7 @@ SearchPathA (
                     goto Cleanup;
         }
 
                     goto Cleanup;
         }
 
-        BufferU.MaximumLength = nBufferLength * sizeof(WCHAR);
+        BufferU.MaximumLength = (USHORT)nBufferLength * sizeof(WCHAR);
         BufferU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                           0,
                                           BufferU.MaximumLength);
         BufferU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                           0,
                                           BufferU.MaximumLength);
@@ -899,7 +899,7 @@ SearchPathA (
             goto Cleanup;
         }
 
             goto Cleanup;
         }
 
-        Buffer.MaximumLength = nBufferLength;
+        Buffer.MaximumLength = (USHORT)nBufferLength;
         Buffer.Buffer = lpBuffer;
 
         RetValue = SearchPathW (NULL == lpPath ? NULL : PathU.Buffer,
         Buffer.Buffer = lpBuffer;
 
         RetValue = SearchPathW (NULL == lpPath ? NULL : PathU.Buffer,
index b8491ea..781b157 100644 (file)
@@ -135,10 +135,10 @@ QueryDosDeviceA(
     while (ucchMax)
     {
       CurrentLength = min (ucchMax, MAXUSHORT / 2);
     while (ucchMax)
     {
       CurrentLength = min (ucchMax, MAXUSHORT / 2);
-      TargetPathU.MaximumLength = TargetPathU.Length = CurrentLength * sizeof(WCHAR);
+      TargetPathU.MaximumLength = TargetPathU.Length = (USHORT)CurrentLength * sizeof(WCHAR);
      
       TargetPathA.Length = 0;
      
       TargetPathA.Length = 0;
-      TargetPathA.MaximumLength = CurrentLength;
+      TargetPathA.MaximumLength = (USHORT)CurrentLength;
 
       RtlUnicodeStringToAnsiString (&TargetPathA,
                                    &TargetPathU,
 
       RtlUnicodeStringToAnsiString (&TargetPathA,
                                    &TargetPathU,
index a5db894..6bfeb14 100644 (file)
@@ -38,16 +38,16 @@ FilenameA2W(LPCSTR NameA, BOOL alloc)
    PUNICODE_STRING pstrW;
    NTSTATUS Status;
 
    PUNICODE_STRING pstrW;
    NTSTATUS Status;
 
-   ASSERT(NtCurrentTeb()->StaticUnicodeString.Buffer == NtCurrentTeb()->StaticUnicodeBuffer);
+   //ASSERT(NtCurrentTeb()->StaticUnicodeString.Buffer == NtCurrentTeb()->StaticUnicodeBuffer);
    ASSERT(NtCurrentTeb()->StaticUnicodeString.MaximumLength == sizeof(NtCurrentTeb()->StaticUnicodeBuffer));
 
    RtlInitAnsiString(&str, NameA);
    pstrW = alloc ? &strW : &NtCurrentTeb()->StaticUnicodeString;
 
    if (bIsFileApiAnsi)
    ASSERT(NtCurrentTeb()->StaticUnicodeString.MaximumLength == sizeof(NtCurrentTeb()->StaticUnicodeBuffer));
 
    RtlInitAnsiString(&str, NameA);
    pstrW = alloc ? &strW : &NtCurrentTeb()->StaticUnicodeString;
 
    if (bIsFileApiAnsi)
-        Status= RtlAnsiStringToUnicodeString( pstrW, &str, alloc );
+        Status= RtlAnsiStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc );
    else
    else
-        Status= RtlOemStringToUnicodeString( pstrW, &str, alloc );
+        Status= RtlOemStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc );
 
     if (NT_SUCCESS(Status))
        return pstrW->Buffer;
 
     if (NT_SUCCESS(Status))
        return pstrW->Buffer;
@@ -85,7 +85,7 @@ FilenameU2A_FitOrFail(
       ANSI_STRING str;
 
       str.Buffer = DestA;
       ANSI_STRING str;
 
       str.Buffer = DestA;
-      str.MaximumLength = destLen;
+      str.MaximumLength = (USHORT)destLen;
 
 
       if (bIsFileApiAnsi)
 
 
       if (bIsFileApiAnsi)
@@ -337,7 +337,7 @@ OpenFile(LPCSTR lpFileName,
                     0,
                     FileNameString.Buffer);
 
                     0,
                     FileNameString.Buffer);
 
-       lpReOpenBuff->nErrCode = RtlNtStatusToDosError(errCode);
+       lpReOpenBuff->nErrCode = (WORD)RtlNtStatusToDosError(errCode);
 
        if (!NT_SUCCESS(errCode))
        {
 
        if (!NT_SUCCESS(errCode))
        {
@@ -1541,7 +1541,7 @@ CheckNameLegalDOS8Dot3W(
     if(lpOemName != NULL)
     {
       AnsiName.Buffer = lpOemName;
     if(lpOemName != NULL)
     {
       AnsiName.Buffer = lpOemName;
-      AnsiName.MaximumLength = OemNameSize * sizeof(CHAR);
+      AnsiName.MaximumLength = (USHORT)OemNameSize * sizeof(CHAR);
       AnsiName.Length = 0;
     }
 
       AnsiName.Length = 0;
     }
 
@@ -1583,7 +1583,7 @@ CheckNameLegalDOS8Dot3A(
     if(lpOemName != NULL)
     {
       AnsiName.Buffer = lpOemName;
     if(lpOemName != NULL)
     {
       AnsiName.Buffer = lpOemName;
-      AnsiName.MaximumLength = OemNameSize * sizeof(CHAR);
+      AnsiName.MaximumLength = (USHORT)OemNameSize * sizeof(CHAR);
       AnsiName.Length = 0;
     }
 
       AnsiName.Length = 0;
     }
 
@@ -1628,7 +1628,7 @@ GetFinalPathNameByHandleA(IN HANDLE hFile,
         cchFilePath > sizeof(FilePathW) / sizeof(FilePathW[0]))
     {
         FilePathU.Length = 0;
         cchFilePath > sizeof(FilePathW) / sizeof(FilePathW[0]))
     {
         FilePathU.Length = 0;
-        FilePathU.MaximumLength = cchFilePath * sizeof(WCHAR);
+        FilePathU.MaximumLength = (USHORT)cchFilePath * sizeof(WCHAR);
         FilePathU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
                                            0,
                                            FilePathU.MaximumLength);
         FilePathU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
                                            0,
                                            FilePathU.MaximumLength);
index 1e9be76..792cb51 100644 (file)
@@ -95,7 +95,7 @@ InternalCopyFindDataA(LPWIN32_FIND_DATAA            lpFindFileData,
     lpFindFileData->nFileSizeHigh = lpFileInfo->EndOfFile.u.HighPart;
     lpFindFileData->nFileSizeLow = lpFileInfo->EndOfFile.u.LowPart;
 
     lpFindFileData->nFileSizeHigh = lpFileInfo->EndOfFile.u.HighPart;
     lpFindFileData->nFileSizeLow = lpFileInfo->EndOfFile.u.LowPart;
 
-    FileNameU.Length = FileNameU.MaximumLength = lpFileInfo->FileNameLength;
+    FileNameU.Length = FileNameU.MaximumLength = (USHORT)lpFileInfo->FileNameLength;
     FileNameU.Buffer = lpFileInfo->FileName;
 
     FileNameA.MaximumLength = sizeof(lpFindFileData->cFileName) - sizeof(CHAR);
     FileNameU.Buffer = lpFileInfo->FileName;
 
     FileNameA.MaximumLength = sizeof(lpFindFileData->cFileName) - sizeof(CHAR);
@@ -213,7 +213,7 @@ InternalFindFirstFile (
        PWSTR SearchPath;
        PWCHAR SearchPattern;
        ULONG Length;
        PWSTR SearchPath;
        PWCHAR SearchPattern;
        ULONG Length;
-       BOOLEAN bResult;
+       BOOL bResult;
 
        DPRINT("FindFirstFileW(lpFileName %S)\n",
               lpFileName);
 
        DPRINT("FindFirstFileW(lpFileName %S)\n",
               lpFileName);
@@ -698,7 +698,7 @@ static VOID
 InternalCopyStreamInfo(IN OUT PKERNEL32_FIND_STREAM_DATA IData,
                        OUT LPVOID lpFindStreamData)
 {
 InternalCopyStreamInfo(IN OUT PKERNEL32_FIND_STREAM_DATA IData,
                        OUT LPVOID lpFindStreamData)
 {
-    ASSERT(IData->pCurrent != NULL);
+    ASSERT(IData->pCurrent);
 
     switch (IData->InfoLevel)
     {
 
     switch (IData->InfoLevel)
     {
index 14c7c03..1ced1b1 100644 (file)
@@ -98,8 +98,8 @@ LockFileEx(
                        &Offset,
                        &BytesToLock,
                        0,
                        &Offset,
                        &BytesToLock,
                        0,
-                       LockImmediate,
-                       LockExclusive);
+                       (BOOLEAN)LockImmediate,
+                       (BOOLEAN)LockExclusive);
    if ( !NT_SUCCESS(errCode) )
      {
       SetLastErrorByStatus (errCode);
    if ( !NT_SUCCESS(errCode) )
      {
       SetLastErrorByStatus (errCode);
index d34e04e..19f3e8f 100644 (file)
@@ -919,7 +919,7 @@ GetNamedPipeHandleStateA(HANDLE hNamedPipe,
 
   if(lpUserName != NULL)
   {
 
   if(lpUserName != NULL)
   {
-    UserNameW.MaximumLength = nMaxUserNameSize * sizeof(WCHAR);
+    UserNameW.MaximumLength = (USHORT)nMaxUserNameSize * sizeof(WCHAR);
     UserNameW.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, UserNameW.MaximumLength);
     if (UserNameW.Buffer == NULL)
     {
     UserNameW.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, UserNameW.MaximumLength);
     if (UserNameW.Buffer == NULL)
     {
@@ -929,7 +929,7 @@ GetNamedPipeHandleStateA(HANDLE hNamedPipe,
 
     UserNameA.Buffer = lpUserName;
     UserNameA.Length = 0;
 
     UserNameA.Buffer = lpUserName;
     UserNameA.Length = 0;
-    UserNameA.MaximumLength = nMaxUserNameSize;
+    UserNameA.MaximumLength = (USHORT)nMaxUserNameSize;
   }
 
   Ret = GetNamedPipeHandleStateW(hNamedPipe,
   }
 
   Ret = GetNamedPipeHandleStateW(hNamedPipe,
index 496d775..34c2cdb 100644 (file)
@@ -106,7 +106,7 @@ GetLogicalDriveStringsA(DWORD nBufferLength,
        for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
          if (dwDriveMap & (1<<drive))
          {
        for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
          if (dwDriveMap & (1<<drive))
          {
-            *p++ = 'A' + drive;
+            *p++ = 'A' + (UCHAR)drive;
             *p++ = ':';
             *p++ = '\\';
             *p++ = '\0';
             *p++ = ':';
             *p++ = '\\';
             *p++ = '\0';
@@ -464,7 +464,7 @@ GetVolumeInformationA(
 
   if (lpVolumeNameBuffer)
     {
 
   if (lpVolumeNameBuffer)
     {
-      VolumeNameU.MaximumLength = nVolumeNameSize * sizeof(WCHAR);
+      VolumeNameU.MaximumLength = (USHORT)nVolumeNameSize * sizeof(WCHAR);
       VolumeNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                            0,
                                            VolumeNameU.MaximumLength);
       VolumeNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                            0,
                                            VolumeNameU.MaximumLength);
@@ -477,7 +477,7 @@ GetVolumeInformationA(
   if (lpFileSystemNameBuffer)
     {
       FileSystemNameU.Length = 0;
   if (lpFileSystemNameBuffer)
     {
       FileSystemNameU.Length = 0;
-      FileSystemNameU.MaximumLength = nFileSystemNameSize * sizeof(WCHAR);
+      FileSystemNameU.MaximumLength = (USHORT)nFileSystemNameSize * sizeof(WCHAR);
       FileSystemNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                                0,
                                                FileSystemNameU.MaximumLength);
       FileSystemNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                                0,
                                                FileSystemNameU.MaximumLength);
@@ -511,7 +511,7 @@ FailNoMem:
         {
           VolumeNameU.Length = wcslen(VolumeNameU.Buffer) * sizeof(WCHAR);
          VolumeName.Length = 0;
         {
           VolumeNameU.Length = wcslen(VolumeNameU.Buffer) * sizeof(WCHAR);
          VolumeName.Length = 0;
-         VolumeName.MaximumLength = nVolumeNameSize;
+         VolumeName.MaximumLength = (USHORT)nVolumeNameSize;
          VolumeName.Buffer = lpVolumeNameBuffer;
        }
 
          VolumeName.Buffer = lpVolumeNameBuffer;
        }
 
@@ -519,7 +519,7 @@ FailNoMem:
        {
          FileSystemNameU.Length = wcslen(FileSystemNameU.Buffer) * sizeof(WCHAR);
          FileSystemName.Length = 0;
        {
          FileSystemNameU.Length = wcslen(FileSystemNameU.Buffer) * sizeof(WCHAR);
          FileSystemName.Length = 0;
-         FileSystemName.MaximumLength = nFileSystemNameSize;
+         FileSystemName.MaximumLength = (USHORT)nFileSystemNameSize;
          FileSystemName.Buffer = lpFileSystemNameBuffer;
        }
 
          FileSystemName.Buffer = lpFileSystemNameBuffer;
        }
 
index 495520b..a2e52aa 100644 (file)
 #define DPRINT
 #endif
 #define CHECKPOINT
 #define DPRINT
 #endif
 #define CHECKPOINT
-#ifdef ASSERT
-#undef ASSERT
-#endif
-#define ASSERT(x)
 #else
 #define DPRINT(...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
 #define CHECKPOINT do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);
 #else
 #define DPRINT(...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
 #define CHECKPOINT do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);
+#endif
+
 #ifdef ASSERT
 #undef ASSERT
 #ifdef ASSERT
 #undef ASSERT
-#endif
 #define ASSERT(x) do { if(!x) RtlAssert("#x", __FILE__,__LINE__, ""); } while(0);
 #endif
 #define ASSERT(x) do { if(!x) RtlAssert("#x", __FILE__,__LINE__, ""); } while(0);
 #endif
-
 #define DPRINT1(...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
 #define CHECKPOINT1 do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);
 
 #define DPRINT1(...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
 #define CHECKPOINT1 do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);
 
index 9966f31..3ed9a64 100755 (executable)
@@ -105,11 +105,11 @@ BasepInitializeContext(IN PCONTEXT Context,
                 
 VOID
 STDCALL
                 
 VOID
 STDCALL
-BaseThreadStartupThunk();
+BaseThreadStartupThunk(VOID);
 
 VOID
 STDCALL
 
 VOID
 STDCALL
-BaseProcessStartThunk();
+BaseProcessStartThunk(VOID);
         
 __declspec(noreturn)
 VOID
         
 __declspec(noreturn)
 VOID
index a719e54..6922bf9 100755 (executable)
@@ -12,8 +12,8 @@
 /* INCLUDES ******************************************************************/
 
 /* PSDK/NDK Headers */
 /* INCLUDES ******************************************************************/
 
 /* PSDK/NDK Headers */
+#define DBG 1
 #define WIN32_NO_STATUS
 #define WIN32_NO_STATUS
-#define NTOS_MODE_USER
 #define _KERNEL32_
 #include <windows.h>
 #include <tlhelp32.h>
 #define _KERNEL32_
 #include <windows.h>
 #include <tlhelp32.h>
@@ -29,7 +29,6 @@
 
 /* DDK Driver Headers */
 #include <ntddbeep.h>
 
 /* DDK Driver Headers */
 #include <ntddbeep.h>
-#include <ntddser.h>
 #include <mountmgr.h>
 #include <mountdev.h>
 
 #include <mountmgr.h>
 #include <mountdev.h>
 
index 347dbb8..aa75cab 100644 (file)
@@ -5,15 +5,10 @@
        <define name="_DISABLE_TIDENTS" />
        <define name="_SEH_NO_NATIVE_NLG" />
        <define name="__USE_W32API" />
        <define name="_DISABLE_TIDENTS" />
        <define name="_SEH_NO_NATIVE_NLG" />
        <define name="__USE_W32API" />
-       <define name="_WIN32_WINNT">0x0502</define>
+       <define name="_WIN32_WINNT">0x0600</define>
        <define name="__NO_CTYPE_INLINES" />
        <define name="__NO_CTYPE_INLINES" />
-       <define name="WINVER">0x502</define>
-<!--
-       !!!  DO NOT ENABLE PCH! SOME FILES ARE NOT PCH-SAFE AS THEY DEFINE  !!!
-       !!!  _WIN32_WINNT DIFFERENTLY BEFORE INCLUDING k32.h                !!!
-
+       <define name="WINVER">0x609</define>
        <pch>k32.h</pch>
        <pch>k32.h</pch>
--->
        <directory name="debug">
                <file>debugger.c</file>
                <file>output.c</file>
        <directory name="debug">
                <file>debugger.c</file>
                <file>output.c</file>
index 820bd01..f52f8c6 100644 (file)
@@ -914,12 +914,12 @@ GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
         /* Reset the right size and fill out the information */
         lpBuffer->dwLength = sizeof(MEMORYSTATUS);
         lpBuffer->dwMemoryLoad = lpBufferEx.dwMemoryLoad;
         /* Reset the right size and fill out the information */
         lpBuffer->dwLength = sizeof(MEMORYSTATUS);
         lpBuffer->dwMemoryLoad = lpBufferEx.dwMemoryLoad;
-        lpBuffer->dwTotalPhys = lpBufferEx.ullTotalPhys;
-        lpBuffer->dwAvailPhys = lpBufferEx.ullAvailPhys;
-        lpBuffer->dwTotalPageFile = lpBufferEx.ullTotalPageFile;
-        lpBuffer->dwAvailPageFile = lpBufferEx.ullAvailPageFile;
-        lpBuffer->dwTotalVirtual = lpBufferEx.ullTotalVirtual;
-        lpBuffer->dwAvailVirtual = lpBufferEx.ullAvailVirtual;
+        lpBuffer->dwTotalPhys = (SIZE_T)lpBufferEx.ullTotalPhys;
+        lpBuffer->dwAvailPhys = (SIZE_T)lpBufferEx.ullAvailPhys;
+        lpBuffer->dwTotalPageFile = (SIZE_T)lpBufferEx.ullTotalPageFile;
+        lpBuffer->dwAvailPageFile = (SIZE_T)lpBufferEx.ullAvailPageFile;
+        lpBuffer->dwTotalVirtual = (SIZE_T)lpBufferEx.ullTotalVirtual;
+        lpBuffer->dwAvailVirtual = (SIZE_T)lpBufferEx.ullAvailVirtual;
     }
 }
 
     }
 }
 
index 726e454..00af58d 100644 (file)
@@ -157,8 +157,8 @@ HeapExtend(HANDLE hHeap,
 {
     NTSTATUS Status;
 
 {
     NTSTATUS Status;
 
-    /* Call the RTL API */
-    Status = RtlExtendHeap(hHeap, dwFlags, BaseAddress, dwBytes);
+    /* Call the RTL API. Gone in Vista, so commented out. */
+    Status = STATUS_NOT_IMPLEMENTED; //RtlExtendHeap(hHeap, dwFlags, BaseAddress, dwBytes);
     if (!NT_SUCCESS(Status))
     {
         /* We failed */
     if (!NT_SUCCESS(Status))
     {
         /* We failed */
@@ -185,7 +185,7 @@ HeapQueryTagW(HANDLE hHeap,
     return RtlQueryTagHeap(hHeap,
                            dwFlags,
                            wTagIndex,
     return RtlQueryTagHeap(hHeap,
                            dwFlags,
                            wTagIndex,
-                           bResetCounters,
+                           (BOOLEAN)bResetCounters,
                            lpTagInfo);
 }
 
                            lpTagInfo);
 }
 
@@ -204,8 +204,8 @@ HeapSummary(HANDLE hHeap,
     /* Fill in the length information */
     Usage.Length = sizeof(Usage);
 
     /* Fill in the length information */
     Usage.Length = sizeof(Usage);
 
-    /* Call RTL */
-    Status = RtlUsageHeap(hHeap, dwFlags, &Usage);
+    /* Call RTL. Gone in Vista, so commented out */
+    Status = STATUS_NOT_IMPLEMENTED; //RtlUsageHeap(hHeap, dwFlags, &Usage);
     if (!NT_SUCCESS(Status))
     {
         /* We failed */
     if (!NT_SUCCESS(Status))
     {
         /* We failed */
@@ -231,8 +231,8 @@ HeapUsage(HANDLE hHeap,
 {
     NTSTATUS Status;
 
 {
     NTSTATUS Status;
 
-    /* Call RTL */
-    Status = RtlUsageHeap(hHeap, dwFlags, Usage);
+    /* Call RTL. Gone in Vista, so commented out */
+    Status = STATUS_NOT_IMPLEMENTED; //RtlUsageHeap(hHeap, dwFlags, &Usage);
     if (!NT_SUCCESS(Status))
     {
         /* We failed */
     if (!NT_SUCCESS(Status))
     {
         /* We failed */
index 4942cf5..a3d64d8 100644 (file)
@@ -40,10 +40,10 @@ FindActCtxSectionStringA(
     }
 
     /* Call the Unicode function */
     }
 
     /* Call the Unicode function */
-    bRetVal = FindActCtxSectionStringA(dwFlags, 
+    bRetVal = FindActCtxSectionStringW(dwFlags, 
                                         lpExtensionGuid,
                                         ulSectionId, 
                                         lpExtensionGuid,
                                         ulSectionId, 
-                                        lpStringToFind,
+                                        lpStringToFindW,
                                         ReturnedData);
 
     /* Clean up */
                                         ReturnedData);
 
     /* Clean up */
index c385f34..f7af83a 100644 (file)
  */
 
 #include <k32.h>
  */
 
 #include <k32.h>
+#undef SERIAL_LSRMST_ESCAPE
+#undef SERIAL_LSRMST_LSR_DATA
+#undef SERIAL_LSRMST_LSR_NODATA
+#undef SERIAL_LSRMST_MST
+#undef SERIAL_IOC_FCR_FIFO_ENABLE
+#undef SERIAL_IOC_FCR_RCVR_RESET
+#undef SERIAL_IOC_FCR_XMIT_RESET
+#undef SERIAL_IOC_FCR_DMA_MODE
+#undef SERIAL_IOC_FCR_RES1
+#undef SERIAL_IOC_FCR_RES2
+#undef SERIAL_IOC_FCR_RCVR_TRIGGER_LSB
+#undef SERIAL_IOC_FCR_RCVR_TRIGGER_MSB
+#undef SERIAL_IOC_MCR_DTR
+#undef SERIAL_IOC_MCR_RTS
+#undef SERIAL_IOC_MCR_OUT1
+#undef SERIAL_IOC_MCR_OUT2
+#undef SERIAL_IOC_MCR_LOOP
+#include <ntddser.h>
 
 #define NDEBUG
 #include "../include/debug.h"
 
 #define NDEBUG
 #include "../include/debug.h"
@@ -331,7 +349,7 @@ COMMDCB_PARAM_HANDLER(data)
         return FALSE;
 
     /* success */
         return FALSE;
 
     /* success */
-    Dcb->ByteSize = nValue;
+    Dcb->ByteSize = (BYTE)nValue;
     return TRUE;
 }
 
     return TRUE;
 }
 
@@ -442,7 +460,7 @@ COMMDCB_PARAM_HANDLER(parity)
         return FALSE;
 
     /* success */
         return FALSE;
 
     /* success */
-    Dcb->Parity = nValue;
+    Dcb->Parity = (BYTE)nValue;
     return TRUE;
 }
 
     return TRUE;
 }
 
@@ -503,7 +521,7 @@ COMMDCB_PARAM_HANDLER(stop)
     *StopBitsSet = TRUE;
 
     /* success */
     *StopBitsSet = TRUE;
 
     /* success */
-    Dcb->StopBits = nValue;
+    Dcb->StopBits = (BYTE)nValue;
     return TRUE;
 }
 
     return TRUE;
 }
 
@@ -1112,8 +1130,8 @@ GetCommState(HANDLE hFile, LPDCB lpDCB)
     if (HandFlow.FlowReplace & SERIAL_XOFF_CONTINUE) {
        lpDCB->fTXContinueOnXoff = 1;
        }
     if (HandFlow.FlowReplace & SERIAL_XOFF_CONTINUE) {
        lpDCB->fTXContinueOnXoff = 1;
        }
-    lpDCB->XonLim = HandFlow.XonLimit;
-    lpDCB->XoffLim = HandFlow.XoffLimit;
+    lpDCB->XonLim = (WORD)HandFlow.XonLimit;
+    lpDCB->XoffLim = (WORD)HandFlow.XoffLimit;
 
        result = DeviceIoControl(hFile, IOCTL_SERIAL_GET_CHARS,
                        NULL, 0, &SpecialChars, sizeof(SpecialChars), &dwBytesReturned, NULL);
 
        result = DeviceIoControl(hFile, IOCTL_SERIAL_GET_CHARS,
                        NULL, 0, &SpecialChars, sizeof(SpecialChars), &dwBytesReturned, NULL);
index 11351b9..b2cd61f 100644 (file)
@@ -144,7 +144,7 @@ GetComputerNameExW (
 
     case ComputerNameDnsFullyQualified:
         ResultString.Length = 0;
 
     case ComputerNameDnsFullyQualified:
         ResultString.Length = 0;
-        ResultString.MaximumLength = *nSize * sizeof(WCHAR);
+        ResultString.MaximumLength = (USHORT)*nSize * sizeof(WCHAR);
         ResultString.Buffer = lpBuffer;
 
         RtlZeroMemory(QueryTable, sizeof(QueryTable));
         ResultString.Buffer = lpBuffer;
 
         RtlZeroMemory(QueryTable, sizeof(QueryTable));
@@ -238,15 +238,15 @@ GetComputerNameExA (
        return ERROR_OUTOFMEMORY;
     }
 
        return ERROR_OUTOFMEMORY;
     }
 
-    AnsiString.MaximumLength = *nSize;
+    AnsiString.MaximumLength = (USHORT)*nSize;
     AnsiString.Length = 0;
     AnsiString.Buffer = lpBuffer;
 
     Result = GetComputerNameExW( NameType, TempBuffer, nSize );
 
     if( Result ) {
     AnsiString.Length = 0;
     AnsiString.Buffer = lpBuffer;
 
     Result = GetComputerNameExW( NameType, TempBuffer, nSize );
 
     if( Result ) {
-       UnicodeString.MaximumLength = *nSize * sizeof(WCHAR);
-       UnicodeString.Length = *nSize * sizeof(WCHAR);
+       UnicodeString.MaximumLength = (USHORT)*nSize * sizeof(WCHAR);
+       UnicodeString.Length = (USHORT)*nSize * sizeof(WCHAR);
        UnicodeString.Buffer = TempBuffer;
 
        RtlUnicodeStringToAnsiString (&AnsiString,
        UnicodeString.Buffer = TempBuffer;
 
        RtlUnicodeStringToAnsiString (&AnsiString,
index 34cda0a..783585e 100644 (file)
@@ -483,7 +483,7 @@ GetConsoleCommandHistoryLengthA (DWORD      Unknown0)
 /*
  * @unimplemented
  */
 /*
  * @unimplemented
  */
-DWORD STDCALL
+INT STDCALL
 GetConsoleDisplayMode (LPDWORD lpdwMode)
      /*
       * FUNCTION: Get the console display mode
 GetConsoleDisplayMode (LPDWORD lpdwMode)
      /*
       * FUNCTION: Get the console display mode
@@ -592,7 +592,7 @@ GetConsoleInputWaitHandle (VOID)
 /*
  * @unimplemented
  */
 /*
  * @unimplemented
  */
-DWORD STDCALL
+INT STDCALL
 GetCurrentConsoleFont(HANDLE hConsoleOutput,
                      BOOL bMaximumWindow,
                      PCONSOLE_FONT_INFO lpConsoleCurrentFont)
 GetCurrentConsoleFont(HANDLE hConsoleOutput,
                      BOOL bMaximumWindow,
                      PCONSOLE_FONT_INFO lpConsoleCurrentFont)
@@ -1126,7 +1126,7 @@ IntWriteConsole(HANDLE hConsoleOutput,
     Request->Data.WriteConsoleRequest.ConsoleHandle = hConsoleOutput;
     Request->Data.WriteConsoleRequest.Unicode = bUnicode;
 
     Request->Data.WriteConsoleRequest.ConsoleHandle = hConsoleOutput;
     Request->Data.WriteConsoleRequest.Unicode = bUnicode;
 
-    nChars = min(nNumberOfCharsToWrite, CSRSS_MAX_WRITE_CONSOLE / CharSize);
+    nChars = (USHORT)min(nNumberOfCharsToWrite, CSRSS_MAX_WRITE_CONSOLE / CharSize);
     Request->Data.WriteConsoleRequest.NrCharactersToWrite = nChars;
 
     SizeBytes = nChars * CharSize;
     Request->Data.WriteConsoleRequest.NrCharactersToWrite = nChars;
 
     SizeBytes = nChars * CharSize;
@@ -1245,8 +1245,8 @@ IntReadConsole(HANDLE hConsoleInput,
 
     Request->Data.ReadConsoleRequest.ConsoleHandle = hConsoleInput;
     Request->Data.ReadConsoleRequest.Unicode = bUnicode;
 
     Request->Data.ReadConsoleRequest.ConsoleHandle = hConsoleInput;
     Request->Data.ReadConsoleRequest.Unicode = bUnicode;
-    Request->Data.ReadConsoleRequest.NrCharactersToRead = min(nNumberOfCharsToRead, CSRSS_MAX_READ_CONSOLE / CharSize);
-    Request->Data.ReadConsoleRequest.nCharsCanBeDeleted = CharsRead;
+    Request->Data.ReadConsoleRequest.NrCharactersToRead = (WORD)min(nNumberOfCharsToRead, CSRSS_MAX_READ_CONSOLE / CharSize);
+    Request->Data.ReadConsoleRequest.nCharsCanBeDeleted = (WORD)CharsRead;
     Status = CsrClientCallServer(Request,
                                  NULL,
                                  CsrRequest,
     Status = CsrClientCallServer(Request,
                                  NULL,
                                  CsrRequest,
@@ -1477,7 +1477,7 @@ IntFillConsoleOutputCharacter(HANDLE hConsoleOutput,
   else
     Request.Data.FillOutputRequest.Char.AsciiChar = *((CHAR*)cCharacter);
   Request.Data.FillOutputRequest.Position = dwWriteCoord;
   else
     Request.Data.FillOutputRequest.Char.AsciiChar = *((CHAR*)cCharacter);
   Request.Data.FillOutputRequest.Position = dwWriteCoord;
-  Request.Data.FillOutputRequest.Length = nLength;
+  Request.Data.FillOutputRequest.Length = (WORD)nLength;
   Status = CsrClientCallServer(&Request, NULL,
                                CsrRequest,
                                sizeof(CSR_API_MESSAGE));
   Status = CsrClientCallServer(&Request, NULL,
                                CsrRequest,
                                sizeof(CSR_API_MESSAGE));
@@ -2316,7 +2316,7 @@ IntWriteConsoleOutputCharacter(HANDLE hConsoleOutput,
 
     Request->Data.WriteConsoleOutputCharRequest.ConsoleHandle = hConsoleOutput;
     Request->Data.WriteConsoleOutputCharRequest.Unicode = bUnicode;
 
     Request->Data.WriteConsoleOutputCharRequest.ConsoleHandle = hConsoleOutput;
     Request->Data.WriteConsoleOutputCharRequest.Unicode = bUnicode;
-    Request->Data.WriteConsoleOutputCharRequest.Length = min(nLength, nChars);
+    Request->Data.WriteConsoleOutputCharRequest.Length = (WORD)min(nLength, nChars);
     BytesWrite = Request->Data.WriteConsoleOutputCharRequest.Length * CharSize;
 
     memcpy(Request->Data.WriteConsoleOutputCharRequest.String, lpCharacter, BytesWrite);
     BytesWrite = Request->Data.WriteConsoleOutputCharRequest.Length * CharSize;
 
     memcpy(Request->Data.WriteConsoleOutputCharRequest.String, lpCharacter, BytesWrite);
@@ -2430,7 +2430,7 @@ WriteConsoleOutputAttribute(
       *lpNumberOfAttrsWritten = nLength;
    while( nLength )
       {
       *lpNumberOfAttrsWritten = nLength;
    while( nLength )
       {
-        Size = min(nLength, CSRSS_MAX_WRITE_CONSOLE_OUTPUT_ATTRIB / sizeof(WORD));
+        Size = (WORD)min(nLength, CSRSS_MAX_WRITE_CONSOLE_OUTPUT_ATTRIB / sizeof(WORD));
          Request->Data.WriteConsoleOutputAttribRequest.ConsoleHandle = hConsoleOutput;
         Request->Data.WriteConsoleOutputAttribRequest.Length = Size;
          memcpy(Request->Data.WriteConsoleOutputAttribRequest.Attribute, lpAttribute, Size * sizeof(WORD));
          Request->Data.WriteConsoleOutputAttribRequest.ConsoleHandle = hConsoleOutput;
         Request->Data.WriteConsoleOutputAttribRequest.Length = Size;
          memcpy(Request->Data.WriteConsoleOutputAttribRequest.Attribute, lpAttribute, Size * sizeof(WORD));
@@ -2479,9 +2479,9 @@ FillConsoleOutputAttribute(
 
    CsrRequest = MAKE_CSR_API(FILL_OUTPUT_ATTRIB, CSR_CONSOLE);
    Request.Data.FillOutputAttribRequest.ConsoleHandle = hConsoleOutput;
 
    CsrRequest = MAKE_CSR_API(FILL_OUTPUT_ATTRIB, CSR_CONSOLE);
    Request.Data.FillOutputAttribRequest.ConsoleHandle = hConsoleOutput;
-   Request.Data.FillOutputAttribRequest.Attribute = wAttribute;
+   Request.Data.FillOutputAttribRequest.Attribute = (CHAR)wAttribute;
    Request.Data.FillOutputAttribRequest.Coord = dwWriteCoord;
    Request.Data.FillOutputAttribRequest.Coord = dwWriteCoord;
-   Request.Data.FillOutputAttribRequest.Length = nLength;
+   Request.Data.FillOutputAttribRequest.Length = (WORD)nLength;
    Status = CsrClientCallServer( &Request, NULL, CsrRequest, sizeof( CSR_API_MESSAGE ) );
    if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Request.Status ) )
       {
    Status = CsrClientCallServer( &Request, NULL, CsrRequest, sizeof( CSR_API_MESSAGE ) );
    if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Request.Status ) )
       {
@@ -2891,7 +2891,7 @@ SetConsoleTextAttribute(
 
    CsrRequest = MAKE_CSR_API(SET_ATTRIB, CSR_CONSOLE);
    Request.Data.SetAttribRequest.ConsoleHandle = hConsoleOutput;
 
    CsrRequest = MAKE_CSR_API(SET_ATTRIB, CSR_CONSOLE);
    Request.Data.SetAttribRequest.ConsoleHandle = hConsoleOutput;
-   Request.Data.SetAttribRequest.Attrib = wAttributes;
+   Request.Data.SetAttribRequest.Attrib = (CHAR)wAttributes;
    Status = CsrClientCallServer( &Request, NULL, CsrRequest, sizeof( CSR_API_MESSAGE ) );
    if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Request.Status ) )
       {
    Status = CsrClientCallServer( &Request, NULL, CsrRequest, sizeof( CSR_API_MESSAGE ) );
    if( !NT_SUCCESS( Status ) || !NT_SUCCESS( Status = Request.Status ) )
       {
@@ -2975,7 +2975,7 @@ BOOL WINAPI
 SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine,
                      BOOL Add)
 {
 SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine,
                      BOOL Add)
 {
-  BOOLEAN Ret;
+  BOOL Ret;
 
   RtlEnterCriticalSection(&DllLock);
   if (Add)
 
   RtlEnterCriticalSection(&DllLock);
   if (Add)
@@ -3652,7 +3652,7 @@ GetConsoleInputExeNameA(DWORD nBufferLength, LPSTR lpBuffer)
       RtlInitUnicodeString(&BufferU, Buffer);
 
       BufferA.Length = 0;
       RtlInitUnicodeString(&BufferU, Buffer);
 
       BufferA.Length = 0;
-      BufferA.MaximumLength = nBufferLength;
+      BufferA.MaximumLength = (USHORT)nBufferLength;
       BufferA.Buffer = lpBuffer;
 
       RtlUnicodeStringToAnsiString(&BufferA, &BufferU, FALSE);
       BufferA.Buffer = lpBuffer;
 
       RtlUnicodeStringToAnsiString(&BufferA, &BufferU, FALSE);
index 16f7fa5..e3ce2f4 100644 (file)
@@ -323,7 +323,7 @@ DllMain(HANDLE hDll,
             if (hDll == (HANDLE)0x7c800000)
             {
                 PULONG Eip;
             if (hDll == (HANDLE)0x7c800000)
             {
                 PULONG Eip;
-                Eip = (PULONG)*(PULONG)*(PULONG)NtCurrentTeb()->Tib.ExceptionList +
+                Eip = (PULONG)*(PULONG)NtCurrentTeb()->Tib.ExceptionList +
                        0x9 +
                        FIELD_OFFSET(CONTEXT, Eip) / sizeof(ULONG);
                 *Eip = (ULONG)BaseProcessStartThunk;
                        0x9 +
                        FIELD_OFFSET(CONTEXT, Eip) / sizeof(ULONG);
                 *Eip = (ULONG)BaseProcessStartThunk;
index 150c54f..5ecc235 100644 (file)
@@ -43,14 +43,14 @@ GetEnvironmentVariableA (
 
        /* initialize ansi variable value string */
        VarValue.Length = 0;
 
        /* initialize ansi variable value string */
        VarValue.Length = 0;
-       VarValue.MaximumLength = nSize;
+       VarValue.MaximumLength = (USHORT)nSize;
        VarValue.Buffer = lpBuffer;
 
        /* initialize unicode variable value string and allocate buffer */
        VarValueU.Length = 0;
        if (nSize != 0)
        {
        VarValue.Buffer = lpBuffer;
 
        /* initialize unicode variable value string and allocate buffer */
        VarValueU.Length = 0;
        if (nSize != 0)
        {
-           VarValueU.MaximumLength = (nSize - 1) * sizeof(WCHAR);
+           VarValueU.MaximumLength = (USHORT)(nSize - 1) * sizeof(WCHAR);
            VarValueU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                                0,
                                                nSize * sizeof(WCHAR));
            VarValueU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                                0,
                                                nSize * sizeof(WCHAR));
@@ -139,7 +139,7 @@ GetEnvironmentVariableW (
                              lpName);
 
        VarValue.Length = 0;
                              lpName);
 
        VarValue.Length = 0;
-       VarValue.MaximumLength = (nSize != 0 ? (nSize - 1) * sizeof(WCHAR) : 0);
+       VarValue.MaximumLength = (USHORT)(nSize != 0 ? (nSize - 1) * sizeof(WCHAR) : 0);
        VarValue.Buffer = lpBuffer;
 
        Status = RtlQueryEnvironmentVariable_U (NULL,
        VarValue.Buffer = lpBuffer;
 
        Status = RtlQueryEnvironmentVariable_U (NULL,
@@ -298,10 +298,10 @@ GetEnvironmentStringsA (
        DPRINT("EnvPtr %p\n", EnvPtr);
 
        /* convert unicode environment to ansi */
        DPRINT("EnvPtr %p\n", EnvPtr);
 
        /* convert unicode environment to ansi */
-       UnicodeString.MaximumLength = Length * sizeof(WCHAR) + sizeof(WCHAR);
+       UnicodeString.MaximumLength = (USHORT)Length * sizeof(WCHAR) + sizeof(WCHAR);
        UnicodeString.Buffer = EnvU;
 
        UnicodeString.Buffer = EnvU;
 
-       AnsiString.MaximumLength = Length + 1;
+       AnsiString.MaximumLength = (USHORT)Length + 1;
        AnsiString.Length = 0;
        AnsiString.Buffer = EnvPtr;
 
        AnsiString.Length = 0;
        AnsiString.Buffer = EnvPtr;
 
@@ -314,7 +314,7 @@ GetEnvironmentStringsA (
                if (UnicodeString.Length > 0)
                {
                        AnsiString.Length = 0;
                if (UnicodeString.Length > 0)
                {
                        AnsiString.Length = 0;
-                       AnsiString.MaximumLength = Length + 1 - (AnsiString.Buffer - EnvPtr);
+                       AnsiString.MaximumLength = (USHORT)Length + 1 - (AnsiString.Buffer - EnvPtr);
 
                        RtlUnicodeStringToAnsiString (&AnsiString,
                                                      &UnicodeString,
 
                        RtlUnicodeStringToAnsiString (&AnsiString,
                                                      &UnicodeString,
@@ -407,11 +407,11 @@ ExpandEnvironmentStringsA (
         }
 
        Destination.Length = 0;
         }
 
        Destination.Length = 0;
-       Destination.MaximumLength = nSize;
+       Destination.MaximumLength = (USHORT)nSize;
        Destination.Buffer = lpDst;
 
        DestinationU.Length = 0;
        Destination.Buffer = lpDst;
 
        DestinationU.Length = 0;
-       DestinationU.MaximumLength = nSize * sizeof(WCHAR);
+       DestinationU.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
        DestinationU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                               0,
                                               DestinationU.MaximumLength);
        DestinationU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                               0,
                                               DestinationU.MaximumLength);
@@ -473,7 +473,7 @@ ExpandEnvironmentStringsW (
                              (LPWSTR)lpSrc);
 
        Destination.Length = 0;
                              (LPWSTR)lpSrc);
 
        Destination.Length = 0;
-       Destination.MaximumLength = nSize * sizeof(WCHAR);
+       Destination.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
        Destination.Buffer = lpDst;
 
        Status = RtlExpandEnvironmentStrings_U (NULL,
        Destination.Buffer = lpDst;
 
        Status = RtlExpandEnvironmentStrings_U (NULL,
index 658a689..e9b6c33 100644 (file)
@@ -104,7 +104,7 @@ static LPSTR load_messageA( HMODULE module, UINT id, WORD lang )
         if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL;
         memcpy( buffer, mre->Text, len );
     }
         if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len ))) return NULL;
         memcpy( buffer, mre->Text, len );
     }
-    TRACE("returning %s\n", wine_dbgstr_a(buffer));
+    //TRACE("returning %s\n", wine_dbgstr_a(buffer));
     return buffer;
 }
 
     return buffer;
 }
 
@@ -135,7 +135,7 @@ static LPWSTR load_messageW( HMODULE module, UINT id, WORD lang )
         if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
         MultiByteToWideChar( CP_ACP, 0, (const char*)mre->Text, -1, buffer, len );
     }
         if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
         MultiByteToWideChar( CP_ACP, 0, (const char*)mre->Text, -1, buffer, len );
     }
-    TRACE("returning %s\n", wine_dbgstr_w(buffer));
+    //TRACE("returning %s\n", wine_dbgstr_w(buffer));
     return buffer;
 }
 
     return buffer;
 }
 
@@ -187,9 +187,9 @@ DWORD WINAPI FormatMessageA(
     else {
         from = NULL;
         if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
     else {
         from = NULL;
         if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
-            from = load_messageA( (HMODULE)lpSource, dwMessageId, dwLanguageId );
+            from = load_messageA( (HMODULE)lpSource, dwMessageId, (WORD)dwLanguageId );
         if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM))
         if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM))
-            from = load_messageA( kernel32_handle, dwMessageId, dwLanguageId );
+            from = load_messageA( kernel32_handle, dwMessageId, (WORD)dwLanguageId );
 
         if (!from)
         {
 
         if (!from)
         {
@@ -373,7 +373,7 @@ DWORD WINAPI FormatMessageA(
     if (nSize && talloced<nSize) {
         target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
     }
     if (nSize && talloced<nSize) {
         target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
     }
-    TRACE("-- %s\n",debugstr_a(target));
+    //TRACE("-- %s\n",debugstr_a(target));
     if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
         *((LPVOID*)lpBuffer) = (LPVOID)LocalAlloc(LMEM_ZEROINIT,max(nSize, talloced));
         memcpy(*(LPSTR*)lpBuffer,target,talloced);
     if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
         *((LPVOID*)lpBuffer) = (LPVOID)LocalAlloc(LMEM_ZEROINIT,max(nSize, talloced));
         memcpy(*(LPSTR*)lpBuffer,target,talloced);
@@ -439,9 +439,9 @@ DWORD WINAPI FormatMessageW(
     else {
         from = NULL;
         if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
     else {
         from = NULL;
         if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
-            from = load_messageW( (HMODULE)lpSource, dwMessageId, dwLanguageId );
+            from = load_messageW( (HMODULE)lpSource, dwMessageId, (WORD)dwLanguageId );
         if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM))
         if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM))
-            from = load_messageW( kernel32_handle, dwMessageId, dwLanguageId );
+            from = load_messageW( kernel32_handle, dwMessageId,(WORD)dwLanguageId );
 
         if (!from)
         {
 
         if (!from)
         {
@@ -636,8 +636,8 @@ DWORD WINAPI FormatMessageW(
 
     HeapFree(GetProcessHeap(),0,target);
     HeapFree(GetProcessHeap(),0,from);
 
     HeapFree(GetProcessHeap(),0,target);
     HeapFree(GetProcessHeap(),0,from);
-    TRACE("ret=%s\n", wine_dbgstr_w((dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
-        *(LPWSTR*)lpBuffer : lpBuffer));
+    //TRACE("ret=%s\n", wine_dbgstr_w((dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
+      //  *(LPWSTR*)lpBuffer : lpBuffer));
     return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
         strlenW(*(LPWSTR*)lpBuffer):
             strlenW(lpBuffer);
     return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
         strlenW(*(LPWSTR*)lpBuffer):
             strlenW(lpBuffer);
index 044735e..f339480 100644 (file)
@@ -23,8 +23,6 @@
 /* FIXME:  these are included in winnls.h, however including this file causes alot of
            conflicting type errors. */
 
 /* FIXME:  these are included in winnls.h, however including this file causes alot of
            conflicting type errors. */
 
-#define LOCALE_SYEARMONTH 0x1006
-#define LOCALE_IPAPERSIZE 0x100A
 #define LOCALE_RETURN_NUMBER 0x20000000
 #define LOCALE_USE_CP_ACP 0x40000000
 #define LOCALE_LOCALEINFOFLAGSMASK (LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP|LOCALE_RETURN_NUMBER)
 #define LOCALE_RETURN_NUMBER 0x20000000
 #define LOCALE_USE_CP_ACP 0x40000000
 #define LOCALE_LOCALEINFOFLAGSMASK (LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP|LOCALE_RETURN_NUMBER)
@@ -994,7 +992,7 @@ CompareStringW (
     }
     else
         Result = RtlCompareUnicodeString(
     }
     else
         Result = RtlCompareUnicodeString(
-                      &String1, &String2, dwCmpFlags & NORM_IGNORECASE);
+                      &String1, &String2, (BOOLEAN)(dwCmpFlags & NORM_IGNORECASE));
     
     
     if (Result) /* need to translate result */
     
     
     if (Result) /* need to translate result */
index cec0585..604a738 100644 (file)
@@ -85,7 +85,7 @@ static RTL_CRITICAL_SECTION_DEBUG NLS_FormatsCS_debug =
     0, 0, &NLS_FormatsCS,
     { &NLS_FormatsCS_debug.ProcessLocksList,
       &NLS_FormatsCS_debug.ProcessLocksList },
     0, 0, &NLS_FormatsCS,
     { &NLS_FormatsCS_debug.ProcessLocksList,
       &NLS_FormatsCS_debug.ProcessLocksList },
-      0, 0, { 0, (DWORD)(__FILE__ ": NLS_Formats") }
+      0, 0, 0, 0
 };
 static RTL_CRITICAL_SECTION NLS_FormatsCS = { &NLS_FormatsCS_debug, -1, 0, 0, 0, 0 };
 
 };
 static RTL_CRITICAL_SECTION NLS_FormatsCS = { &NLS_FormatsCS_debug, -1, 0, 0, 0, 0 };
 
index 90ae278..cb8f32d 100644 (file)
@@ -315,7 +315,7 @@ GetModuleFileNameA (
                        else
                        {
                                FileName.Length = 0;
                        else
                        {
                                FileName.Length = 0;
-                               FileName.MaximumLength = nSize * sizeof(WCHAR);
+                               FileName.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
                                FileName.Buffer = lpFilename;
 
                                /* convert unicode string to ansi (or oem) */
                                FileName.Buffer = lpFilename;
 
                                /* convert unicode string to ansi (or oem) */
@@ -383,7 +383,7 @@ GetModuleFileNameW (
                        else
                        {
                                FileName.Length = 0;
                        else
                        {
                                FileName.Length = 0;
-                               FileName.MaximumLength = nSize * sizeof(WCHAR);
+                               FileName.MaximumLength =(USHORT)nSize * sizeof(WCHAR);
                                FileName.Buffer = lpFilename;
 
                                RtlCopyUnicodeString (&FileName,
                                FileName.Buffer = lpFilename;
 
                                RtlCopyUnicodeString (&FileName,
@@ -680,7 +680,8 @@ LoadModule (
   HeapFree(GetProcessHeap(), 0, CommandLine);
 
   /* Wait up to 15 seconds for the process to become idle */
   HeapFree(GetProcessHeap(), 0, CommandLine);
 
   /* Wait up to 15 seconds for the process to become idle */
-  WaitForInputIdle(ProcessInformation.hProcess, 15000);
+  /* FIXME: This is user32! Windows soft-loads this only if required. */
+  //WaitForInputIdle(ProcessInformation.hProcess, 15000);
 
   CloseHandle(ProcessInformation.hThread);
   CloseHandle(ProcessInformation.hProcess);
 
   CloseHandle(ProcessInformation.hThread);
   CloseHandle(ProcessInformation.hProcess);
index 597a724..1348729 100644 (file)
@@ -266,9 +266,9 @@ INT WINAPI GetExpandedNameA( LPSTR in, LPSTR out )
        }
        if (isalpha(head.lastchar)) {
                if (fnislowercased)
        }
        if (isalpha(head.lastchar)) {
                if (fnislowercased)
-                       head.lastchar=tolower(head.lastchar);
+                       head.lastchar=(CHAR)tolower(head.lastchar);
                else
                else
-                       head.lastchar=toupper(head.lastchar);
+                       head.lastchar=(CHAR)toupper(head.lastchar);
        }
 
        /* now look where to replace the last character */
        }
 
        /* now look where to replace the last character */
index 6da2816..f3045d4 100644 (file)
@@ -489,7 +489,7 @@ IntWideCharToMultiByteUTF8(UINT CodePage, DWORD Flags,
             break;
          }
          TempLength--;
             break;
          }
          TempLength--;
-         *MultiByteString++ = Char;
+         *MultiByteString++ = (CHAR)Char;
          continue;
       }
 
          continue;
       }
 
index b8a06d2..c9ec937 100644 (file)
@@ -76,7 +76,7 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
 {
     0, 0, &PROFILE_CritSect,
     { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
 {
     0, 0, &PROFILE_CritSect,
     { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
-      0, 0, { 0, (DWORD)(__FILE__ ": PROFILE_CritSect") }
+      0, 0, 0, 0
 };
 static RTL_CRITICAL_SECTION PROFILE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 };
 
 };
 static RTL_CRITICAL_SECTION PROFILE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 };
 
@@ -121,7 +121,7 @@ static void PROFILE_CopyEntry( LPWSTR buffer, LPCWSTR value, int len,
     }
 
     lstrcpynW( buffer, value, len );
     }
 
     lstrcpynW( buffer, value, len );
-    if (quote && (len >= wcslen(value))) buffer[wcslen(buffer)-1] = '\0';
+    if (quote && (len >= (int)wcslen(value))) buffer[wcslen(buffer)-1] = '\0';
 }
 
 
 }
 
 
index 55e3248..bff53b7 100644 (file)
@@ -199,7 +199,7 @@ BasepConvertUnicodeEnvironment(OUT SIZE_T* EnvSize,
     else
     {
 
     else
     {
 
-        AnsiEnv.Length = (ULONG_PTR)pcScan - (ULONG_PTR)lpEnvironment + sizeof(CHAR);
+        AnsiEnv.Length = (USHORT)((ULONG_PTR)pcScan - (ULONG_PTR)lpEnvironment + sizeof(CHAR));
     }
     AnsiEnv.MaximumLength = AnsiEnv.Length + 1;
     
     }
     AnsiEnv.MaximumLength = AnsiEnv.Length + 1;
     
@@ -221,7 +221,7 @@ BasepConvertUnicodeEnvironment(OUT SIZE_T* EnvSize,
     }
         
     /* Use the allocated size */
     }
         
     /* Use the allocated size */
-    UnicodeEnv.MaximumLength = *EnvSize;
+    UnicodeEnv.MaximumLength = (USHORT)*EnvSize;
     
     /* Convert */
     RtlAnsiStringToUnicodeString(&UnicodeEnv, &AnsiEnv, FALSE);
     
     /* Convert */
     RtlAnsiStringToUnicodeString(&UnicodeEnv, &AnsiEnv, FALSE);
@@ -754,7 +754,7 @@ CreateProcessInternalW(HANDLE hToken,
 
     /* Easy stuff first, convert the process priority class */
     PriorityClass.Foreground = FALSE;
 
     /* Easy stuff first, convert the process priority class */
     PriorityClass.Foreground = FALSE;
-    PriorityClass.PriorityClass = BasepConvertPriorityClass(dwCreationFlags);
+    PriorityClass.PriorityClass = (UCHAR)BasepConvertPriorityClass(dwCreationFlags);
 
     if (lpCommandLine)
     {
 
     if (lpCommandLine)
     {
@@ -1158,7 +1158,7 @@ GetAppName:
                              PROCESS_ALL_ACCESS,
                              ObjectAttributes,
                              NtCurrentProcess(),
                              PROCESS_ALL_ACCESS,
                              ObjectAttributes,
                              NtCurrentProcess(),
-                             bInheritHandles,
+                             (BOOLEAN)bInheritHandles,
                              hSection,
                              hDebug,
                              NULL);
                              hSection,
                              hDebug,
                              NULL);
index b32acdf..bbfa599 100644 (file)
@@ -376,7 +376,7 @@ WinExec(LPCSTR lpCmdLine,
 
    RtlZeroMemory(&StartupInfo, sizeof(StartupInfo));
    StartupInfo.cb = sizeof(STARTUPINFOA);
 
    RtlZeroMemory(&StartupInfo, sizeof(StartupInfo));
    StartupInfo.cb = sizeof(STARTUPINFOA);
-   StartupInfo.wShowWindow = uCmdShow;
+   StartupInfo.wShowWindow = (WORD)uCmdShow;
    StartupInfo.dwFlags = 0;
 
    if (! CreateProcessA(NULL,
    StartupInfo.dwFlags = 0;
 
    if (! CreateProcessA(NULL,
@@ -419,20 +419,6 @@ RegisterWaitForInputIdle (
        return;
 }
 
        return;
 }
 
-
-/*
- * @unimplemented
- */
-DWORD STDCALL
-WaitForInputIdle (
-       HANDLE  hProcess,
-       DWORD   dwMilliseconds
-       )
-{
-       return 0;
-}
-
-
 /*
  * @implemented
  */
 /*
  * @implemented
  */
@@ -460,7 +446,7 @@ GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo)
   lpStartupInfo->dwYCountChars = Params->CountCharsY;
   lpStartupInfo->dwFillAttribute = Params->FillAttribute;
   lpStartupInfo->dwFlags = Params->WindowFlags;
   lpStartupInfo->dwYCountChars = Params->CountCharsY;
   lpStartupInfo->dwFillAttribute = Params->FillAttribute;
   lpStartupInfo->dwFlags = Params->WindowFlags;
-  lpStartupInfo->wShowWindow = Params->ShowWindowFlags;
+  lpStartupInfo->wShowWindow = (WORD)Params->ShowWindowFlags;
   lpStartupInfo->cbReserved2 = Params->RuntimeData.Length;
   lpStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeData.Buffer;
   
   lpStartupInfo->cbReserved2 = Params->RuntimeData.Length;
   lpStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeData.Buffer;
   
@@ -531,7 +517,7 @@ GetStartupInfoA(LPSTARTUPINFOA lpStartupInfo)
        lpLocalStartupInfo->dwYCountChars = Params->CountCharsY;
        lpLocalStartupInfo->dwFillAttribute = Params->FillAttribute;
        lpLocalStartupInfo->dwFlags = Params->WindowFlags;
        lpLocalStartupInfo->dwYCountChars = Params->CountCharsY;
        lpLocalStartupInfo->dwFillAttribute = Params->FillAttribute;
        lpLocalStartupInfo->dwFlags = Params->WindowFlags;
-       lpLocalStartupInfo->wShowWindow = Params->ShowWindowFlags;
+       lpLocalStartupInfo->wShowWindow = (WORD)Params->ShowWindowFlags;
        lpLocalStartupInfo->cbReserved2 = Params->RuntimeData.Length;
        lpLocalStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeData.Buffer;
 
        lpLocalStartupInfo->cbReserved2 = Params->RuntimeData.Length;
        lpLocalStartupInfo->lpReserved2 = (LPBYTE)Params->RuntimeData.Buffer;
 
index eb9070a..6bb9435 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <k32.h>
 
 
 #include <k32.h>
 
-
 static _SEH_FILTER(lstr_page_fault)
 {
     if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
 static _SEH_FILTER(lstr_page_fault)
 {
     if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
@@ -72,7 +71,6 @@ lstrcmpiA(
    return Result;
 }
 
    return Result;
 }
 
-
 /*
  * @implemented
  */
 /*
  * @implemented
  */
index 7d1af63..f5de7c0 100644 (file)
@@ -38,7 +38,7 @@ SleepConditionVariableCS(IN OUT PCONDITION_VARIABLE ConditionVariable,
                          IN OUT PCRITICAL_SECTION CriticalSection,
                          IN DWORD dwMilliseconds)
 {
                          IN OUT PCRITICAL_SECTION CriticalSection,
                          IN DWORD dwMilliseconds)
 {
-    NTSTATUS Status;
+    NTSTATUS Status = 0;
     LARGE_INTEGER TimeOut;
     PLARGE_INTEGER TimeOutPtr = NULL;
 
     LARGE_INTEGER TimeOut;
     PLARGE_INTEGER TimeOutPtr = NULL;
 
@@ -48,10 +48,11 @@ SleepConditionVariableCS(IN OUT PCONDITION_VARIABLE ConditionVariable,
         TimeOutPtr = &TimeOut;
     }
 
         TimeOutPtr = &TimeOut;
     }
 
+#if 0
     Status = RtlSleepConditionVariableCS((PRTL_CONDITION_VARIABLE)ConditionVariable,
                                          (PRTL_CRITICAL_SECTION)CriticalSection,
                                          TimeOutPtr);
     Status = RtlSleepConditionVariableCS((PRTL_CONDITION_VARIABLE)ConditionVariable,
                                          (PRTL_CRITICAL_SECTION)CriticalSection,
                                          TimeOutPtr);
-
+#endif
     if (!NT_SUCCESS(Status))
     {
         SetLastErrorByStatus(Status);
     if (!NT_SUCCESS(Status))
     {
         SetLastErrorByStatus(Status);
@@ -72,7 +73,7 @@ SleepConditionVariableSRW(IN OUT PCONDITION_VARIABLE ConditionVariable,
                           IN DWORD dwMilliseconds,
                           IN ULONG Flags)
 {
                           IN DWORD dwMilliseconds,
                           IN ULONG Flags)
 {
-    NTSTATUS Status;
+    NTSTATUS Status = 0;
     LARGE_INTEGER TimeOut;
     PLARGE_INTEGER TimeOutPtr = NULL;
 
     LARGE_INTEGER TimeOut;
     PLARGE_INTEGER TimeOutPtr = NULL;
 
@@ -82,11 +83,12 @@ SleepConditionVariableSRW(IN OUT PCONDITION_VARIABLE ConditionVariable,
         TimeOutPtr = &TimeOut;
     }
 
         TimeOutPtr = &TimeOut;
     }
 
+#if 0
     Status = RtlSleepConditionVariableSRW((PRTL_CONDITION_VARIABLE)ConditionVariable,
                                           (PRTL_SRWLOCK)SRWLock,
                                           TimeOutPtr,
                                           Flags);
     Status = RtlSleepConditionVariableSRW((PRTL_CONDITION_VARIABLE)ConditionVariable,
                                           (PRTL_SRWLOCK)SRWLock,
                                           TimeOutPtr,
                                           Flags);
-
+#endif
     if (!NT_SUCCESS(Status))
     {
         SetLastErrorByStatus(Status);
     if (!NT_SUCCESS(Status))
     {
         SetLastErrorByStatus(Status);
index 831f4fe..4170eea 100644 (file)
@@ -9,8 +9,8 @@
 /* INCLUDES *****************************************************************/
 
 /* File contains Vista Semantics */
 /* INCLUDES *****************************************************************/
 
 /* File contains Vista Semantics */
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0600
+//#undef _WIN32_WINNT
+//#define _WIN32_WINNT 0x0600
 
 #include <k32.h>
 
 
 #include <k32.h>
 
@@ -269,7 +269,7 @@ SetWaitableTimer(IN HANDLE hTimer,
                         (PLARGE_INTEGER)pDueTime,
                         (PTIMER_APC_ROUTINE)pfnCompletionRoutine,
                         lpArgToCompletionRoutine,
                         (PLARGE_INTEGER)pDueTime,
                         (PTIMER_APC_ROUTINE)pfnCompletionRoutine,
                         lpArgToCompletionRoutine,
-                        fResume,
+                        (BOOLEAN)fResume,
                         lPeriod,
                         NULL);
     if (NT_SUCCESS(Status)) return TRUE;
                         lPeriod,
                         NULL);
     if (NT_SUCCESS(Status)) return TRUE;
index f8e0c10..c10db83 100644 (file)
@@ -838,7 +838,7 @@ SleepEx(DWORD dwMilliseconds,
        * System time units are 100 nanoseconds (a nanosecond is a billionth of
        * a second).
        */
        * System time units are 100 nanoseconds (a nanosecond is a billionth of
        * a second).
        */
-      Interval.QuadPart = -((ULONGLONG)dwMilliseconds * 10000);
+      Interval.QuadPart = -((LONGLONG)dwMilliseconds * 10000);
     }
   else
     {
     }
   else
     {
@@ -847,7 +847,7 @@ SleepEx(DWORD dwMilliseconds,
     }
 
 dowait:
     }
 
 dowait:
-  errCode = NtDelayExecution (bAlertable, &Interval);
+  errCode = NtDelayExecution ((BOOLEAN)bAlertable, &Interval);
   if ((bAlertable) && (errCode == STATUS_ALERTED)) goto dowait;
   return (errCode == STATUS_USER_APC) ? WAIT_IO_COMPLETION : 0;
 }
   if ((bAlertable) && (errCode == STATUS_ALERTED)) goto dowait;
   return (errCode == STATUS_USER_APC) ? WAIT_IO_COMPLETION : 0;
 }
@@ -865,7 +865,7 @@ InternalWorkItemTrampoline(PVOID Context)
 {
     QUEUE_USER_WORKITEM_CONTEXT Info;
 
 {
     QUEUE_USER_WORKITEM_CONTEXT Info;
 
-    ASSERT(Context != NULL);
+    ASSERT(Context);
 
     /* Save the context to the stack */
     Info = *(volatile QUEUE_USER_WORKITEM_CONTEXT *)Context;
 
     /* Save the context to the stack */
     Info = *(volatile QUEUE_USER_WORKITEM_CONTEXT *)Context;
index a6cc9fb..faaa0ab 100644 (file)
@@ -2669,7 +2669,9 @@ typedef struct _RTL_CRITICAL_SECTION_DEBUG {
        LIST_ENTRY ProcessLocksList;
        DWORD EntryCount;
        DWORD ContentionCount;
        LIST_ENTRY ProcessLocksList;
        DWORD EntryCount;
        DWORD ContentionCount;
-       DWORD Spare[2];
+    DWORD Flags;
+    WORD CreatorBackTraceIndexHigh;
+    WORD SpareWORD;
 } RTL_CRITICAL_SECTION_DEBUG,*PRTL_CRITICAL_SECTION_DEBUG;
 typedef struct _RTL_CRITICAL_SECTION {
        PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
 } RTL_CRITICAL_SECTION_DEBUG,*PRTL_CRITICAL_SECTION_DEBUG;
 typedef struct _RTL_CRITICAL_SECTION {
        PRTL_CRITICAL_SECTION_DEBUG DebugInfo;