[ros-diffs] [ion] 25633: - Fix definition of RTL_CRITICAL_SECTION_DEBUG. - 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.

ion at svn.reactos.org ion at svn.reactos.org
Fri Jan 26 08:22:21 CET 2007


Author: ion
Date: Fri Jan 26 10:22:19 2007
New Revision: 25633

URL: http://svn.reactos.org/svn/reactos?rev=25633&view=rev
Log:
- Fix definition of RTL_CRITICAL_SECTION_DEBUG.
- 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.

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

Modified: trunk/reactos/dll/win32/kernel32/file/cnotify.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/cnotify.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/cnotify.c (original)
+++ trunk/reactos/dll/win32/kernel32/file/cnotify.c Fri Jan 26 10:22:19 2007
@@ -119,7 +119,7 @@
                                         NULL,//Buffer,
                                         0,//BufferLength,
                                         dwNotifyFilter,
-                                        bWatchSubtree);
+                                        (BOOLEAN)bWatchSubtree);
    if (!NT_SUCCESS(Status))
    {
       SetLastErrorByStatus(Status);
@@ -200,7 +200,7 @@
       lpBuffer,
       nBufferLength,
       dwNotifyFilter,
-      bWatchSubtree
+      (BOOLEAN)bWatchSubtree
       );
 
    if (!NT_SUCCESS(Status))

Modified: trunk/reactos/dll/win32/kernel32/file/dir.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/dir.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/dir.c (original)
+++ trunk/reactos/dll/win32/kernel32/file/dir.c Fri Jan 26 10:22:19 2007
@@ -781,7 +781,7 @@
             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;
@@ -889,7 +889,7 @@
                     goto Cleanup;
         }
 
-        BufferU.MaximumLength = nBufferLength * sizeof(WCHAR);
+        BufferU.MaximumLength = (USHORT)nBufferLength * sizeof(WCHAR);
         BufferU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
                                           0,
                                           BufferU.MaximumLength);
@@ -899,7 +899,7 @@
             goto Cleanup;
         }
 
-        Buffer.MaximumLength = nBufferLength;
+        Buffer.MaximumLength = (USHORT)nBufferLength;
         Buffer.Buffer = lpBuffer;
 
         RetValue = SearchPathW (NULL == lpPath ? NULL : PathU.Buffer,

Modified: trunk/reactos/dll/win32/kernel32/file/dosdev.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/dosdev.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/dosdev.c (original)
+++ trunk/reactos/dll/win32/kernel32/file/dosdev.c Fri Jan 26 10:22:19 2007
@@ -135,10 +135,10 @@
     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.MaximumLength = CurrentLength;
+      TargetPathA.MaximumLength = (USHORT)CurrentLength;
 
       RtlUnicodeStringToAnsiString (&TargetPathA,
 				    &TargetPathU,

Modified: trunk/reactos/dll/win32/kernel32/file/file.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/file.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/file.c (original)
+++ trunk/reactos/dll/win32/kernel32/file/file.c Fri Jan 26 10:22:19 2007
@@ -38,16 +38,16 @@
    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)
-        Status= RtlAnsiStringToUnicodeString( pstrW, &str, alloc );
+        Status= RtlAnsiStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc );
    else
-        Status= RtlOemStringToUnicodeString( pstrW, &str, alloc );
+        Status= RtlOemStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc );
 
     if (NT_SUCCESS(Status))
        return pstrW->Buffer;
@@ -85,7 +85,7 @@
       ANSI_STRING str;
 
       str.Buffer = DestA;
-      str.MaximumLength = destLen;
+      str.MaximumLength = (USHORT)destLen;
 
 
       if (bIsFileApiAnsi)
@@ -337,7 +337,7 @@
                     0,
                     FileNameString.Buffer);
 
