- Misc janitorial fixes by Brezenbak to fix some MSVC compile errors.
authorAlex Ionescu <aionescu@gmail.com>
Mon, 21 Nov 2005 18:38:09 +0000 (18:38 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Mon, 21 Nov 2005 18:38:09 +0000 (18:38 +0000)
svn path=/trunk/; revision=19413

20 files changed:
reactos/ntoskrnl/ex/fmutex.c
reactos/ntoskrnl/ex/init.c
reactos/ntoskrnl/fs/filelock.c
reactos/ntoskrnl/include/internal/i386/ke.h
reactos/ntoskrnl/include/internal/ke.h
reactos/ntoskrnl/include/internal/ntoskrnl.h
reactos/ntoskrnl/io/bootlog.c
reactos/ntoskrnl/io/disk.c
reactos/ntoskrnl/kd/kdio.c
reactos/ntoskrnl/kdbg/kdb.h
reactos/ntoskrnl/kdbg/kdb_symbols.c
reactos/ntoskrnl/ke/apc.c
reactos/ntoskrnl/ke/i386/kernel.c
reactos/ntoskrnl/ke/process.c
reactos/ntoskrnl/ke/wait.c
reactos/ntoskrnl/lpc/reply.c
reactos/ntoskrnl/mm/cont.c
reactos/ntoskrnl/mm/npool.c
reactos/ntoskrnl/mm/rpoolmgr.h
reactos/ntoskrnl/ob/sdcache.c

index c29f7ce..689d836 100644 (file)
@@ -81,9 +81,9 @@ VOID
 FASTCALL
 ExAcquireFastMutex(PFAST_MUTEX FastMutex)
 {
-    ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL);
     KIRQL OldIrql;
-   
+    ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL);
+
     /* Raise IRQL to APC */
     OldIrql = KfRaiseIrql(APC_LEVEL);
    
@@ -180,8 +180,8 @@ BOOLEAN
 FASTCALL
 ExTryToAcquireFastMutex(PFAST_MUTEX FastMutex)
 {
-    ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL);
     KIRQL OldIrql;
+    ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL);
 
     /* Raise to APC_LEVEL */
     OldIrql = KfRaiseIrql(APC_LEVEL);
index 5150cb0..59d41fc 100644 (file)
@@ -220,7 +220,7 @@ InitSystemSharedUserPage (PCSZ ParameterLine)
     }
 }
 
-inline
+__inline
 VOID
 STDCALL
 ExecuteRuntimeAsserts(VOID)
@@ -255,7 +255,7 @@ ExecuteRuntimeAsserts(VOID)
     ASSERT(sizeof(FX_SAVE_AREA) == SIZEOF_FX_SAVE_AREA);
 }
 
-inline
+__inline
 VOID
 STDCALL
 ParseAndCacheLoadedModules(VOID)
@@ -303,7 +303,7 @@ ParseAndCacheLoadedModules(VOID)
     }
 }
 
