- userinit, usetup, vmwinst, welcome, winefile, winlogon, winver.
authorAlex Ionescu <aionescu@gmail.com>
Sun, 8 Jan 2006 10:23:23 +0000 (10:23 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Sun, 8 Jan 2006 10:23:23 +0000 (10:23 +0000)
svn path=/trunk/; revision=20707

reactos/subsys/system/userinit/userinit.c
reactos/subsys/system/usetup/cabinet.c
reactos/subsys/system/usetup/settings.c
reactos/subsys/system/vmwinst/vmwinst.c
reactos/subsys/system/winefile/winefile.c

index f631a20..b82a698 100644 (file)
@@ -26,6 +26,7 @@
 #include <cfgmgr32.h>
 #include "resource.h"
 
+#define CMP_MAGIC  0x01234567
 
 /* GLOBALS ******************************************************************/
 
index ec4bb08..4ba83bc 100755 (executable)
@@ -67,12 +67,12 @@ static PVOID CabinetReservedArea = NULL;
 
 /* Needed by zlib, but we don't want the dependency on msvcrt.dll */
 
-void free(void* _ptr)
+void __cdecl free(void* _ptr)
 {
   RtlFreeHeap(ProcessHeap, 0, _ptr);
 }
 
-void* calloc(size_t _nmemb, size_t _size)
+void* __cdecl calloc(size_t _nmemb, size_t _size)
 {
   return (void*)RtlAllocateHeap (ProcessHeap, HEAP_ZERO_MEMORY, _size);
 }
index 1cf1f27..c28882f 100644 (file)
@@ -505,6 +505,9 @@ ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List)
   PWCHAR ServiceName;
   ULONG StartValue;
   NTSTATUS Status;
+  WCHAR RegPath [255];
+  PWCHAR Buffer;
+  ULONG Width, Hight, Bpp;
 
   DPRINT("ProcessDisplayRegistry() called\n");
 
@@ -546,16 +549,14 @@ ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List)
     }
 
   /* Set the resolution */
-  WCHAR RegPath [255];
   swprintf(RegPath, L"\\Registry\\Machine\\System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\%s\\Device0", ServiceName);
 
-  PWCHAR Buffer;
   if (!InfGetDataField(Context, 4, &Buffer))
     {
       DPRINT("InfGetDataField() failed\n");
       return FALSE;
     }
-  ULONG Width = wcstoul(Buffer, NULL, 10);
+  Width = wcstoul(Buffer, NULL, 10);
   Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE,
                                 RegPath, 
                                 L"DefaultSettings.XResolution",
@@ -574,7 +575,7 @@ ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List)
       DPRINT("InfGetDataField() failed\n");
       return FALSE;
     }
-  ULONG Hight = wcstoul(Buffer, 0, 0);
+  Hight = wcstoul(Buffer, 0, 0);
   Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE,
                                 RegPath,
                                 L"DefaultSettings.YResolution",
@@ -592,7 +593,7 @@ ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List)
       DPRINT("InfGetDataField() failed\n");
       return FALSE;
     }
-  ULONG Bpp = wcstoul(Buffer, 0, 0);
+  Bpp = wcstoul(Buffer, 0, 0);
   Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE,
                                 RegPath,
                                 L"DefaultSettings.BitsPerPel",
index ce10e54..3729fba 100644 (file)
@@ -77,9 +77,14 @@ DetectVMware(int *Version)
 
   /* Try using a VMware I/O port. If not running in VMware this'll throw an
      exception! */
+#ifndef _MSC_VER
   __asm__ __volatile__("inl  %%dx, %%eax"
     : "=a" (ver), "=b" (magic)
     : "0" (0x564d5868), "d" (0x5658), "c" (0xa));
+#else
+#error PLEASE WRITE THIS IN ASSEMBLY
+#endif
+
 
   if(magic == 0x564d5868)
   {
@@ -485,6 +490,7 @@ PageWelcomeProc(
   LPARAM lParam
 )
 {
+  LPNMHDR pnmh = (LPNMHDR)lParam;
   switch(uMsg)
   {
     case WM_NOTIFY:
@@ -495,7 +501,6 @@ PageWelcomeProc(
       hwndControl = GetParent(hwndDlg);
       CenterWindow (hwndControl);
 
-      LPNMHDR pnmh = (LPNMHDR)lParam;
       switch(pnmh->code)
       {
         case PSN_SETACTIVE:
@@ -822,6 +827,7 @@ PageConfigProc(
   LPARAM lParam
 )
 {
+  LPNMHDR pnmh = (LPNMHDR)lParam;
   switch(uMsg)
   {
     case WM_INITDIALOG:
@@ -860,7 +866,6 @@ PageConfigProc(
       hwndControl = GetParent(hwndDlg);
       CenterWindow (hwndControl);
 
-      LPNMHDR pnmh = (LPNMHDR)lParam;
       switch(pnmh->code)
       {
         case PSN_SETACTIVE:
index 227ff1f..395876b 100644 (file)
@@ -1125,7 +1125,7 @@ static int TypeOrderFromDirname(LPCTSTR name)
 }
 
 /* directories first... */
-static int compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA* fd2)
+static int __cdecl compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA* fd2)
 {
        int order1 = fd1->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE;
        int order2 = fd2->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE;
@@ -1140,7 +1140,7 @@ static int compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA* fd2)
 }
 
 
-static int compareName(const void* arg1, const void* arg2)
+static int __cdecl compareName(const void* arg1, const void* arg2)
 {
        const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
        const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
@@ -1152,7 +1152,7 @@ static int compareName(const void* arg1, const void* arg2)
        return lstrcmpi(fd1->cFileName, fd2->cFileName);
 }
 
-static int compareExt(const void* arg1, const void* arg2)
+static int __cdecl compareExt(const void* arg1, const void* arg2)
 {
        const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
        const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
@@ -1185,7 +1185,7 @@ static int compareExt(const void* arg1, const void* arg2)
        return lstrcmpi(name1, name2);
 }
 
-static int compareSize(const void* arg1, const void* arg2)
+static int __cdecl compareSize(const void* arg1, const void* arg2)
 {
        const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
        const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
@@ -1206,7 +1206,7 @@ static int compareSize(const void* arg1, const void* arg2)
        return cmp<0? -1: cmp>0? 1: 0;
 }
 
-static int compareDate(const void* arg1, const void* arg2)
+static int __cdecl compareDate(const void* arg1, const void* arg2)
 {
        const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data;
        const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data;
@@ -1219,7 +1219,7 @@ static int compareDate(const void* arg1, const void* arg2)
 }
 
 
-static int (*sortFunctions[])(const void* arg1, const void* arg2) = {
+static int (__cdecl *sortFunctions[])(const void* arg1, const void* arg2) = {
        compareName,    /* SORT_NAME */
        compareExt,             /* SORT_EXT */
        compareSize,    /* SORT_SIZE */