-	lpReOpenBuff->nErrCode = RtlNtStatusToDosError(errCode);
+	lpReOpenBuff->nErrCode = (WORD)RtlNtStatusToDosError(errCode);
 
 	if (!NT_SUCCESS(errCode))
 	{
@@ -1541,7 +1541,7 @@
     if(lpOemName != NULL)
     {
       AnsiName.Buffer = lpOemName;
-      AnsiName.MaximumLength = OemNameSize * sizeof(CHAR);
+      AnsiName.MaximumLength = (USHORT)OemNameSize * sizeof(CHAR);
       AnsiName.Length = 0;
     }
 
@@ -1583,7 +1583,7 @@
     if(lpOemName != NULL)
     {
       AnsiName.Buffer = lpOemName;
-      AnsiName.MaximumLength = OemNameSize * sizeof(CHAR);
+      AnsiName.MaximumLength = (USHORT)OemNameSize * sizeof(CHAR);
       AnsiName.Length = 0;
     }
 
@@ -1628,7 +1628,7 @@
         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);

Modified: trunk/reactos/dll/win32/kernel32/file/find.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/find.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/find.c (original)
+++ trunk/reactos/dll/win32/kernel32/file/find.c Fri Jan 26 10:22:19 2007
@@ -95,7 +95,7 @@
     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);
@@ -213,7 +213,7 @@
 	PWSTR SearchPath;
 	PWCHAR SearchPattern;
 	ULONG Length;
-	BOOLEAN bResult;
+	BOOL bResult;
 
 	DPRINT("FindFirstFileW(lpFileName %S)\n",
 	       lpFileName);