-inline
+__inline
 VOID
 STDCALL
 ParseCommandLine(PULONG MaxMem,
index 2c5c379..a37f5e2 100644 (file)
@@ -27,7 +27,7 @@ PAGED_LOOKASIDE_LIST    LockLookaside;
 
 
 
-inline BOOLEAN
+__inline BOOLEAN
 IsOverlappingLock(
    PFILE_LOCK_INFO Lock,
    PLARGE_INTEGER StartOffset,
@@ -48,7 +48,7 @@ IsOverlappingLock(
 }
 
 
-inline BOOLEAN
+__inline BOOLEAN
 IsSurroundingLock(
    PFILE_LOCK_INFO Lock,
    PLARGE_INTEGER StartOffset,
index 1b6546a..78d5edb 100644 (file)
@@ -266,9 +266,11 @@ static inline void Ki386Cpuid(ULONG Op, PULONG Eax, PULONG Ebx, PULONG Ecx, PULO
 #define Ke386GetPageTableDirectory(X) \
                                 __asm mov eax, cr3; \
                                 __asm mov X, eax;
-#define Ke386SetPageTableDirectory(X) \
-                                __asm mov eax, X; \
-                               __asm mov cr3, eax;
+static __forceinline void Ke386SetPageTableDirectory(ULONG X)
+{
+    __asm mov eax, X
+    __asm mov cr3, eax
+}
 #else
 #error Unknown compiler for inline assembler
 #endif
index 3cccbea..3976c98 100644 (file)
@@ -244,7 +244,7 @@ KiExpireTimers(
 );
 
 KIRQL
-inline
+__inline
 FASTCALL
 KeAcquireDispatcherDatabaseLock(VOID);
 
@@ -363,7 +363,7 @@ KiInsertTimer(
 );
 
 VOID
-inline
+__inline
 FASTCALL
 KiSatisfyObjectWait(
     PDISPATCHER_HEADER Object,
@@ -371,7 +371,7 @@ KiSatisfyObjectWait(
 );
 
 BOOLEAN
-inline
+__inline
 FASTCALL
 KiIsObjectSignaled(
     PDISPATCHER_HEADER Object,
@@ -379,7 +379,7 @@ KiIsObjectSignaled(
 );
 
 VOID
-inline
+__inline
 FASTCALL
 KiSatisifyMultipleObjectWaits(PKWAIT_BLOCK WaitBlock);
 
index 7b16a96..ce712ef 100644 (file)
@@ -255,7 +255,7 @@ typedef struct _INFORMATION_CLASS_INFO
 #define ICI_SQ(SizeQuery, SizeSet, AlignmentQuery, AlignmentSet, Flags)        \
   { SizeQuery, SizeSet, AlignmentQuery, AlignmentSet, Flags }
 
-static inline NTSTATUS
+static __inline NTSTATUS
 DefaultSetInfoBufferCheck(UINT Class,
                           const INFORMATION_CLASS_INFO *ClassList,
                           UINT ClassListEntries,
@@ -304,7 +304,7 @@ DefaultSetInfoBufferCheck(UINT Class,
     return Status;
 }
 
-static inline NTSTATUS
+static __inline NTSTATUS
 DefaultQueryInfoBufferCheck(UINT Class,
                             const INFORMATION_CLASS_INFO *ClassList,
                             UINT ClassListEntries,
index ed9adaa..421e568 100644 (file)
@@ -310,8 +310,11 @@ IopSaveBootLogToFile(VOID)
       ExReleaseResourceLite(&IopBootLogResource);
       return;
     }
-
+#if defined (__GNUC__)
   Status = IopWriteLogFile(L"ReactOS "KERNEL_VERSION_STR);
+#elif defined (_MSC_VER)
+  Status = IopWriteLogFile("ReactOS "KERNEL_VERSION_STR);
+#endif
   if (!NT_SUCCESS(Status))
     {
       DPRINT1("IopWriteLogFile() failed (Status %lx)\n", Status);
index 20a9069..6678113 100644 (file)
@@ -1070,7 +1070,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
                              AUTO_DRIVE,
                              DOSDEVICE_DRIVE_REMOVABLE,
                               0,
-                              (LARGE_INTEGER)0LL,
+                              RtlConvertLongToLargeInteger(0),
                               hKey);
            }
        }
@@ -1101,7 +1101,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
                      (i < 2) ? i : AUTO_DRIVE,
                      DOSDEVICE_DRIVE_REMOVABLE,
                       0,
-                      (LARGE_INTEGER)0LL,
+                      RtlConvertLongToLargeInteger(0),
                       hKey);
     }
 
@@ -1121,7 +1121,7 @@ xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
                      AUTO_DRIVE,
                      DOSDEVICE_DRIVE_CDROM,
                       0,
-                      (LARGE_INTEGER)0LL,
+                      RtlConvertLongToLargeInteger(0),
                       hKey);
     }
 
index bafc17b..a15a8b9 100644 (file)
@@ -263,10 +263,11 @@ STDCALL
 KdpPrintString(LPSTR String,
                ULONG Length)
 {
-    if (!KdpDebugMode.Value) return 0;
     PLIST_ENTRY CurrentEntry;
     PKD_DISPATCH_TABLE CurrentTable;
 
+    if (!KdpDebugMode.Value) return 0;
+
     /* Call the registered handlers */
     CurrentEntry = KdProviders.Flink;
     while (CurrentEntry != &KdProviders)
index ff30acc..1b2fa30 100644 (file)
@@ -87,7 +87,7 @@ KdbpGetInstLength(
 
 /* from i386/kdb_help.S */
 
-STDCALL VOID
+VOID STDCALL
 KdbpStackSwitchAndCall(
    IN PVOID NewStack,
    IN VOID (*Function)(VOID));
index 4a9ef87..bc37191 100644 (file)
@@ -559,7 +559,7 @@ KdbSymLoadDriverSymbols(IN PUNICODE_STRING Filename,
                         IN PLDR_DATA_TABLE_ENTRY Module)
 {
   /* Load symbols for the image if available */
-  DPRINT("Loading driver %wZ symbols (driver @ %08x)\n", Filename, Module->Base);
+  DPRINT("Loading driver %wZ symbols (driver @ %08x)\n", Filename, Module->DllBase);
 
   Module->PatchInformation = NULL;
 
@@ -664,7 +664,7 @@ KdbSymProcessBootSymbols(IN PCHAR FileName)
         DPRINT("Installed symbols: %s@%08x-%08x %p\n",
               FileName,
               ModuleObject->DllBase,
-              ModuleObject->SizeOfImage + ModuleObject->DllBase,
+              ModuleObject->SizeOfImage + (ULONG)ModuleObject->DllBase,
               ModuleObject->PatchInformation);
      }
   }
index 1d8db90..19b71d6 100644 (file)
@@ -1064,7 +1064,7 @@ NtQueueApcThread(HANDLE ThreadHandle,
     return Status;
 }
 
-static inline
+static __inline
 VOID RepairList(PLIST_ENTRY Original,
                 PLIST_ENTRY Copy,
                 KPROCESSOR_MODE Mode)
index 7c5442c..740dc47 100644 (file)
@@ -170,11 +170,12 @@ INIT_FUNCTION
 NTAPI
 KePrepareForApplicationProcessorInit(ULONG Id)
 {
-  DPRINT("KePrepareForApplicationProcessorInit(Id %d)\n", Id);
   PFN_TYPE PrcPfn;
   PKIPCR Pcr;
   PKIPCR BootPcr;
 
+  DPRINT("KePrepareForApplicationProcessorInit(Id %d)\n", Id);
+
   BootPcr = (PKIPCR)KPCR_BASE;
   Pcr = (PKIPCR)((ULONG_PTR)KPCR_BASE + Id * PAGE_SIZE);
 
index ba72d84..e6f1c81 100644 (file)
@@ -36,7 +36,7 @@ KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES] = {
 
 /* FUNCTIONS *****************************************************************/
 
-static inline void
+static __inline void
 UpdatePageDirs(PKTHREAD Thread, PKPROCESS Process)
 {
     /*
index 26f5aff..2bc9db9 100644 (file)
@@ -27,7 +27,7 @@ static KSPIN_LOCK DispatcherDatabaseLock;
 /* FUNCTIONS *****************************************************************/
 
 BOOLEAN
-inline
+__inline
 FASTCALL
 KiCheckAlertability(BOOLEAN Alertable,
                     PKTHREAD CurrentThread,
@@ -771,7 +771,7 @@ KiAcquireFastMutex(IN PFAST_MUTEX FastMutex)
 }
 
 BOOLEAN
-inline
+__inline
 FASTCALL
 KiIsObjectSignaled(PDISPATCHER_HEADER Object,
                    PKTHREAD Thread)
@@ -802,7 +802,7 @@ KiIsObjectSignaled(PDISPATCHER_HEADER Object,
 }
 
 VOID
-inline
+__inline
 FASTCALL
 KiSatisifyMultipleObjectWaits(PKWAIT_BLOCK WaitBlock)
 {
@@ -819,7 +819,7 @@ KiSatisifyMultipleObjectWaits(PKWAIT_BLOCK WaitBlock)
 }
 
 VOID
-inline
+__inline
 FASTCALL
 KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header,
                              ULONG Type,
@@ -835,7 +835,7 @@ KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header,
 }
 
 KIRQL
-inline
+__inline
 FASTCALL
 KeAcquireDispatcherDatabaseLock(VOID)
 {
@@ -846,7 +846,7 @@ KeAcquireDispatcherDatabaseLock(VOID)
 }
 
 VOID
-inline
+__inline
 FASTCALL
 KeAcquireDispatcherDatabaseLockAtDpcLevel(VOID)
 {
@@ -854,7 +854,7 @@ KeAcquireDispatcherDatabaseLockAtDpcLevel(VOID)
 }
 
 VOID
-inline
+__inline
 FASTCALL
 KeInitializeDispatcher(VOID)
 {
@@ -863,7 +863,7 @@ KeInitializeDispatcher(VOID)
 }
 
 VOID
-inline
+__inline
 FASTCALL
 KeReleaseDispatcherDatabaseLock(KIRQL OldIrql)
 {
@@ -882,7 +882,7 @@ KeReleaseDispatcherDatabaseLock(KIRQL OldIrql)
 }
 
 VOID
-inline
+__inline
 FASTCALL
 KeReleaseDispatcherDatabaseLockFromDpcLevel(VOID)
 {
index bcc225e..e42e30b 100644 (file)
@@ -163,7 +163,7 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
    PreviousMode = ExGetPreviousMode();
 
    DPRINT("NtReplyWaitReceivePortEx(PortHandle %x, LpcReply %x, "
-         "LpcMessage %x)\n", PortHandle, LpcReply, LpcMessage);
+         "LpcMessage %x)\n", PortHandle, ReplyMessage, ReceiveMessage);
 
    if (PreviousMode != KernelMode)
      {
index 095368f..8fc409e 100644 (file)
@@ -16,7 +16,7 @@
 
 /* FUNCTIONS *****************************************************************/
 
-VOID STATIC
+static VOID 
 MmFreeContinuousPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
                      PFN_TYPE Page, SWAPENTRY SwapEntry,
                      BOOLEAN Dirty)
@@ -93,7 +93,7 @@ MmAllocateContiguousMemorySpecifyCache(IN SIZE_T NumberOfBytes,
                                &MArea,
                                FALSE,
                                0,
-                               (PHYSICAL_ADDRESS)0LL);
+                               RtlConvertLongToLargeInteger(0));
    MmUnlockAddressSpace(MmGetKernelAddressSpace());
 
    if (!NT_SUCCESS(Status))
@@ -158,9 +158,9 @@ MmAllocateContiguousMemory (IN ULONG NumberOfBytes,
                             IN PHYSICAL_ADDRESS HighestAcceptableAddress)
 {
    return MmAllocateContiguousMemorySpecifyCache(NumberOfBytes,
-                                                 (PHYSICAL_ADDRESS)0LL,
+                                                 RtlConvertLongToLargeInteger(0),
                                                  HighestAcceptableAddress,
-                                                 (PHYSICAL_ADDRESS)0LL,
+                                                 RtlConvertLongToLargeInteger(0),
                                                  MmCached);
 }
 
index f05a7b6..e032be4 100644 (file)
@@ -1472,7 +1472,7 @@ VOID STDCALL ExFreeNonPagedPool (PVOID block)
    DPRINT("freeing block %x\n",blk);
 
    POOL_TRACE("ExFreePool(block %x), size %d, caller %x\n",block,blk->hdr.Size,
-              block->Caller);
+              blk->Caller);
    KeAcquireSpinLock(&MmNpoolLock, &oldIrql);
 
    VALIDATE_POOL;
index 1aa98ad..1cf52d4 100644 (file)
@@ -496,7 +496,7 @@ RNextBlock ( PR_POOL pool, PR_FREE Block )
        return NextBlock;
 }
 
-inline static void*
+static __inline void*
 RHdrToBody ( void* blk )
 /*
  * FUNCTION: Translate a block header address to the corresponding block
@@ -506,7 +506,7 @@ RHdrToBody ( void* blk )
        return ( (void *) ((char*)blk + sizeof(R_USED) + R_RZ) );
 }
 
-inline static PR_USED
+static __inline PR_USED
 RBodyToHdr ( void* addr )
 {
        return (PR_USED)
index d7dffbf..b1464c4 100644 (file)
@@ -52,7 +52,7 @@ ObpInitSdCache(VOID)
 }
 
 
-static inline VOID
+static __inline VOID
 ObpSdCacheLock(VOID)
 {
   /* can't acquire a fast mutex in the early boot process... */
@@ -63,7 +63,7 @@ ObpSdCacheLock(VOID)
 }
 
 
-static inline VOID
+static __inline VOID
 ObpSdCacheUnlock(VOID)
 {
   /* can't acquire a fast mutex in the early boot process... */