Use correct format for arguments in debug messages
authorHervé Poussineau <hpoussin@reactos.org>
Fri, 9 Dec 2005 00:18:28 +0000 (00:18 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Fri, 9 Dec 2005 00:18:28 +0000 (00:18 +0000)
svn path=/trunk/; revision=19990

reactos/lib/ntdll/csr/connect.c
reactos/lib/ntdll/ldr/startup.c
reactos/lib/ntdll/ldr/utils.c

index 4c2f461..8421894 100644 (file)
@@ -67,7 +67,7 @@ CsrClientCallServer(PCSR_API_MESSAGE ApiMessage,
     //ApiMessage->Opcode = ApiNumber; <- Activate with new CSR
     ApiMessage->CsrCaptureData = NULL;
 
-    DPRINT("API: %x, u1.s1.DataLength: %x, u1.s1.TotalLength: %x\n", 
+    DPRINT("API: %lx, u1.s1.DataLength: %x, u1.s1.TotalLength: %x\n", 
            ApiNumber,
            ApiMessage->Header.u1.s1.DataLength,
            ApiMessage->Header.u1.s1.TotalLength);
@@ -94,15 +94,15 @@ CsrClientCallServer(PCSR_API_MESSAGE ApiMessage,
             while (PointerCount--)
             {
                 /* Get this pointer and check if it's valid */
-                DPRINT("Array Address: %p. This pointer: %p. Data: %p\n",
+                DPRINT("Array Address: %p. This pointer: %p. Data: %lx\n",
                         &Pointers, Pointers, *Pointers);
                 if ((CurrentPointer = *Pointers++))
                 {
                     /* Update it */
-                    DPRINT("CurrentPointer: %p.\n", *(PULONG_PTR)CurrentPointer);
+                    DPRINT("CurrentPointer: %lx.\n", *(PULONG_PTR)CurrentPointer);
                     *(PULONG_PTR)CurrentPointer += CsrPortMemoryDelta;
                     Pointers[-1] = CurrentPointer - (ULONG_PTR)ApiMessage;
-                    DPRINT("CurrentPointer: %p.\n", *(PULONG_PTR)CurrentPointer);
+                    DPRINT("CurrentPointer: %lx.\n", *(PULONG_PTR)CurrentPointer);
                 }
             }
         }
@@ -164,7 +164,7 @@ CsrClientCallServer(PCSR_API_MESSAGE ApiMessage,
     }
 
     /* Return the CSR Result */
-    DPRINT("Got back: %x\n", ApiMessage->Status);
+    DPRINT("Got back: 0x%lx\n", ApiMessage->Status);
     return ApiMessage->Status;
 }
 
@@ -433,7 +433,7 @@ CsrClientConnectToServer(PWSTR ObjectDirectory,
     }
 
     /* Let the caller know if this was server to server */
-    DPRINT("Status was: %lx. Are we in server: %lx\n", Status, InsideCsrProcess);
+    DPRINT("Status was: 0x%lx. Are we in server: 0x%x\n", Status, InsideCsrProcess);
     if (ServerToServerCall) *ServerToServerCall = InsideCsrProcess;
     return Status;
 }
index 15defad..443a81d 100644 (file)
@@ -110,7 +110,7 @@ LoadImageFileExecutionOptions(PPEB Peb)
             if (NT_SUCCESS(Status))
               {
                 Peb->NtGlobalFlag |= Value;
-               DPRINT("GlobalFlag: Key='%S', Value=%08x\n", ValueBuffer, Value);
+               DPRINT("GlobalFlag: Key='%S', Value=0x%lx\n", ValueBuffer, Value);
               }
          }
         /*
@@ -260,9 +260,9 @@ LdrpInit(PCONTEXT Context,
    if (NtCurrentPeb()->Ldr == NULL || NtCurrentPeb()->Ldr->Initialized == FALSE)
      {
        Peb = NtCurrentPeb();
-       DPRINT("Peb %x\n", Peb);
+       DPRINT("Peb %p\n", Peb);
        ImageBase = Peb->ImageBaseAddress;
-       DPRINT("ImageBase %x\n", ImageBase);
+       DPRINT("ImageBase %p\n", ImageBase);
        if (ImageBase <= (PVOID)0x1000)
          {
            DPRINT("ImageBase is null\n");
@@ -271,7 +271,7 @@ LdrpInit(PCONTEXT Context,
 
        /*  If MZ header exists  */
        PEDosHeader = (PIMAGE_DOS_HEADER) ImageBase;
-       DPRINT("PEDosHeader %x\n", PEDosHeader);
+       DPRINT("PEDosHeader %p\n", PEDosHeader);
 
        if (PEDosHeader->e_magic != IMAGE_DOS_SIGNATURE ||
            PEDosHeader->e_lfanew == 0L ||
index 1c9240d..15fae4c 100644 (file)
@@ -534,7 +534,7 @@ LdrpMapKnownDll(IN PUNICODE_STRING DllName,
                          &ObjectAttributes);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtOpenSection() failed for '%wZ' (Status %lx)\n", DllName, Status);
+      DPRINT("NtOpenSection() failed for '%wZ' (Status 0x%08lx)\n", DllName, Status);
       return Status;
     }
 
@@ -639,7 +639,7 @@ LdrpMapDllImageFile(IN PWSTR SearchPath OPTIONAL,
                       FILE_SYNCHRONOUS_IO_NONALERT);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT1("Dll open of %wZ failed: Status = 0x%08x\n",
+      DPRINT1("Dll open of %wZ failed: Status = 0x%08lx\n",
                &FullNtFileName, Status);
       RtlFreeUnicodeString (&FullNtFileName);
       return Status;
@@ -657,7 +657,7 @@ LdrpMapDllImageFile(IN PWSTR SearchPath OPTIONAL,
                       NULL);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("Dll header read failed: Status = 0x%08x\n", Status);
+      DPRINT("Dll header read failed: Status = 0x%08lx\n", Status);
       NtClose(FileHandle);
       return Status;
     }
@@ -694,7 +694,7 @@ LdrpMapDllImageFile(IN PWSTR SearchPath OPTIONAL,
 
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NTDLL create section failed: Status = 0x%08x\n", Status);
+      DPRINT("NTDLL create section failed: Status = 0x%08lx\n", Status);
       return Status;
     }
 
@@ -1031,7 +1031,7 @@ LdrGetExportByOrdinal (
                         ExportDir->AddressOfFunctions
                         );
         DPRINT(
-                "LdrGetExportByOrdinal(Ordinal %d) = %p\n",
+                "LdrGetExportByOrdinal(Ordinal %lu) = %p\n",
                 Ordinal,
                 RVA(BaseAddress, ExFunctions[Ordinal - ExportDir->Base] )
                 );
@@ -1083,7 +1083,7 @@ LdrGetExportByName(PVOID BaseAddress,
    LONG minn, maxn;
    ULONG ExportDirSize;
 
-   DPRINT("LdrGetExportByName %x %s %hu\n", BaseAddress, SymbolName, Hint);
+   DPRINT("LdrGetExportByName %p %s %hu\n", BaseAddress, SymbolName, Hint);
 
    ExportDir = (PIMAGE_EXPORT_DIRECTORY)
      RtlImageDirectoryEntryToData(BaseAddress,
@@ -1453,7 +1453,7 @@ LdrpProcessImportDirectory(
    PCHAR Name;
    ULONG Size;
 
-   DPRINT("LdrpProcessImportDirectory(%x '%wZ', '%s')\n",
+   DPRINT("LdrpProcessImportDirectory(%p '%wZ', '%s')\n",
           Module, &Module->BaseDllName, ImportedName);
 
 
@@ -1507,7 +1507,7 @@ LdrpAdjustImportDirectory(PLDR_DATA_TABLE_ENTRY Module,
    PCHAR Name;
    ULONG Size;
 
-   DPRINT("LdrpAdjustImportDirectory(Module %x '%wZ', %x '%wZ', %x '%s')\n",
+   DPRINT("LdrpAdjustImportDirectory(Module %p '%wZ', %p '%wZ', '%s')\n",
           Module, &Module->BaseDllName, ImportedModule, &ImportedModule->BaseDllName, ImportedName);
 
    ImportModuleDirectory = (PIMAGE_IMPORT_DESCRIPTOR)
@@ -1626,7 +1626,7 @@ LdrFixupImports(IN PWSTR SearchPath OPTIONAL,
    PCHAR ImportedName;
    ULONG Size;
 
-   DPRINT("LdrFixupImports(SearchPath %x, Module %x)\n", SearchPath, Module);
+   DPRINT("LdrFixupImports(SearchPath %S, Module %p)\n", SearchPath, Module);
 
    /* Check for tls data */
    TlsDirectory = (PIMAGE_TLS_DIRECTORY)
@@ -1669,7 +1669,7 @@ LdrFixupImports(IN PWSTR SearchPath OPTIONAL,
      }
    if (BoundImportDescriptor)
      {
-       DPRINT("BoundImportDescriptor %x\n", BoundImportDescriptor);
+       DPRINT("BoundImportDescriptor %p\n", BoundImportDescriptor);
 
        BoundImportDescriptorCurrent = BoundImportDescriptor;
        while (BoundImportDescriptorCurrent->OffsetModuleName)
@@ -1794,7 +1794,7 @@ LdrFixupImports(IN PWSTR SearchPath OPTIONAL,
      }
    else if (ImportModuleDirectory)
      {
-       DPRINT("ImportModuleDirectory %x\n", ImportModuleDirectory);
+       DPRINT("ImportModuleDirectory %p\n", ImportModuleDirectory);
 
        ImportModuleDirectoryCurrent = ImportModuleDirectory;
        while (ImportModuleDirectoryCurrent->Name)
@@ -1873,8 +1873,8 @@ PEPFUNC LdrPEStartup (PVOID  ImageBase,
    PIMAGE_NT_HEADERS    NTHeaders;
    PLDR_DATA_TABLE_ENTRY tmpModule;
 
-   DPRINT("LdrPEStartup(ImageBase %x SectionHandle %x)\n",
-           ImageBase, (ULONG)SectionHandle);
+   DPRINT("LdrPEStartup(ImageBase %p SectionHandle %p)\n",
+           ImageBase, SectionHandle);
 
    /*
     * Overlay DOS and WNT headers structures
@@ -1952,14 +1952,14 @@ PEPFUNC LdrPEStartup (PVOID  ImageBase,
    /*
     * Compute the DLL's entry point's address.
     */
-   DPRINT("ImageBase = %x\n",(ULONG)ImageBase);
-   DPRINT("AddressOfEntryPoint = %x\n",(ULONG)NTHeaders->OptionalHeader.AddressOfEntryPoint);
+   DPRINT("ImageBase = %p\n", ImageBase);
+   DPRINT("AddressOfEntryPoint = 0x%lx\n",(ULONG)NTHeaders->OptionalHeader.AddressOfEntryPoint);
    if (NTHeaders->OptionalHeader.AddressOfEntryPoint != 0)
      {
         EntryPoint = (PEPFUNC) ((ULONG_PTR)ImageBase
                            + NTHeaders->OptionalHeader.AddressOfEntryPoint);
      }
-   DPRINT("LdrPEStartup() = %x\n",EntryPoint);
+   DPRINT("LdrPEStartup() = %p\n",EntryPoint);
    return EntryPoint;
 }
 
@@ -2032,7 +2032,7 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL,
                                     PAGE_READONLY);
         if (!NT_SUCCESS(Status))
           {
-            DPRINT1("map view of section failed (Status %x)\n", Status);
+            DPRINT1("map view of section failed (Status 0x%08lx)\n", Status);
             RtlFreeUnicodeString(&FullDosName);
             NtClose(SectionHandle);
             return(Status);
@@ -2069,7 +2069,7 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL,
          * relocation. */
         if (ImageBase != (PVOID) NtHeaders->OptionalHeader.ImageBase)
           {
-            DPRINT1("Relocating (%x -> %x) %wZ\n",
+            DPRINT1("Relocating (%lx -> %p) %wZ\n",
               NtHeaders->OptionalHeader.ImageBase, ImageBase, &FullDosName);
             Status = LdrPerformRelocations(NtHeaders, ImageBase);
             if (!NT_SUCCESS(Status))
@@ -2254,7 +2254,7 @@ LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress)
     PLDR_DATA_TABLE_ENTRY Module;
     NTSTATUS Status;
 
-    DPRINT("LdrDisableThreadCalloutsForDll (BaseAddress %x)\n", BaseAddress);
+    DPRINT("LdrDisableThreadCalloutsForDll (BaseAddress %p)\n", BaseAddress);
 
     Status = STATUS_DLL_NOT_FOUND;
     RtlEnterCriticalSection (NtCurrentPeb()->LoaderLock);
@@ -2264,7 +2264,7 @@ LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress)
       {
         Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
 
-        DPRINT("BaseDllName %wZ BaseAddress %x\n", &Module->BaseDllName, Module->DllBase);
+        DPRINT("BaseDllName %wZ BaseAddress %p\n", &Module->BaseDllName, Module->DllBase);
 
         if (Module->DllBase == BaseAddress)
           {
@@ -2300,7 +2300,7 @@ LdrGetDllHandle(IN PWSTR DllPath OPTIONAL,
     if (DllName == NULL)
       {
         *DllHandle = ExeModule->DllBase;
-        DPRINT("BaseAddress %x\n", *DllHandle);
+        DPRINT("BaseAddress 0x%lx\n", *DllHandle);
         return STATUS_SUCCESS;
       }
 
@@ -2335,7 +2335,7 @@ LdrGetProcedureAddress (IN PVOID BaseAddress,
        TRACE_LDR("LdrGetProcedureAddress by ORDINAL - %d\n", Ordinal);
      }
 
-   DPRINT("LdrGetProcedureAddress (BaseAddress %x Name %Z Ordinal %lu ProcedureAddress %x)\n",
+   DPRINT("LdrGetProcedureAddress (BaseAddress %p Name %Z Ordinal %lu ProcedureAddress %p)\n",
           BaseAddress, Name, Ordinal, ProcedureAddress);
 
    if (Name && Name->Length)
@@ -2357,7 +2357,7 @@ LdrGetProcedureAddress (IN PVOID BaseAddress,
          {
            return STATUS_SUCCESS;
          }
-       DPRINT("LdrGetProcedureAddress: Can't resolve symbol @%d\n", Ordinal);
+       DPRINT("LdrGetProcedureAddress: Can't resolve symbol @%lu\n", Ordinal);
      }
    return STATUS_PROCEDURE_NOT_FOUND;
 }