@@ -698,7 +698,7 @@
 InternalCopyStreamInfo(IN OUT PKERNEL32_FIND_STREAM_DATA IData,
                        OUT LPVOID lpFindStreamData)
 {
-    ASSERT(IData->pCurrent != NULL);
+    ASSERT(IData->pCurrent);
 
     switch (IData->InfoLevel)
     {

Modified: trunk/reactos/dll/win32/kernel32/file/lock.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/lock.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/lock.c (original)
+++ trunk/reactos/dll/win32/kernel32/file/lock.c Fri Jan 26 10:22:19 2007
@@ -98,8 +98,8 @@
 			&Offset,
 			&BytesToLock,
 			0,
-			LockImmediate,
-			LockExclusive);
+			(BOOLEAN)LockImmediate,
+			(BOOLEAN)LockExclusive);
    if ( !NT_SUCCESS(errCode) )
      {
       SetLastErrorByStatus (errCode);

Modified: trunk/reactos/dll/win32/kernel32/file/npipe.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/npipe.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/npipe.c (original)
+++ trunk/reactos/dll/win32/kernel32/file/npipe.c Fri Jan 26 10:22:19 2007
@@ -919,7 +919,7 @@
 
   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)
     {
@@ -929,7 +929,7 @@
 
     UserNameA.Buffer = lpUserName;
     UserNameA.Length = 0;
-    UserNameA.MaximumLength = nMaxUserNameSize;
+    UserNameA.MaximumLength = (USHORT)nMaxUserNameSize;
   }
 
   Ret = GetNamedPipeHandleStateW(hNamedPipe,

Modified: trunk/reactos/dll/win32/kernel32/file/volume.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/volume.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/volume.c (original)
+++ trunk/reactos/dll/win32/kernel32/file/volume.c Fri Jan 26 10:22:19 2007
@@ -106,7 +106,7 @@
 	for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
 	  if (dwDriveMap & (1<<drive))
 	  {
-	     *p++ = 'A' + drive;
+	     *p++ = 'A' + (UCHAR)drive;
 	     *p++ = ':';
 	     *p++ = '\\';
 	     *p++ = '\0';
@@ -464,7 +464,7 @@
 
   if (lpVolumeNameBuffer)
     {
-      VolumeNameU.MaximumLength = nVolumeNameSize * sizeof(WCHAR);
+      VolumeNameU.MaximumLength = (USHORT)nVolumeNameSize * sizeof(WCHAR);
       VolumeNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
 	                                    0,
 	                                    VolumeNameU.MaximumLength);
@@ -477,7 +477,7 @@
   if (lpFileSystemNameBuffer)
     {
       FileSystemNameU.Length = 0;
-      FileSystemNameU.MaximumLength = nFileSystemNameSize * sizeof(WCHAR);
+      FileSystemNameU.MaximumLength = (USHORT)nFileSystemNameSize * sizeof(WCHAR);
       FileSystemNameU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
 	                                        0,
 	                                        FileSystemNameU.MaximumLength);
@@ -511,7 +511,7 @@
         {
           VolumeNameU.Length = wcslen(VolumeNameU.Buffer) * sizeof(WCHAR);
 	  VolumeName.Length = 0;
-	  VolumeName.MaximumLength = nVolumeNameSize;
+	  VolumeName.MaximumLength = (USHORT)nVolumeNameSize;
 	  VolumeName.Buffer = lpVolumeNameBuffer;
 	}
 
@@ -519,7 +519,7 @@
 	{
 	  FileSystemNameU.Length = wcslen(FileSystemNameU.Buffer) * sizeof(WCHAR);
 	  FileSystemName.Length = 0;
-	  FileSystemName.MaximumLength = nFileSystemNameSize;
+	  FileSystemName.MaximumLength = (USHORT)nFileSystemNameSize;
 	  FileSystemName.Buffer = lpFileSystemNameBuffer;
 	}
 

Modified: trunk/reactos/dll/win32/kernel32/include/debug.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include/debug.h?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/include/debug.h (original)
+++ trunk/reactos/dll/win32/kernel32/include/debug.h Fri Jan 26 10:22:19 2007
@@ -10,19 +10,15 @@
 #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);
+#endif
+
 #ifdef ASSERT
 #undef ASSERT
-#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);
 

Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include/kernel32.h?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/include/kernel32.h (original)
+++ trunk/reactos/dll/win32/kernel32/include/kernel32.h Fri Jan 26 10:22:19 2007
@@ -105,11 +105,11 @@
                 
 VOID
 STDCALL
-BaseThreadStartupThunk();
+BaseThreadStartupThunk(VOID);
 
 VOID
 STDCALL
-BaseProcessStartThunk();
+BaseProcessStartThunk(VOID);
         
 __declspec(noreturn)
 VOID

Modified: trunk/reactos/dll/win32/kernel32/k32.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/k32.h?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/k32.h (original)
+++ trunk/reactos/dll/win32/kernel32/k32.h Fri Jan 26 10:22:19 2007
@@ -12,8 +12,8 @@
 /* INCLUDES ******************************************************************/
 
 /* PSDK/NDK Headers */
+#define DBG 1
 #define WIN32_NO_STATUS
-#define NTOS_MODE_USER
 #define _KERNEL32_
 #include <windows.h>
 #include <tlhelp32.h>
@@ -29,7 +29,6 @@
 
 /* DDK Driver Headers */
 #include <ntddbeep.h>
-#include <ntddser.h>
 #include <mountmgr.h>
 #include <mountdev.h>
 

Modified: trunk/reactos/dll/win32/kernel32/kernel32.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel32.rbuild?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/kernel32.rbuild (original)
+++ trunk/reactos/dll/win32/kernel32/kernel32.rbuild Fri Jan 26 10:22:19 2007
@@ -5,15 +5,10 @@
 	<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="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>
--->
 	<directory name="debug">
 		<file>debugger.c</file>
 		<file>output.c</file>

Modified: trunk/reactos/dll/win32/kernel32/mem/global.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/global.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/mem/global.c (original)
+++ trunk/reactos/dll/win32/kernel32/mem/global.c Fri Jan 26 10:22:19 2007
@@ -914,12 +914,12 @@
         /* 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;
     }
 }
 

Modified: trunk/reactos/dll/win32/kernel32/mem/heap.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/heap.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/mem/heap.c (original)
+++ trunk/reactos/dll/win32/kernel32/mem/heap.c Fri Jan 26 10:22:19 2007
@@ -157,8 +157,8 @@
 {
     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 */
@@ -185,7 +185,7 @@
     return RtlQueryTagHeap(hHeap,
                            dwFlags,
                            wTagIndex,
-                           bResetCounters,
+                           (BOOLEAN)bResetCounters,
                            lpTagInfo);
 }
 
@@ -204,8 +204,8 @@
     /* 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 */
@@ -231,8 +231,8 @@
 {
     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 */

Modified: trunk/reactos/dll/win32/kernel32/misc/actctx.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/actctx.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/actctx.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/actctx.c Fri Jan 26 10:22:19 2007
@@ -40,10 +40,10 @@
     }
 
     /* Call the Unicode function */
-    bRetVal = FindActCtxSectionStringA(dwFlags, 
+    bRetVal = FindActCtxSectionStringW(dwFlags, 
                                         lpExtensionGuid,
                                         ulSectionId, 
-                                        lpStringToFind,
+                                        lpStringToFindW,
                                         ReturnedData);
 
     /* Clean up */

Modified: trunk/reactos/dll/win32/kernel32/misc/comm.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/comm.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/comm.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/comm.c Fri Jan 26 10:22:19 2007
@@ -21,6 +21,24 @@
  */
 
 #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"
@@ -331,7 +349,7 @@
         return FALSE;
 
     /* success */
-    Dcb->ByteSize = nValue;
+    Dcb->ByteSize = (BYTE)nValue;
     return TRUE;
 }
 
@@ -442,7 +460,7 @@
         return FALSE;
 
     /* success */
-    Dcb->Parity = nValue;
+    Dcb->Parity = (BYTE)nValue;
     return TRUE;
 }
 
@@ -503,7 +521,7 @@
     *StopBitsSet = TRUE;
 
     /* success */
-    Dcb->StopBits = nValue;
+    Dcb->StopBits = (BYTE)nValue;
     return TRUE;
 }
 
@@ -1112,8 +1130,8 @@
     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);

Modified: trunk/reactos/dll/win32/kernel32/misc/computername.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/computername.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/computername.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/computername.c Fri Jan 26 10:22:19 2007
@@ -144,7 +144,7 @@
 
     case ComputerNameDnsFullyQualified:
         ResultString.Length = 0;
-        ResultString.MaximumLength = *nSize * sizeof(WCHAR);
+        ResultString.MaximumLength = (USHORT)*nSize * sizeof(WCHAR);
         ResultString.Buffer = lpBuffer;
 
         RtlZeroMemory(QueryTable, sizeof(QueryTable));
@@ -238,15 +238,15 @@
 	return ERROR_OUTOFMEMORY;
     }
 
-    AnsiString.MaximumLength = *nSize;
+    AnsiString.MaximumLength = (USHORT)*nSize;
     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,

Modified: trunk/reactos/dll/win32/kernel32/misc/console.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/console.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/console.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/console.c Fri Jan 26 10:22:19 2007
@@ -483,7 +483,7 @@
 /*
  * @unimplemented
  */
-DWORD STDCALL
+INT STDCALL
 GetConsoleDisplayMode (LPDWORD lpdwMode)
      /*
       * FUNCTION: Get the console display mode
@@ -592,7 +592,7 @@
 /*
  * @unimplemented
  */
-DWORD STDCALL
+INT STDCALL
 GetCurrentConsoleFont(HANDLE hConsoleOutput,
 		      BOOL bMaximumWindow,
 		      PCONSOLE_FONT_INFO lpConsoleCurrentFont)
@@ -1126,7 +1126,7 @@
     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;
@@ -1245,8 +1245,8 @@
 
     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,
@@ -1477,7 +1477,7 @@
   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));
@@ -2316,7 +2316,7 @@
 
     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);
@@ -2430,7 +2430,7 @@
       *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));
@@ -2479,9 +2479,9 @@
 
    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.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 ) )
       {
@@ -2891,7 +2891,7 @@
 
    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 ) )
       {
@@ -2975,7 +2975,7 @@
 SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine,
 		      BOOL Add)
 {
-  BOOLEAN Ret;
+  BOOL Ret;
 
   RtlEnterCriticalSection(&DllLock);
   if (Add)
@@ -3652,7 +3652,7 @@
       RtlInitUnicodeString(&BufferU, Buffer);
 
       BufferA.Length = 0;
-      BufferA.MaximumLength = nBufferLength;
+      BufferA.MaximumLength = (USHORT)nBufferLength;
       BufferA.Buffer = lpBuffer;
 
       RtlUnicodeStringToAnsiString(&BufferA, &BufferU, FALSE);

Modified: trunk/reactos/dll/win32/kernel32/misc/dllmain.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/dllmain.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/dllmain.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/dllmain.c Fri Jan 26 10:22:19 2007
@@ -323,7 +323,7 @@
             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;

Modified: trunk/reactos/dll/win32/kernel32/misc/env.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/env.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/env.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/env.c Fri Jan 26 10:22:19 2007
@@ -43,14 +43,14 @@
 
 	/* 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)
 	{
-	    VarValueU.MaximumLength = (nSize - 1) * sizeof(WCHAR);
+	    VarValueU.MaximumLength = (USHORT)(nSize - 1) * sizeof(WCHAR);
 	    VarValueU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
 	                                        0,
 	                                        nSize * sizeof(WCHAR));
@@ -139,7 +139,7 @@
 	                      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,
@@ -298,10 +298,10 @@
 	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;
 
-	AnsiString.MaximumLength = Length + 1;
+	AnsiString.MaximumLength = (USHORT)Length + 1;
 	AnsiString.Length = 0;
 	AnsiString.Buffer = EnvPtr;
 
@@ -314,7 +314,7 @@
 		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,
@@ -407,11 +407,11 @@
         }
 
 	Destination.Length = 0;
-	Destination.MaximumLength = nSize;
+	Destination.MaximumLength = (USHORT)nSize;
 	Destination.Buffer = lpDst;
 
 	DestinationU.Length = 0;
-	DestinationU.MaximumLength = nSize * sizeof(WCHAR);
+	DestinationU.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
 	DestinationU.Buffer = RtlAllocateHeap (RtlGetProcessHeap (),
 	                                       0,
 	                                       DestinationU.MaximumLength);
@@ -473,7 +473,7 @@
 	                      (LPWSTR)lpSrc);
 
 	Destination.Length = 0;
-	Destination.MaximumLength = nSize * sizeof(WCHAR);
+	Destination.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
 	Destination.Buffer = lpDst;
 
 	Status = RtlExpandEnvironmentStrings_U (NULL,

Modified: trunk/reactos/dll/win32/kernel32/misc/errormsg.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/errormsg.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/errormsg.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/errormsg.c Fri Jan 26 10:22:19 2007
@@ -104,7 +104,7 @@
         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;
 }
 
@@ -135,7 +135,7 @@
         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;
 }
 
@@ -187,9 +187,9 @@
     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))
-            from = load_messageA( kernel32_handle, dwMessageId, dwLanguageId );
+            from = load_messageA( kernel32_handle, dwMessageId, (WORD)dwLanguageId );
 
         if (!from)
         {
@@ -373,7 +373,7 @@
     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);
@@ -439,9 +439,9 @@
     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))
-            from = load_messageW( kernel32_handle, dwMessageId, dwLanguageId );
+            from = load_messageW( kernel32_handle, dwMessageId,(WORD)dwLanguageId );
 
         if (!from)
         {
@@ -636,8 +636,8 @@
 
     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);

Modified: trunk/reactos/dll/win32/kernel32/misc/lang.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/lang.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/lang.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/lang.c Fri Jan 26 10:22:19 2007
@@ -23,8 +23,6 @@
 /* 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)
@@ -994,7 +992,7 @@
     }
     else
         Result = RtlCompareUnicodeString(
-                      &String1, &String2, dwCmpFlags & NORM_IGNORECASE);
+                      &String1, &String2, (BOOLEAN)(dwCmpFlags & NORM_IGNORECASE));
     
     
     if (Result) /* need to translate result */

Modified: trunk/reactos/dll/win32/kernel32/misc/lcformat.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/lcformat.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/lcformat.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/lcformat.c Fri Jan 26 10:22:19 2007
@@ -85,7 +85,7 @@
     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 };
 

Modified: trunk/reactos/dll/win32/kernel32/misc/ldr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ldr.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/ldr.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/ldr.c Fri Jan 26 10:22:19 2007
@@ -315,7 +315,7 @@
 			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) */
@@ -383,7 +383,7 @@
 			else
 			{
 				FileName.Length = 0;
-				FileName.MaximumLength = nSize * sizeof(WCHAR);
+				FileName.MaximumLength =(USHORT)nSize * sizeof(WCHAR);
 				FileName.Buffer = lpFilename;
 
 				RtlCopyUnicodeString (&FileName,
@@ -680,7 +680,8 @@
   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);

Modified: trunk/reactos/dll/win32/kernel32/misc/lzexpand_main.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/lzexpand_main.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/lzexpand_main.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/lzexpand_main.c Fri Jan 26 10:22:19 2007
@@ -266,9 +266,9 @@
 	}
 	if (isalpha(head.lastchar)) {
 		if (fnislowercased)
-			head.lastchar=tolower(head.lastchar);
+			head.lastchar=(CHAR)tolower(head.lastchar);
 		else
-			head.lastchar=toupper(head.lastchar);
+			head.lastchar=(CHAR)toupper(head.lastchar);
 	}
 
 	/* now look where to replace the last character */

Modified: trunk/reactos/dll/win32/kernel32/misc/nls.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/nls.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/nls.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/nls.c Fri Jan 26 10:22:19 2007
@@ -489,7 +489,7 @@
             break;
          }
          TempLength--;
-         *MultiByteString++ = Char;
+         *MultiByteString++ = (CHAR)Char;
          continue;
       }
 

Modified: trunk/reactos/dll/win32/kernel32/misc/profile.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/profile.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/profile.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/profile.c Fri Jan 26 10:22:19 2007
@@ -76,7 +76,7 @@
 {
     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 };
 
@@ -121,7 +121,7 @@
     }
 
     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';
 }
 
 

Modified: trunk/reactos/dll/win32/kernel32/process/create.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process/create.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/process/create.c (original)
+++ trunk/reactos/dll/win32/kernel32/process/create.c Fri Jan 26 10:22:19 2007
@@ -199,7 +199,7 @@
     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;
     
@@ -221,7 +221,7 @@
     }
         
     /* Use the allocated size */
-    UnicodeEnv.MaximumLength = *EnvSize;
+    UnicodeEnv.MaximumLength = (USHORT)*EnvSize;
     
     /* Convert */
     RtlAnsiStringToUnicodeString(&UnicodeEnv, &AnsiEnv, FALSE);
@@ -754,7 +754,7 @@
 
     /* Easy stuff first, convert the process priority class */
     PriorityClass.Foreground = FALSE;
-    PriorityClass.PriorityClass = BasepConvertPriorityClass(dwCreationFlags);
+    PriorityClass.PriorityClass = (UCHAR)BasepConvertPriorityClass(dwCreationFlags);
 
     if (lpCommandLine)
     {
@@ -1158,7 +1158,7 @@
                              PROCESS_ALL_ACCESS,
                              ObjectAttributes,
                              NtCurrentProcess(),
-                             bInheritHandles,
+                             (BOOLEAN)bInheritHandles,
                              hSection,
                              hDebug,
                              NULL);

Modified: trunk/reactos/dll/win32/kernel32/process/proc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process/proc.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/process/proc.c (original)
+++ trunk/reactos/dll/win32/kernel32/process/proc.c Fri Jan 26 10:22:19 2007
@@ -376,7 +376,7 @@
 
    RtlZeroMemory(&StartupInfo, sizeof(StartupInfo));
    StartupInfo.cb = sizeof(STARTUPINFOA);
-   StartupInfo.wShowWindow = uCmdShow;
+   StartupInfo.wShowWindow = (WORD)uCmdShow;
    StartupInfo.dwFlags = 0;
 
    if (! CreateProcessA(NULL,
@@ -419,20 +419,6 @@
 	return;
 }
 
-
-/*
- * @unimplemented
- */
-DWORD STDCALL
-WaitForInputIdle (
-	HANDLE	hProcess,
-	DWORD	dwMilliseconds
-	)
-{
-	return 0;
-}
-
-
 /*
  * @implemented
  */
@@ -460,7 +446,7 @@
   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;
   
@@ -531,7 +517,7 @@
 	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;
 

Modified: trunk/reactos/dll/win32/kernel32/string/lstring.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/string/lstring.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/string/lstring.c (original)
+++ trunk/reactos/dll/win32/kernel32/string/lstring.c Fri Jan 26 10:22:19 2007
@@ -10,7 +10,6 @@
 
 #include <k32.h>
 
-
 static _SEH_FILTER(lstr_page_fault)
 {
     if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
@@ -72,7 +71,6 @@
    return Result;
 }
 
-
 /*
  * @implemented
  */

Modified: trunk/reactos/dll/win32/kernel32/synch/condvar.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/condvar.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/synch/condvar.c (original)
+++ trunk/reactos/dll/win32/kernel32/synch/condvar.c Fri Jan 26 10:22:19 2007
@@ -38,7 +38,7 @@
                          IN OUT PCRITICAL_SECTION CriticalSection,
                          IN DWORD dwMilliseconds)
 {
-    NTSTATUS Status;
+    NTSTATUS Status = 0;
     LARGE_INTEGER TimeOut;
     PLARGE_INTEGER TimeOutPtr = NULL;
 
@@ -48,10 +48,11 @@
         TimeOutPtr = &TimeOut;
     }
 
+#if 0
     Status = RtlSleepConditionVariableCS((PRTL_CONDITION_VARIABLE)ConditionVariable,
                                          (PRTL_CRITICAL_SECTION)CriticalSection,
                                          TimeOutPtr);
-
+#endif
     if (!NT_SUCCESS(Status))
     {
         SetLastErrorByStatus(Status);
@@ -72,7 +73,7 @@
                           IN DWORD dwMilliseconds,
                           IN ULONG Flags)
 {
-    NTSTATUS Status;
+    NTSTATUS Status = 0;
     LARGE_INTEGER TimeOut;
     PLARGE_INTEGER TimeOutPtr = NULL;
 
@@ -82,11 +83,12 @@
         TimeOutPtr = &TimeOut;
     }
 
+#if 0
     Status = RtlSleepConditionVariableSRW((PRTL_CONDITION_VARIABLE)ConditionVariable,
                                           (PRTL_SRWLOCK)SRWLock,
                                           TimeOutPtr,
                                           Flags);
-
+#endif
     if (!NT_SUCCESS(Status))
     {
         SetLastErrorByStatus(Status);

Modified: trunk/reactos/dll/win32/kernel32/synch/timer.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/timer.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/synch/timer.c (original)
+++ trunk/reactos/dll/win32/kernel32/synch/timer.c Fri Jan 26 10:22:19 2007
@@ -9,8 +9,8 @@
 /* INCLUDES *****************************************************************/
 
 /* File contains Vista Semantics */
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0600
+//#undef _WIN32_WINNT
+//#define _WIN32_WINNT 0x0600
 
 #include <k32.h>
 
@@ -269,7 +269,7 @@
                         (PLARGE_INTEGER)pDueTime,
                         (PTIMER_APC_ROUTINE)pfnCompletionRoutine,
                         lpArgToCompletionRoutine,
-                        fResume,
+                        (BOOLEAN)fResume,
                         lPeriod,
                         NULL);
     if (NT_SUCCESS(Status)) return TRUE;

Modified: trunk/reactos/dll/win32/kernel32/thread/thread.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/thread/thread.c?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/thread/thread.c (original)
+++ trunk/reactos/dll/win32/kernel32/thread/thread.c Fri Jan 26 10:22:19 2007
@@ -838,7 +838,7 @@
        * 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
     {
@@ -847,7 +847,7 @@
     }
 
 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;
 }
@@ -865,7 +865,7 @@
 {
     QUEUE_USER_WORKITEM_CONTEXT Info;
 
-    ASSERT(Context != NULL);
+    ASSERT(Context);
 
     /* Save the context to the stack */
     Info = *(volatile QUEUE_USER_WORKITEM_CONTEXT *)Context;

Modified: trunk/reactos/include/psdk/winnt.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=25633&r1=25632&r2=25633&view=diff
==============================================================================
--- trunk/reactos/include/psdk/winnt.h (original)
+++ trunk/reactos/include/psdk/winnt.h Fri Jan 26 10:22:19 2007
@@ -2669,7 +2669,9 @@
 	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;




More information about the Ros-diffs mailing list