[UDFS]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 3 Jun 2017 20:09:21 +0000 (20:09 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 3 Jun 2017 20:09:21 +0000 (20:09 +0000)
Make the driver really less verbose by introducing two macros UDFPrint and UDFPrintErr
So far, because of sed -i, almost all KdPrint became UDFPrint. It would be interesting
to promote some to UDFPrintErr (if someone motivated ;-))

CORE-4375

svn path=/trunk/; revision=74802

40 files changed:
reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp
reactos/drivers/filesystems/udfs/Include/env_spec_w32.cpp
reactos/drivers/filesystems/udfs/Include/getopt.cpp
reactos/drivers/filesystems/udfs/Include/mem_tools.cpp
reactos/drivers/filesystems/udfs/Include/misc_common.cpp
reactos/drivers/filesystems/udfs/Include/phys_lib.cpp
reactos/drivers/filesystems/udfs/Include/regtools.cpp
reactos/drivers/filesystems/udfs/Include/wcache_lib.cpp
reactos/drivers/filesystems/udfs/cleanup.cpp
reactos/drivers/filesystems/udfs/close.cpp
reactos/drivers/filesystems/udfs/create.cpp
reactos/drivers/filesystems/udfs/devcntrl.cpp
reactos/drivers/filesystems/udfs/dircntrl.cpp
reactos/drivers/filesystems/udfs/dldetect.cpp
reactos/drivers/filesystems/udfs/env_spec.cpp
reactos/drivers/filesystems/udfs/fastio.cpp
reactos/drivers/filesystems/udfs/fileinfo.cpp
reactos/drivers/filesystems/udfs/filter.cpp
reactos/drivers/filesystems/udfs/flush.cpp
reactos/drivers/filesystems/udfs/fscntrl.cpp
reactos/drivers/filesystems/udfs/lockctrl.cpp
reactos/drivers/filesystems/udfs/misc.cpp
reactos/drivers/filesystems/udfs/pnp.cpp
reactos/drivers/filesystems/udfs/read.cpp
reactos/drivers/filesystems/udfs/secursup.cpp
reactos/drivers/filesystems/udfs/shutdown.cpp
reactos/drivers/filesystems/udfs/udf_dbg.cpp
reactos/drivers/filesystems/udfs/udf_info/alloc.cpp
reactos/drivers/filesystems/udfs/udf_info/dirtree.cpp
reactos/drivers/filesystems/udfs/udf_info/extent.cpp
reactos/drivers/filesystems/udfs/udf_info/mount.cpp
reactos/drivers/filesystems/udfs/udf_info/phys_eject.cpp
reactos/drivers/filesystems/udfs/udf_info/remap.cpp
reactos/drivers/filesystems/udfs/udf_info/udf_info.cpp
reactos/drivers/filesystems/udfs/udffs.h
reactos/drivers/filesystems/udfs/udfinit.cpp
reactos/drivers/filesystems/udfs/unload.cpp
reactos/drivers/filesystems/udfs/verfysup.cpp
reactos/drivers/filesystems/udfs/volinfo.cpp
reactos/drivers/filesystems/udfs/write.cpp

index 8d5a087..d2602d6 100644 (file)
@@ -243,7 +243,7 @@ UDFFileDirInfoToNT(
     NTSTATUS status;
     PtrUDFNTRequiredFCB NtReqFcb;
 
-    KdPrint(("@=%#x, FileDirNdx %x\n", &Vcb, FileDirNdx));
+    UDFPrint(("@=%#x, FileDirNdx %x\n", &Vcb, FileDirNdx));
 
     ASSERT((ULONG)NTFileInfo > 0x1000);
     RtlZeroMemory(NTFileInfo, sizeof(FILE_BOTH_DIR_INFORMATION));
@@ -252,13 +252,13 @@ UDFFileDirInfoToNT(
     DosName.MaximumLength = sizeof(NTFileInfo->ShortName); // 12*sizeof(WCHAR)
 
     _SEH2_TRY {
-        KdPrint(("  DirInfoToNT: %*.*S\n", FileDirNdx->FName.Length/sizeof(WCHAR), FileDirNdx->FName.Length/sizeof(WCHAR), FileDirNdx->FName));
+        UDFPrint(("  DirInfoToNT: %*.*S\n", FileDirNdx->FName.Length/sizeof(WCHAR), FileDirNdx->FName.Length/sizeof(WCHAR), FileDirNdx->FName));
     } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
-        KdPrint(("  DirInfoToNT: exception when printing file name\n"));
+        UDFPrint(("  DirInfoToNT: exception when printing file name\n"));
     } _SEH2_END;
 
     if(FileDirNdx->FileInfo) {
-        KdPrint(("    FileInfo\n"));
+        UDFPrint(("    FileInfo\n"));
         // validate FileInfo
         ValidateFileInfo(FileDirNdx->FileInfo);
         if(UDFGetFileLinkCount(FileDirNdx->FileInfo) > 1)
@@ -267,7 +267,7 @@ UDFFileDirInfoToNT(
         // read required sizes from Fcb (if any) if file is not linked
         // otherwise we should read them from FileEntry
         if(FileDirNdx->FileInfo->Fcb) {
-            KdPrint(("    Fcb\n"));
+            UDFPrint(("    Fcb\n"));
             NtReqFcb = FileDirNdx->FileInfo->Fcb->NTRequiredFCB;
             NTFileInfo->CreationTime.QuadPart   = NtReqFcb->CreationTime.QuadPart;
             NTFileInfo->LastWriteTime.QuadPart  = NtReqFcb->LastWriteTime.QuadPart;
@@ -279,7 +279,7 @@ UDFFileDirInfoToNT(
             NTFileInfo->EndOfFile.QuadPart = NtReqFcb->CommonFCBHeader.FileSize.QuadPart;*/
             NTFileInfo->EndOfFile.QuadPart = FileDirNdx->FileSize;
             if(FileDirNdx->FI_Flags & UDF_FI_FLAG_SYS_ATTR) {
-                KdPrint(("    SYS_ATTR\n"));
+                UDFPrint(("    SYS_ATTR\n"));
                 NTFileInfo->FileAttributes = FileDirNdx->SysAttr;
                 goto get_name_only;
             }
@@ -294,7 +294,7 @@ UDFFileDirInfoToNT(
                (FileDirNdx->FI_Flags & UDF_FI_FLAG_LINKED)) {
         LONG_AD feloc;
 
-        KdPrint(("  !SYS_ATTR\n"));
+        UDFPrint(("  !SYS_ATTR\n"));
         FileEntry = (PFILE_ENTRY)MyAllocatePool__(NonPagedPool, Vcb->LBlockSize);
         if(!FileEntry) return STATUS_INSUFFICIENT_RESOURCES;
 
@@ -302,14 +302,14 @@ UDFFileDirInfoToNT(
         feloc.extLocation = FileDirNdx->FileEntryLoc;
 
         if(!NT_SUCCESS(status = UDFReadFileEntry(Vcb, &feloc, FileEntry, &Ident))) {
-            KdPrint(("    !UDFReadFileEntry\n"));
+            UDFPrint(("    !UDFReadFileEntry\n"));
             MyFreePool__(FileEntry);
             FileEntry = NULL;
             goto get_name_only;
         }
         ReadSizes = TRUE;
     } else {
-        KdPrint(("  FileDirNdx\n"));
+        UDFPrint(("  FileDirNdx\n"));
         NTFileInfo->CreationTime.QuadPart   = FileDirNdx->CreationTime;
         NTFileInfo->LastWriteTime.QuadPart  = FileDirNdx->LastWriteTime;
         NTFileInfo->LastAccessTime.QuadPart = FileDirNdx->LastAccessTime;
@@ -325,11 +325,11 @@ UDFFileDirInfoToNT(
     if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK)
         goto get_name_only;
 
-    KdPrint(("  direct\n"));
+    UDFPrint(("  direct\n"));
     if(FileEntry->descTag.tagIdent == TID_FILE_ENTRY) {
-        KdPrint(("  TID_FILE_ENTRY\n"));
+        UDFPrint(("  TID_FILE_ENTRY\n"));
         if(ReadSizes) {
-            KdPrint(("    ReadSizes\n"));
+            UDFPrint(("    ReadSizes\n"));
             // Times
             FileDirNdx->CreationTime   = NTFileInfo->CreationTime.QuadPart   =
             FileDirNdx->LastWriteTime  = NTFileInfo->LastWriteTime.QuadPart  = UDFTimeToNT(&(FileEntry->modificationTime));
@@ -339,7 +339,7 @@ UDFFileDirInfoToNT(
             FileDirNdx->FileSize =
             NTFileInfo->EndOfFile.QuadPart =
                 FileEntry->informationLength;
-            KdPrint(("    informationLength=%I64x, lengthAllocDescs=%I64x\n",
+            UDFPrint(("    informationLength=%I64x, lengthAllocDescs=%I64x\n",
                 FileEntry->informationLength,
                 FileEntry->lengthAllocDescs
                 ));
@@ -351,9 +351,9 @@ UDFFileDirInfoToNT(
 //        NTFileInfo->EaSize = 0;//FileEntry->lengthExtendedAttr;
     } else if(FileEntry->descTag.tagIdent == TID_EXTENDED_FILE_ENTRY) {
         ExFileEntry = (PEXTENDED_FILE_ENTRY)FileEntry;
-        KdPrint(("  PEXTENDED_FILE_ENTRY\n"));
+        UDFPrint(("  PEXTENDED_FILE_ENTRY\n"));
         if(ReadSizes) {
-            KdPrint(("    ReadSizes\n"));
+            UDFPrint(("    ReadSizes\n"));
             // Times
             FileDirNdx->CreationTime   = NTFileInfo->CreationTime.QuadPart   = UDFTimeToNT(&(ExFileEntry->createTime));
             FileDirNdx->LastWriteTime  = NTFileInfo->LastWriteTime.QuadPart  = UDFTimeToNT(&(ExFileEntry->modificationTime));
@@ -363,7 +363,7 @@ UDFFileDirInfoToNT(
             FileDirNdx->FileSize =
             NTFileInfo->EndOfFile.QuadPart =
                 ExFileEntry->informationLength;
-            KdPrint(("    informationLength=%I64x, lengthAllocDescs=%I64x\n",
+            UDFPrint(("    informationLength=%I64x, lengthAllocDescs=%I64x\n",
                 FileEntry->informationLength,
                 FileEntry->lengthAllocDescs
                 ));
@@ -374,13 +374,13 @@ UDFFileDirInfoToNT(
         }
 //        NTFileInfo->EaSize = 0;//ExFileEntry->lengthExtendedAttr;
     } else {
-        KdPrint(("  ???\n"));
+        UDFPrint(("  ???\n"));
         goto get_name_only;
     }
 
 get_attr_only:
 
-    KdPrint(("  get_attr"));
+    UDFPrint(("  get_attr"));
     // do some substitutions
     if(!FileDirNdx->CreationTime) {
         FileDirNdx->CreationTime = NTFileInfo->CreationTime.QuadPart = Vcb->VolCreationTime;
@@ -405,20 +405,20 @@ get_name_only:
     NTFileInfo->FileNameLength = UdfName.Length;
     RtlCopyMemory((PCHAR)&(NTFileInfo->FileName), (PCHAR)(UdfName.Buffer), UdfName.MaximumLength);
     if(!(FileDirNdx->FI_Flags & UDF_FI_FLAG_DOS)) {
-        KdPrint(("  !UDF_FI_FLAG_DOS"));
+        UDFPrint(("  !UDF_FI_FLAG_DOS"));
         UDFDOSName(Vcb, &DosName, &UdfName,
             (FileDirNdx->FI_Flags & UDF_FI_FLAG_KEEP_NAME) ? TRUE : FALSE);
         NTFileInfo->ShortNameLength = (UCHAR)DosName.Length;
     }
     // report zero EOF & AllocSize for Dirs
     if(FileDirNdx->FileCharacteristics & FILE_DIRECTORY) {
-        KdPrint(("  FILE_DIRECTORY"));
+        UDFPrint(("  FILE_DIRECTORY"));
         NTFileInfo->AllocationSize.QuadPart =
         NTFileInfo->EndOfFile.QuadPart = 0;
     }
-    KdPrint(("  AllocationSize=%I64x, NTFileInfo->EndOfFile=%I64x", NTFileInfo->AllocationSize.QuadPart, NTFileInfo->EndOfFile.QuadPart));
+    UDFPrint(("  AllocationSize=%I64x, NTFileInfo->EndOfFile=%I64x", NTFileInfo->AllocationSize.QuadPart, NTFileInfo->EndOfFile.QuadPart));
     // free tmp buffer (if any)
-    KdPrint(("\n"));
+    UDFPrint(("\n"));
     if(FileEntry && !FileDirNdx->FileInfo)
         MyFreePool__(FileEntry);
     return STATUS_SUCCESS;
index 7b83008..9df62ba 100644 (file)
@@ -116,13 +116,13 @@ UDFPhReadSynchronous(
 #if !defined(LIBUDF) && !defined(LIBUDFFMT)
 
     NTSTATUS    RC;
-//    KdPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0xb,Offset>>0xb));
+//    UDFPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0xb,Offset>>0xb));
     LONG HiOffs = (ULONG)(Offset >> 32);
 
     RC = SetFilePointer(DeviceObject->h,(ULONG)Offset,&HiOffs,FILE_BEGIN);
     if(RC == INVALID_SET_FILE_POINTER) {
         if(GetLastError() != NO_ERROR) {
-            KdPrint(("UDFPhReadSynchronous: error %x\n", GetLastError()));
+            UDFPrint(("UDFPhReadSynchronous: error %x\n", GetLastError()));
             return STATUS_END_OF_FILE;
         }
     }
@@ -167,7 +167,7 @@ UDFPhWriteSynchronous(
     RC = SetFilePointer(DeviceObject->h,(ULONG)Offset,&HiOffs,FILE_BEGIN);
     if(RC == INVALID_SET_FILE_POINTER) {
         if(GetLastError() != NO_ERROR) {
-            KdPrint(("UDFPhWriteSynchronous: error %x\n", GetLastError()));
+            UDFPrint(("UDFPhWriteSynchronous: error %x\n", GetLastError()));
             return STATUS_END_OF_FILE;
         }
     }
@@ -180,7 +180,7 @@ UDFPhWriteSynchronous(
     if(!RC ||
         !(*WrittenBytes)) {
         RC = GetLastError();
-        KdPrint(("UDFPhWriteSynchronous: EOF, error %x\n", RC));
+        UDFPrint(("UDFPhWriteSynchronous: EOF, error %x\n", RC));
         RC = STATUS_END_OF_FILE;
     } else {
         RC = STATUS_SUCCESS;
@@ -426,7 +426,7 @@ my_retrieve_vol_type(
 #ifndef CDRW_W32
     if(wcslen(fn) == 2 && fn[1] == ':') {
         ULONG DevType = GetDriveTypeW(fn);
-        KdPrint(("  DevType %x\n", DevType));
+        UDFPrint(("  DevType %x\n", DevType));
         switch(DevType) {
         case DRIVE_CDROM:
             Vcb->PhDeviceType = FILE_DEVICE_CD_ROM;
@@ -500,18 +500,18 @@ my_open(
 
 #ifndef NT_NATIVE_MODE
     swprintf(deviceNameBuffer, L"%ws\\", fn);
-    KdPrint(("my_open: %S\n", fn));
+    UDFPrint(("my_open: %S\n", fn));
     i = sizeof(FSNameBuffer)/sizeof(FSNameBuffer[0]);
     if(GetVolumeInformationW(deviceNameBuffer, NULL, 0, 
         &returned, &returned, &returned, FSNameBuffer, i)) {
-        KdPrint(("my_open: FS: %S\n", FSNameBuffer));
+        UDFPrint(("my_open: FS: %S\n", FSNameBuffer));
         if(!wcscmp(FSNameBuffer, L"Unknown")) {
             retry++;
         }
     } else {
-        KdPrint(("my_open: FS: ???\n"));
+        UDFPrint(("my_open: FS: ???\n"));
     }
-    KdPrint(("my_open: retry %d times\n", retry));
+    UDFPrint(("my_open: retry %d times\n", retry));
 
 #endif //NT_NATIVE_MODE
 
@@ -532,7 +532,7 @@ my_open(
                            OPEN_EXISTING,
                            FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING,  NULL);
             if(h != ((HANDLE)-1)) {
-                KdPrint(("  opened i=%x\n", i));
+                UDFPrint(("  opened i=%x\n", i));
             }
         }
     }
@@ -558,7 +558,7 @@ my_open(
                                      NULL,
                                      0);
             if(!NT_SUCCESS(RC)) {
-                KdPrint(("  opened i2=%x\n", i));
+                UDFPrint(("  opened i2=%x\n", i));
                 h = ((HANDLE)-1);
             }
         }
@@ -580,22 +580,22 @@ my_open(
             if(retry < MAX_INVALIDATE_VOLUME_RETRY) {
                 retry++;
                 if(!Privilege(SE_TCB_NAME, TRUE)) {
-                    KdPrint(("SE_TCB privilege not held\n"));
+                    UDFPrint(("SE_TCB privilege not held\n"));
                 } else
                 if(DeviceIoControl(h,FSCTL_INVALIDATE_VOLUMES,&h,sizeof(h),NULL,0,&returned,NULL) ) {
-                    KdPrint(("  FSCTL_INVALIDATE_VOLUMES ok, status %x\n", GetLastError()));
+                    UDFPrint(("  FSCTL_INVALIDATE_VOLUMES ok, status %x\n", GetLastError()));
                     CloseHandle(h);
                     continue;
                 } else {
 //#ifndef CDRW_W32
-                    KdPrint(("  FSCTL_INVALIDATE_VOLUMES failed, error %x\n", GetLastError()));
+                    UDFPrint(("  FSCTL_INVALIDATE_VOLUMES failed, error %x\n", GetLastError()));
                     RC = GetLastError();
                     if(DeviceIoControl(h,IOCTL_UDF_INVALIDATE_VOLUMES,&h,sizeof(h),NULL,0,&returned,NULL) ) {
-                        KdPrint(("  IOCTL_UDF_INVALIDATE_VOLUMES ok, status %x\n", GetLastError()));
+                        UDFPrint(("  IOCTL_UDF_INVALIDATE_VOLUMES ok, status %x\n", GetLastError()));
                         CloseHandle(h);
                         continue;
                     }
-                    KdPrint(("  IOCTL_UDF_INVALIDATE_VOLUMES, error %x\n", GetLastError()));
+                    UDFPrint(("  IOCTL_UDF_INVALIDATE_VOLUMES, error %x\n", GetLastError()));
 //#endif //CDRW_W32
                 }
                 UserPrint(("can't lock volume, retry\n"));
@@ -614,11 +614,11 @@ my_open(
         }
 //#ifndef CDRW_W32
         if(!DeviceIoControl(h,FSCTL_ALLOW_EXTENDED_DASD_IO,NULL,0,NULL,0,&returned,NULL)) {
-            KdPrint(("Warning: can't allow extended DASD i/o\n"));
+            UDFPrint(("Warning: can't allow extended DASD i/o\n"));
         }
 //#endif //CDRW_W32
 
-        KdPrint(("  opened, h=%x\n", h));
+        UDFPrint(("  opened, h=%x\n", h));
         return h;
     }
     RC = GetLastError();
@@ -647,7 +647,7 @@ my_open(
 #endif //NT_NATIVE_MODE
     if(h != ((HANDLE)-1)) {
 
-        KdPrint(("  opened R/O, h=%x\n", h));
+        UDFPrint(("  opened R/O, h=%x\n", h));
 #ifndef CDRW_W32
         my_retrieve_vol_type(Vcb, fn);
 #else
@@ -660,7 +660,7 @@ my_open(
             if(retry < MAX_INVALIDATE_VOLUME_RETRY) {
                 retry++;
                 if(!Privilege(SE_TCB_NAME, TRUE)) {
-                    KdPrint(("SE_TCB privilege not held\n"));
+                    UDFPrint(("SE_TCB privilege not held\n"));
                 } else
                 if(DeviceIoControl(h,FSCTL_INVALIDATE_VOLUMES,&h,sizeof(h),NULL,0,&returned,NULL) ) {
                     CloseHandle(h);
@@ -744,7 +744,7 @@ try_as_file:
         return NULL;
 #endif //CDRW_W32
     }
-    KdPrint(("  opened as file, h=%x\n", h));
+    UDFPrint(("  opened as file, h=%x\n", h));
     break;
 
     } while(TRUE);
index e0fb220..ee22884 100644 (file)
@@ -305,7 +305,7 @@ _getopt_internal(
 
         if (ambig && !exact) {
             if (o->opterr) {
-                KdPrint(("%ws: option `%s' is ambiguous\n",
+                UDFPrint(("%ws: option `%s' is ambiguous\n",
                      argv[0], argv[o->optind]));
             }
             o->nextchar += my_strlen (o->nextchar);
@@ -326,12 +326,12 @@ _getopt_internal(
                     if (o->opterr) {
                         if (argv[o->optind - 1][1] == '-') {
                             /* --option */
-                            KdPrint((
+                            UDFPrint((
                                  "%ws: option `--%ws' doesn't allow an argument\n",
                                  argv[0], pfound->name));
                         } else {
                             /* +option or -option */
-                            KdPrint((
+                            UDFPrint((
                                  "%ws: option `%c%ws' doesn't allow an argument\n",
                                  argv[0], argv[o->optind - 1][0], pfound->name));
                         }
@@ -346,7 +346,7 @@ _getopt_internal(
                     o->optarg = argv[(o->optind)++];
                 } else {
                     if (o->opterr)
-                        KdPrint(("%ws: option `%ws' requires an argument\n",
+                        UDFPrint(("%ws: option `%ws' requires an argument\n",
                            argv[0], argv[o->optind - 1]));
                     o->nextchar += my_strlen (o->nextchar);
                     return optstring[0] == ':' ? ':' : BAD_OPTION;
@@ -372,11 +372,11 @@ _getopt_internal(
             {
                 if (argv[o->optind][1] == '-') {
                     /* --option */
-                    KdPrint(("%ws: unrecognized option `--%ws'\n",
+                    UDFPrint(("%ws: unrecognized option `--%ws'\n",
                          argv[0], o->nextchar));
                 } else {
                     /* +option or -option */
-                    KdPrint(("%ws: unrecognized option `%c%ws'\n",
+                    UDFPrint(("%ws: unrecognized option `%c%ws'\n",
                          argv[0], argv[o->optind][0], o->nextchar));
                 }
             }
@@ -400,7 +400,7 @@ _getopt_internal(
         {
             if (o->opterr)
             {
-                KdPrint(("%ws: illegal option -- %c\n", argv[0], c));
+                UDFPrint(("%ws: illegal option -- %c\n", argv[0], c));
             }
             o->optopt = c;
             return BAD_OPTION;
@@ -432,7 +432,7 @@ _getopt_internal(
                 {
                     if (o->opterr)
                     {
-                        KdPrint(("%ws: option requires an argument -- %c\n",
+                        UDFPrint(("%ws: option requires an argument -- %c\n",
                              argv[0], c));
                     }
                     o->optopt = c;
index 43fd593..1d253e0 100644 (file)
@@ -67,14 +67,14 @@ MyAllocDumpDescr(
     BOOLEAN Used;
 
     Used = (Allocs[i].Len & MY_HEAP_FLAG_USED) ? TRUE : FALSE;
-    KdPrint(("block %x \t%s addr %x len %x  \t", i, Used ? "used" : "free", Allocs[i].Addr, (Allocs[i].Len) & MY_HEAP_FLAG_LEN_MASK));
+    UDFPrint(("block %x \t%s addr %x len %x  \t", i, Used ? "used" : "free", Allocs[i].Addr, (Allocs[i].Len) & MY_HEAP_FLAG_LEN_MASK));
 #ifdef MY_HEAP_TRACK_OWNERS
-    KdPrint(("src %x   \t line %d     \t", Allocs[i].Src, Allocs[i].Line));
+    UDFPrint(("src %x   \t line %d     \t", Allocs[i].Src, Allocs[i].Line));
 #endif
 #ifdef MY_HEAP_TRACK_REF
-    KdPrint(("%s%s", Used ? " " : "-", Allocs[i].Tag ? Allocs[i].Tag : ""));
+    UDFPrint(("%s%s", Used ? " " : "-", Allocs[i].Tag ? Allocs[i].Tag : ""));
 #endif
-    KdPrint(("\n"));
+    UDFPrint(("\n"));
 }
 
 //#define CHECK_ALLOC_FRAMES
@@ -103,20 +103,20 @@ MyAllocDumpFrame(
 #endif //DUMP_MEM_FRAMES
         return;
 
-    KdPrint(("Dumping frame %x\n",Frame));
-    KdPrint(("FirstFree %x   LastUsed %x  ", FrameList[Frame].FirstFree, FrameList[Frame].LastUsed));
-    KdPrint(("Type %x\n", FrameList[Frame].Type));
+    UDFPrint(("Dumping frame %x\n",Frame));
+    UDFPrint(("FirstFree %x   LastUsed %x  ", FrameList[Frame].FirstFree, FrameList[Frame].LastUsed));
+    UDFPrint(("Type %x\n", FrameList[Frame].Type));
     if(Allocs) {
         for(i=0;i< (MY_HEAP_MAX_BLOCKS/*-1*/);i++) {
             Used = (Allocs[i].Len & MY_HEAP_FLAG_USED) ? TRUE : FALSE;
-            KdPrint(("block %x \t%s addr %x len %x  \t", i, Used ? "used" : "free", Allocs[i].Addr, (Allocs[i].Len) & MY_HEAP_FLAG_LEN_MASK));
+            UDFPrint(("block %x \t%s addr %x len %x  \t", i, Used ? "used" : "free", Allocs[i].Addr, (Allocs[i].Len) & MY_HEAP_FLAG_LEN_MASK));
 #ifdef MY_HEAP_TRACK_OWNERS
-            KdPrint(("src %x   \t line %d     \t", Allocs[i].Src, Allocs[i].Line));
+            UDFPrint(("src %x   \t line %d     \t", Allocs[i].Src, Allocs[i].Line));
 #endif
 #ifdef MY_HEAP_TRACK_REF
-            KdPrint(("%s%s", Used ? " " : "-", Allocs[i].Tag ? Allocs[i].Tag : ""));
+            UDFPrint(("%s%s", Used ? " " : "-", Allocs[i].Tag ? Allocs[i].Tag : ""));
 #endif
-            KdPrint(("\n"));
+            UDFPrint(("\n"));
             if(!(Allocs[i].Len) && !(Allocs[i].Addr)) {
                 break;
             }
@@ -124,7 +124,7 @@ MyAllocDumpFrame(
                 k += ((Allocs[i].Len) & MY_HEAP_FLAG_LEN_MASK);
         }
     }
-    KdPrint(("    Wasted %x bytes from %x\n", MY_HEAP_FRAME_SIZE - k, MY_HEAP_FRAME_SIZE));
+    UDFPrint(("    Wasted %x bytes from %x\n", MY_HEAP_FRAME_SIZE - k, MY_HEAP_FRAME_SIZE));
 } // end MyAllocDumpFrame()
 
 VOID
@@ -140,12 +140,12 @@ MyAllocDumpFrames(
         }
     }
 
-    KdPrint(("\n"));
+    UDFPrint(("\n"));
 
     for(i=0;i<MY_HEAP_MAX_FRAMES; i++) {
         if(FrameList[i].Frame) {
-            KdPrint(("Addr %x   ", FrameList[i].Frame));
-            KdPrint(("Type %x\n" , FrameList[i].Type));
+            UDFPrint(("Addr %x   ", FrameList[i].Frame));
+            UDFPrint(("Type %x\n" , FrameList[i].Type));
         }
     }
 
@@ -166,9 +166,9 @@ MyAllocCheck(
         addr = Allocs[i].Addr;
         if( len != (Allocs[i+1].Addr - addr) ) {
             if(Allocs[i+1].Addr) {
-                KdPrint(("ERROR! Memory block aliasing\n"));
-                KdPrint(("block %x, frame %x\n", i, Frame));
-                KdPrint(("block descriptor %x\n", &(Allocs[i]) ));
+                UDFPrint(("ERROR! Memory block aliasing\n"));
+                UDFPrint(("block %x, frame %x\n", i, Frame));
+                UDFPrint(("block descriptor %x\n", &(Allocs[i]) ));
                 BrutePoint();
                 MyAllocDumpFrame(Frame);
             }
@@ -291,7 +291,7 @@ MyAllocatePoolInFrame(
     Allocs->Tag = Tag;
 #endif //MY_HEAP_TRACK_REF
 
-//    KdPrint(( "Mem: Allocated %x at addr %x\n", size, (ULONG)addr ));
+//    UDFPrint(( "Mem: Allocated %x at addr %x\n", size, (ULONG)addr ));
     // this will set IntegrityTag to zero
     *((PULONG)addr) = 0x00000000;
 #ifdef MY_HEAP_CHECK_BOUNDS
@@ -320,7 +320,7 @@ MyFindMemDescByAddr(
 
     Allocs = FrameList[Frame].Frame;
 //    i = FrameList[Frame].LastUsed >> 1;
-//    KdPrint(("Mem: Freeing %x\n", (ULONG)addr)); DEADDA7A
+//    UDFPrint(("Mem: Freeing %x\n", (ULONG)addr)); DEADDA7A
 //    for(i=0;i<MY_HEAP_MAX_BLOCKS;i++) {
     left = 0;
     right = FrameList[Frame].LastUsed;
@@ -364,7 +364,7 @@ MyFreePoolInFrame(
     pc = 0;
     i = MyFindMemDescByAddr(Frame, addr);
     if(i < 0) {
-        KdPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!!   ;( \n", addr));
+        UDFPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!!   ;( \n", addr));
         MyAllocDumpFrame(Frame);
         BrutePoint();
         return;
@@ -451,7 +451,7 @@ MyResizePoolInFrame(
     Allocs = FrameList[Frame].Frame;
     i = MyFindMemDescByAddr(Frame, addr);
     if(i < 0) {
-        KdPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!!   ;( \n", addr));
+        UDFPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!!   ;( \n", addr));
         MyAllocDumpFrame(Frame);
         BrutePoint();
         return FALSE;
@@ -553,7 +553,7 @@ MyAllocInitFrame(
 
     Allocs = (PMEM_ALLOC_DESC)DbgAllocatePool(NonPagedPool, sizeof(MEM_ALLOC_DESC)*(MY_HEAP_MAX_BLOCKS+1));
     if(!Allocs) {
-        KdPrint(("Insufficient resources to allocate frame descriptor\n"));
+        UDFPrint(("Insufficient resources to allocate frame descriptor\n"));
         FrameList[Frame].Frame = NULL;
         MyAllocDumpFrames();
         BrutePoint();
@@ -563,7 +563,7 @@ MyAllocInitFrame(
     // alloc heap
     Allocs[0].Addr = (ULONG)DbgAllocatePool((POOL_TYPE)Type, MY_HEAP_FRAME_SIZE);
     if(!Allocs[0].Addr) {
-        KdPrint(("Insufficient resources to allocate frame\n"));
+        UDFPrint(("Insufficient resources to allocate frame\n"));
         DbgFreePool(Allocs);
         FrameList[Frame].Frame = NULL;
         MyAllocDumpFrames();
@@ -625,7 +625,7 @@ MyAllocatePool(
     ULONG i;
     ULONG addr;
 
-//    KdPrint(("MemFrames: %x\n",FrameCount));
+//    UDFPrint(("MemFrames: %x\n",FrameCount));
 
     if(!size || (size > MY_HEAP_FRAME_SIZE)) return NULL;
 
@@ -650,8 +650,8 @@ MyAllocatePool(
 #ifdef UDF_DBG
 //            if(addr >= (ULONG)BreakAddr && addr < sizeof(UDF_FILE_INFO) + (ULONG)BreakAddr) {
 //            if(addr<=(ULONG)BreakAddr && addr+sizeof(UDF_FILE_INFO) > (ULONG)BreakAddr) {
-//                KdPrint(("ERROR !!! Allocating in examined block\n"));
-//                KdPrint(("addr %x\n", addr));
+//                UDFPrint(("ERROR !!! Allocating in examined block\n"));
+//                UDFPrint(("addr %x\n", addr));
 //                MyAllocDumpFrame(i);
 //                BrutePoint();
 //            }
@@ -683,8 +683,8 @@ MyAllocatePool(
 #ifdef UDF_DBG
 //                if(addr >= (ULONG)BreakAddr && addr < sizeof(UDF_FILE_INFO) + (ULONG)BreakAddr) {
 //                if(addr<=(ULONG)BreakAddr && addr+sizeof(UDF_FILE_INFO) > (ULONG)BreakAddr) {
-//                    KdPrint(("ERROR !!! Allocating in examined block\n"));
-//                    KdPrint(("addr %x\n", addr));
+//                    UDFPrint(("ERROR !!! Allocating in examined block\n"));
+//                    UDFPrint(("addr %x\n", addr));
 //                    MyAllocDumpFrame(i);
 //                    BrutePoint();
 //                }
@@ -730,13 +730,13 @@ MyFreePool(
 {
     LONG i;
 
-//    KdPrint(("MemFrames: %x\n",FrameCount));
+//    UDFPrint(("MemFrames: %x\n",FrameCount));
 
     LockMemoryManager();
     i = MyFindFrameByAddr(addr);
     if(i < 0) {
         UnlockMemoryManager();
-        KdPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!!   ;( \n", addr));
+        UDFPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!!   ;( \n", addr));
         BrutePoint();
         return;
     }
@@ -744,8 +744,8 @@ MyFreePool(
 #ifdef UDF_DBG
             // BreakAddr <= addr < BreakAddr + sizeof(UDF_FILE_INFO)
 //            if((ULONG)addr >= (ULONG)BreakAddr && (ULONG)addr < sizeof(UDF_FILE_INFO) + (ULONG)BreakAddr) {
-//                KdPrint(("Deallocating in examined block\n"));
-//                KdPrint(("addr %x\n", addr));
+//                UDFPrint(("Deallocating in examined block\n"));
+//                UDFPrint(("addr %x\n", addr));
 //                MyAllocDumpFrame(i);
 //                BrutePoint();
 //                BreakAddr = NULL;
@@ -786,7 +786,7 @@ MyReallocPool(
     PCHAR Tag;
 #endif
 
-//    KdPrint(("MemFrames: %x\n",FrameCount));
+//    UDFPrint(("MemFrames: %x\n",FrameCount));
     (*NewBuff) = addr;
     if(OldLength == NewLength) return OldLength;
 
@@ -799,7 +799,7 @@ MyReallocPool(
     i = MyFindFrameByAddr(addr);
     if(i < 0) {
         UnlockMemoryManager();
-        KdPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!!   ;( \n", addr));
+        UDFPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!!   ;( \n", addr));
         BrutePoint();
         return 0;
     }
@@ -864,7 +864,7 @@ MyFindMemDescByRangeInFrame(
 
     Allocs = FrameList[Frame].Frame;
 //    i = FrameList[Frame].LastUsed >> 1;
-//    KdPrint(("Mem: Freeing %x\n", (ULONG)addr)); DEADDA7A
+//    UDFPrint(("Mem: Freeing %x\n", (ULONG)addr)); DEADDA7A
 //    for(i=0;i<MY_HEAP_MAX_BLOCKS;i++) {
     left = 0;
     right = FrameList[Frame].LastUsed;
@@ -907,7 +907,7 @@ MyFindMemBaseByAddr(
     Frame = MyFindFrameByAddr(addr);
     if(Frame < 0) {
         UnlockMemoryManager();
-        KdPrint(("Mem: <<<*** WARNING ***>>> Unknown base for %x !!!   ;( \n", addr));
+        UDFPrint(("Mem: <<<*** WARNING ***>>> Unknown base for %x !!!   ;( \n", addr));
         BrutePoint();
         return -1;
     }
index 77c34cb..45005a7 100644 (file)
@@ -27,7 +27,7 @@ UDFClrModified(
     IN PVCB        Vcb
     )
 {
-    KdPrint(("ClrModified\n"));
+    UDFPrint(("ClrModified\n"));
     UDFInterlockedDecrement((PLONG)&(Vcb->Modified));
 } // end UDFClrModified()
 
index 8bfff19..dbe411d 100644 (file)
@@ -53,7 +53,7 @@ UDFSyncCache(
     IN PVCB Vcb
     )
 {
-    KdPrint(("UDFSyncCache:\n"));
+    UDFPrint(("UDFSyncCache:\n"));
     OSSTATUS RC;
     RC = UDFPhSendIOCTL( IOCTL_CDRW_SYNC_CACHE, Vcb->TargetDeviceObject,
                     NULL,0, NULL,0, FALSE, NULL);
@@ -129,10 +129,10 @@ UDFTIOVerify(
 
     tmp_wb = (uint32)_Vcb;
     if(Flags & PH_EX_WRITE) {
-        KdPrint(("IO-Write-Verify\n"));
+        UDFPrint(("IO-Write-Verify\n"));
         RC = UDFTWrite(_Vcb, Buffer, Length, LBA, &tmp_wb, Flags | PH_VCB_IN_RETLEN);
     } else {
-        KdPrint(("IO-Read-Verify\n"));
+        UDFPrint(("IO-Read-Verify\n"));
         RC = UDFTRead(_Vcb, Buffer, Length, LBA, &tmp_wb, Flags | PH_VCB_IN_RETLEN);
     }
     (*IOBytes) = tmp_wb;
@@ -151,18 +151,18 @@ UDFTIOVerify(
     if(!Vcb->SparingCount ||
        !Vcb->SparingCountFree ||
        Vcb->CDR_Mode) {
-        KdPrint(("Can't remap\n"));
+        UDFPrint(("Can't remap\n"));
         UDFReleaseResource(&(Vcb->IoResource));
         return RC;
     }
 
     if(Flags & PH_EX_WRITE) {
-        KdPrint(("Write failed, try relocation\n"));
+        UDFPrint(("Write failed, try relocation\n"));
     } else {
         if(Vcb->Modified) {
-            KdPrint(("Read failed, try relocation\n"));
+            UDFPrint(("Read failed, try relocation\n"));
         } else {
-            KdPrint(("no remap on not modified volume\n"));
+            UDFPrint(("no remap on not modified volume\n"));
             UDFReleaseResource(&(Vcb->IoResource));
             return RC;
         }
@@ -187,7 +187,7 @@ UDFTIOVerify(
     } else {
         tmp_buff = (PUCHAR)DbgAllocatePoolWithTag(NonPagedPool, Vcb->SparingBlockSize << Vcb->BlockSizeBits, 'bNWD');
         if(!tmp_buff) {
-            KdPrint(("  can't alloc tmp\n"));
+            UDFPrint(("  can't alloc tmp\n"));
             UDFReleaseResource(&(Vcb->IoResource));
             return STATUS_DEVICE_DATA_ERROR;
         }
@@ -196,10 +196,10 @@ UDFTIOVerify(
 
     for(i=0; i<len; i++) {
         if(!Vcb->SparingCountFree) {
-            KdPrint(("  no more free spare blocks, abort verification\n"));
+            UDFPrint(("  no more free spare blocks, abort verification\n"));
             break;
         }
-        KdPrint(("  read LBA %x (%x)\n", lba0+i, j));
+        UDFPrint(("  read LBA %x (%x)\n", lba0+i, j));
         if(!j) {
             need_remap = FALSE;
             lba1 = lba0+i;
@@ -208,12 +208,12 @@ UDFTIOVerify(
                 // single packet requested
                 tmp_buff = (PUCHAR)Buffer;
                 if(Flags & PH_EX_WRITE) {
-                    KdPrint(("  remap single write\n"));
-                    KdPrint(("  try del from verify cache @ %x, %x\n", lba0, len));
+                    UDFPrint(("  remap single write\n"));
+                    UDFPrint(("  try del from verify cache @ %x, %x\n", lba0, len));
                     UDFVForget(Vcb, len, UDFRelocateSector(Vcb, lba0), 0);
                     goto do_remap;
                 } else {
-                    KdPrint(("  recover and remap single read\n"));
+                    UDFPrint(("  recover and remap single read\n"));
                 }
             }
         }
@@ -225,20 +225,20 @@ UDFTIOVerify(
         // check if block valid
         if(Vcb->BSBM_Bitmap) {
             if(UDFGetBit((uint32*)(Vcb->BSBM_Bitmap), UDFRelocateSector(Vcb, lba0+i))) {
-                KdPrint(("  remap: known BB @ %x, mapped to %x\n", lba0+i, UDFRelocateSector(Vcb, lba0+i)));
+                UDFPrint(("  remap: known BB @ %x, mapped to %x\n", lba0+i, UDFRelocateSector(Vcb, lba0+i)));
                 need_remap = TRUE;
             }
         }
         zero = FALSE;
         if(Vcb->FSBM_Bitmap) {
             if(UDFGetFreeBit((uint32*)(Vcb->FSBM_Bitmap), lba0+i)) {
-                KdPrint(("  unused @ %x\n", lba0+i));
+                UDFPrint(("  unused @ %x\n", lba0+i));
                 zero = TRUE;
             }
         }
         if(!zero && Vcb->ZSBM_Bitmap) {
             if(UDFGetZeroBit((uint32*)(Vcb->ZSBM_Bitmap), lba0+i)) {
-                KdPrint(("  unused @ %x (Z)\n", lba0+i));
+                UDFPrint(("  unused @ %x (Z)\n", lba0+i));
                 zero = TRUE;
             }
         }
@@ -257,7 +257,7 @@ UDFTIOVerify(
                 RC = STATUS_UNSUCCESSFUL;
             }
             if(RC == STATUS_SUCCESS) {
-                KdPrint(("  packet ok @ %x\n", lba0+i));
+                UDFPrint(("  packet ok @ %x\n", lba0+i));
                 packet_ok = TRUE;
                 i += Vcb->SparingBlockSize-1;
                 continue;
@@ -275,7 +275,7 @@ UDFTIOVerify(
                     RC = UDFTRead(_Vcb, p, Vcb->BlockSize, lba0+i, &tmp_wb,
                                   Flags | PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER | PH_VCB_IN_RETLEN);
                     if(!OS_SUCCESS(RC)) {
-                        KdPrint(("  Found BB @ %x\n", lba0+i));
+                        UDFPrint(("  Found BB @ %x\n", lba0+i));
                     }
 
                 }
@@ -306,12 +306,12 @@ UDFTIOVerify(
                 }
                 if(!OS_SUCCESS(RC)) {
 /*
-                    KdPrint(("  retry @ %x\n", lba0+i));
+                    UDFPrint(("  retry @ %x\n", lba0+i));
                     tmp_wb = (uint32)_Vcb;
                     RC = UDFTRead(_Vcb, p, Vcb->BlockSize, lba0+i, &tmp_wb,
                                   Flags | PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER | PH_VCB_IN_RETLEN);
 */
-                    KdPrint(("  try get from verify cache @ %x\n", lba0+i));
+                    UDFPrint(("  try get from verify cache @ %x\n", lba0+i));
                     RC = UDFVRead(Vcb, p, 1, UDFRelocateSector(Vcb, lba0+i),
                                   Flags | PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER);
                     need_remap = TRUE;
@@ -321,12 +321,12 @@ UDFTIOVerify(
             RtlZeroMemory(p, Vcb->BlockSize);
         }
         if(!packet_ok) {
-            KdPrint(("  try del from verify cache @ %x\n", lba0+i));
+            UDFPrint(("  try del from verify cache @ %x\n", lba0+i));
             RC = UDFVForget(Vcb, 1, UDFRelocateSector(Vcb, lba0+i), 0);
         }
 
         if(!packet_ok || need_remap) {
-            KdPrint(("  block in bad packet @ %x\n", lba0+i));
+            UDFPrint(("  block in bad packet @ %x\n", lba0+i));
             if(Vcb->BSBM_Bitmap) {
                 UDFSetBit(Vcb->BSBM_Bitmap, lba0+i);
             }
@@ -341,17 +341,17 @@ UDFTIOVerify(
             if(need_remap) {
                 ASSERT(!packet_ok);
                 if(!non_zero) {
-                    KdPrint(("  forget Z packet @ %x\n", lba1));
+                    UDFPrint(("  forget Z packet @ %x\n", lba1));
                     UDFUnmapRange(Vcb, lba1, Vcb->SparingBlockSize);
                     RC = STATUS_SUCCESS;
                 } else {
 do_remap:
                     for(j=0; j<3; j++) {
-                        KdPrint(("  remap packet @ %x\n", lba1));
+                        UDFPrint(("  remap packet @ %x\n", lba1));
                         RC = UDFRemapPacket(Vcb, lba1, FALSE);
                         if(!OS_SUCCESS(RC)) {
                             if(RC == STATUS_SHARING_VIOLATION) {
-                                KdPrint(("  remap2\n"));
+                                UDFPrint(("  remap2\n"));
                                 // remapped location have died
                                 RC = UDFRemapPacket(Vcb, lba1, TRUE);
                             }
@@ -360,26 +360,26 @@ do_remap:
                                 RC = STATUS_DEVICE_DATA_ERROR;
                             }
                         }
-                        KdPrint(("  remap status %x\n", RC));
+                        UDFPrint(("  remap status %x\n", RC));
                         if(OS_SUCCESS(RC)) {
                             // write to remapped area
                             tmp_wb = (uint32)_Vcb;
                             RC = UDFTWrite(_Vcb, tmp_buff, Vcb->SparingBlockSize << Vcb->BlockSizeBits, lba1, &tmp_wb,
                                           Flags | PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER | PH_VCB_IN_RETLEN);
-                            KdPrint(("  write status %x\n", RC));
+                            UDFPrint(("  write status %x\n", RC));
                             if(RC != STATUS_SUCCESS) {
                                 // will be remapped
-                                KdPrint(("  retry remap\n"));
+                                UDFPrint(("  retry remap\n"));
 
                                 // Note: when remap of already remapped block is requested, verify of
                                 // entire sparing are will be performed.
 
                             } else {
-                                KdPrint(("  remap OK\n"));
+                                UDFPrint(("  remap OK\n"));
                                 break;
                             }
                         } else {
-                            KdPrint(("  failed remap\n"));
+                            UDFPrint(("  failed remap\n"));
                             break;
                         }
                     } // for
@@ -388,7 +388,7 @@ do_remap:
                     final_RC = RC;
                 }
             } else {
-                KdPrint(("  NO remap for @ %x\n", (lba0+i) & ~mask));
+                UDFPrint(("  NO remap for @ %x\n", (lba0+i) & ~mask));
             }
             j=0;
         }
@@ -399,14 +399,14 @@ do_remap:
 
     tmp_wb = (uint32)_Vcb;
     if(Flags & PH_EX_WRITE) {
-        KdPrint(("IO-Write-Verify (2)\n"));
+        UDFPrint(("IO-Write-Verify (2)\n"));
         //RC = UDFTWrite(_Vcb, Buffer, Length, LBA, &tmp_wb, Flags | PH_FORGET_VERIFIED | PH_VCB_IN_RETLEN);
     } else {
-        KdPrint(("IO-Read-Verify (2)\n"));
+        UDFPrint(("IO-Read-Verify (2)\n"));
         RC = UDFTRead(_Vcb, Buffer, Length, LBA, &tmp_wb, Flags | PH_FORGET_VERIFIED | PH_VCB_IN_RETLEN);
     }
     (*IOBytes) = tmp_wb;
-    KdPrint(("Final %x\n", RC));
+    UDFPrint(("Final %x\n", RC));
 
     UDFReleaseResource(&(Vcb->IoResource));
     if(Flags & PH_LOCK_CACHE) {
@@ -481,10 +481,10 @@ UDFTWrite(
     (*WrittenBytes) = 0;
     BCount = Length>>Vcb->BlockSizeBits;
 
-    KdPrint(("TWrite %x (%x)\n", LBA, BCount));
+    UDFPrint(("TWrite %x (%x)\n", LBA, BCount));
 #ifdef _BROWSE_UDF_
     if(Vcb->VCBFlags & UDF_VCB_FLAGS_DEAD) {
-        KdPrint(("DEAD\n"));
+        UDFPrint(("DEAD\n"));
         return STATUS_NO_SUCH_DEVICE;
     }
 
@@ -492,7 +492,7 @@ UDFTWrite(
     if(!Vcb->CDR_Mode) {
         RelocExtent = UDFRelocateSectors(Vcb, LBA, BCount);
         if(!RelocExtent) {
-            KdPrint(("can't relocate\n"));
+            UDFPrint(("can't relocate\n"));
             return STATUS_INSUFFICIENT_RESOURCES;
         }
         rLba = LBA;
@@ -522,7 +522,7 @@ UDFTWrite(
 retry_1:
             RC = UDFPrepareForWriteOperation(Vcb, rLba, BCount);
             if(!OS_SUCCESS(RC)) {
-                KdPrint(("prepare failed\n"));
+                UDFPrint(("prepare failed\n"));
                 try_return(RC);
             }
             if(Flags & PH_VCB_IN_RETLEN) {
@@ -550,7 +550,7 @@ retry_1:
 retry_2:
             RC = UDFPrepareForWriteOperation(Vcb, rLba, BCount);
             if(!OS_SUCCESS(RC)) {
-                KdPrint(("prepare failed (2)\n"));
+                UDFPrint(("prepare failed (2)\n"));
                 break;
             }
             if(Flags & PH_VCB_IN_RETLEN) {
@@ -580,7 +580,7 @@ try_exit: NOTHING;
         }
 #endif //_BROWSE_UDF_
     } _SEH2_END;
-    KdPrint(("TWrite: %x\n", RC));
+    UDFPrint(("TWrite: %x\n", RC));
     return RC;
 
 #undef Vcb
@@ -823,10 +823,10 @@ UDFSetMRWMode(
 //#endif //_BROWSE_UDF_
 
     if(!Vcb->MRWStatus) {
-        KdPrint(("Non-MRW disk. Skip setting MRW_MODE\n"));
+        UDFPrint(("Non-MRW disk. Skip setting MRW_MODE\n"));
         return STATUS_SUCCESS;
     }
-    KdPrint(("try set MRW_MODE\n"));
+    UDFPrint(("try set MRW_MODE\n"));
     RC = UDFPhSendIOCTL(IOCTL_CDRW_GET_MRW_MODE, Vcb->TargetDeviceObject,
                     NULL,0,
                     (PVOID)&MRWPage,sizeof(MRWPage),
@@ -834,14 +834,14 @@ UDFSetMRWMode(
     if(!NT_SUCCESS(RC)) {
         return RC;
     }
-    KdPrint(("GET_MRW_MODE ok (current %x)\n", MRWPage.AddressMode));
+    UDFPrint(("GET_MRW_MODE ok (current %x)\n", MRWPage.AddressMode));
     MRWPage.AddressMode = Vcb->MRWStatus ? 0 : MrwPage_use_GAA;
-    KdPrint(("SET_MRW_MODE %x\n", MRWPage.AddressMode));
+    UDFPrint(("SET_MRW_MODE %x\n", MRWPage.AddressMode));
     RC = UDFPhSendIOCTL(IOCTL_CDRW_SET_MRW_MODE, Vcb->TargetDeviceObject,
                     (PVOID)&MRWPage,sizeof(MRWPage),
                     NULL,0,
                     FALSE, NULL);
-    KdPrint(("SET_MRW_MODE status %x\n", RC));
+    UDFPrint(("SET_MRW_MODE status %x\n", RC));
 
     return STATUS_SUCCESS;
 } // end UDFSetMRWMode()
@@ -853,7 +853,7 @@ UDFDoOPC(
 {
     OSSTATUS RC;
     if(Vcb->OPCNum && !Vcb->OPCDone) {
-        KdPrint(("UDFDoOPC\n"));
+        UDFPrint(("UDFDoOPC\n"));
         if(!Vcb->OPCh) {
             Vcb->OPCh =
                 (PSEND_OPC_INFO_HEADER_USER_IN)MyAllocatePool__(NonPagedPool,
@@ -868,7 +868,7 @@ UDFDoOPC(
                         NULL,0,
                         FALSE, NULL);
         if(!OS_SUCCESS(RC)) {
-            KdPrint(("UDFDoOPC failed\n"));
+            UDFPrint(("UDFDoOPC failed\n"));
             Vcb->OPCNum = 0;
 //            Vcb->VCBFlags |= UDF_VCB_FLAGS_OPC_FAILED;
         }
@@ -908,7 +908,7 @@ UDFPrepareForWriteOperation(
         ULONG i;
         for(i=0; i<BCount; i++) {
             if(UDFGetBit((uint32*)(Vcb->BSBM_Bitmap), Lba+i)) {
-                KdPrint(("W: Known BB @ %#x\n", Lba));
+                UDFPrint(("W: Known BB @ %#x\n", Lba));
                 //return STATUS_FT_WRITE_RECOVERY; // this shall not be treated as error and
                                                    // we shall get IO request to BAD block
                 return STATUS_DEVICE_DATA_ERROR;
@@ -932,7 +932,7 @@ UDFPrepareForWriteOperation(
 #endif //UDF_FORMAT_MEDIA
        !(Vcb->VCBFlags & UDF_VCB_FLAGS_OUR_DEVICE_DRIVER)
        ) {
-        KdPrint(("Skip prepare for Write @%x\n", Lba));
+        UDFPrint(("Skip prepare for Write @%x\n", Lba));
         return STATUS_SUCCESS;
     }
 
@@ -956,7 +956,7 @@ UDFPrepareForWriteOperation(
         // Ok, we needn't change Write Parameters
 //        if(Vcb->TrackMap[Vcb->LastModifiedTrack].Flags & TrackMap_Try_variation)
 //            Vcb->TrackMap[Vcb->LastModifiedTrack].Flags |= TrackMap_Use_variation;
-        KdPrint(("Skip prepare for Write (2) @%x\n", Lba));
+        UDFPrint(("Skip prepare for Write (2) @%x\n", Lba));
         return STATUS_SUCCESS;
     }
 
@@ -973,7 +973,7 @@ UDFPrepareForWriteOperation(
     for(uint32 i=Vcb->FirstTrackNum; i<=Vcb->LastTrackNum; i++) {
         if((Vcb->TrackMap[i].FirstLba > Lba) ||
            (Vcb->TrackMap[i].LastLba < Lba)) {
-            //KdPrint(("not in track %d\n"));
+            //UDFPrint(("not in track %d\n"));
             continue;
         }
         OSSTATUS RC;
@@ -989,7 +989,7 @@ UDFPrepareForWriteOperation(
                 (PGET_WRITE_MODE_USER_OUT)MyAllocatePool__(NonPagedPool, 512);
         }
         if(!(WParams = Vcb->WParams)) {
-            KdPrint(("!WParams\n"));
+            UDFPrint(("!WParams\n"));
             return STATUS_INSUFFICIENT_RESOURCES;
         }
 
@@ -1005,7 +1005,7 @@ UDFPrepareForWriteOperation(
                 return STATUS_SUCCESS;
             }
 #endif //UDF_FORMAT_MEDIA
-            KdPrint(("!get WParams\n"));
+            UDFPrint(("!get WParams\n"));
             return RC;
         }
         // clear unnecassary flags
@@ -1072,7 +1072,7 @@ UDFPrepareForWriteOperation(
                 return STATUS_SUCCESS;
             }
 #endif //UDF_FORMAT_MEDIA
-            KdPrint(("  inv sector mode\n"));
+            UDFPrint(("  inv sector mode\n"));
             return STATUS_INVALID_PARAMETER;
         }
         // set packet size
@@ -1132,7 +1132,7 @@ UDFPrepareForWriteOperation(
 
 check_dvd_bg_format:
 
-        KdPrint(("  check BGF\n"));
+        UDFPrint(("  check BGF\n"));
         if(!Vcb->CDR_Mode) {
             if(OS_SUCCESS(RC)) {
                 Vcb->LastModifiedTrack = i;
@@ -1167,18 +1167,18 @@ check_dvd_bg_format:
             ASSERT((Vcb->LastLBA+1) == Vcb->NWA);
 
             if(Lba+BCount <= (Vcb->LastLBA+1) ) {
-                KdPrint(("DVD cont. fmt, LBA+BCount<=NWA, exiting\n"));
+                UDFPrint(("DVD cont. fmt, LBA+BCount<=NWA, exiting\n"));
                 return STATUS_SUCCESS;
             }
             if((Vcb->MRWStatus != DiscInfo_BGF_Interrupted) &&
                (Lba <= (Vcb->LastLBA+1)) ) {
-                KdPrint(("!PausedBGF + DVD cont. fmt, LBA<=NWA, exiting\n"));
+                UDFPrint(("!PausedBGF + DVD cont. fmt, LBA<=NWA, exiting\n"));
                 return STATUS_SUCCESS;
             }
 
             if(Vcb->MRWStatus == DiscInfo_BGF_Interrupted) {
                 // This code also can restart background MRW formatting
-                KdPrint(("DVD cont. fmt, LastLBA %x, Lba %x\n", Vcb->LastLBA, Lba));
+                UDFPrint(("DVD cont. fmt, LastLBA %x, Lba %x\n", Vcb->LastLBA, Lba));
 
                 ForBuf = (PFORMAT_CDRW_PARAMETERS_USER_IN)DbgAllocatePoolWithTag(NonPagedPool, sizeof(FORMAT_CDRW_PARAMETERS_USER_IN), 'zNWD');
                 if(ForBuf) {
@@ -1191,7 +1191,7 @@ check_dvd_bg_format:
                             NULL,0,FALSE, NULL);
                     DbgFreePool(ForBuf);
                     if(OS_SUCCESS(RC)) {
-                        KdPrint(("BGFormat restarted Interrupted->InProgress\n"));
+                        UDFPrint(("BGFormat restarted Interrupted->InProgress\n"));
                         Vcb->MRWStatus = DiscInfo_BGF_InProgress;
                     } else {
                         PGET_LAST_ERROR_USER_OUT Error = NULL;
@@ -1205,7 +1205,7 @@ check_dvd_bg_format:
                                             NULL,0,
                                             Error,sizeof(GET_LAST_ERROR_USER_OUT),
                                             TRUE,NULL);
-                            KdPrint(("SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
+                            UDFPrint(("SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
                                      Error->SenseKey, Error->AdditionalSenseCode, Error->AdditionalSenseCodeQualifier, Error->LastError));
                             // check for Long Write In Progress
                             if( (Error->SenseKey == SCSI_SENSE_NOT_READY) &&
@@ -1213,7 +1213,7 @@ check_dvd_bg_format:
                                  ((Error->AdditionalSenseCodeQualifier == SCSI_SENSEQ_LONG_WRITE_IN_PROGRESS) ||
                                   (Error->AdditionalSenseCodeQualifier == SCSI_SENSEQ_FORMAT_IN_PROGRESS)) ) {
                                 RC = STATUS_SUCCESS;
-                                KdPrint(("Seems, BGFormat already restarted\n"));
+                                UDFPrint(("Seems, BGFormat already restarted\n"));
                                 Vcb->MRWStatus = DiscInfo_BGF_InProgress;
                             }
                         }
@@ -1223,7 +1223,7 @@ check_dvd_bg_format:
                 RC = STATUS_SUCCESS;
             }
 
-            KdPrint(("DVD cont. write, LastLBA %x, Lba %x\n", Vcb->LastLBA, Lba));
+            UDFPrint(("DVD cont. write, LastLBA %x, Lba %x\n", Vcb->LastLBA, Lba));
 
             ASSERT(Vcb->MediaClassEx == CdMediaClass_DVDRW);
             if(!Vcb->fZBuffer) {
@@ -1246,30 +1246,30 @@ retry_1:
                     RC = UDFPhWriteVerifySynchronous(Vcb->TargetDeviceObject, Vcb->fZBuffer, PSz,
                            ((uint64)fLba) << Vcb->BlockSizeBits, &WrittenBytes, PH_TMP_BUFFER);
                     Vcb->VCBFlags |= UDF_VCB_SKIP_EJECT_CHECK;
-                    KdPrint(("Fmt status: %x\n", RC));
+                    UDFPrint(("Fmt status: %x\n", RC));
 #ifdef _BROWSE_UDF_
                     if(!OS_SUCCESS(RC) &&
                         OS_SUCCESS(RC = UDFRecoverFromError(Vcb, TRUE, RC, fLba, BCount, &retry)) ) {
                         goto retry_1;
-                        KdPrint(("Fmt retry\n"));
+                        UDFPrint(("Fmt retry\n"));
                     }
 #endif //_BROWSE_UDF_
                     if(!OS_SUCCESS(RC)) {
                         BrutePoint();
-                        KdPrint(("Fmt break on ERROR\n"));
+                        UDFPrint(("Fmt break on ERROR\n"));
                         break;
                     }
                     UDFUpdateNWA(Vcb, fLba, BCount, RC);
                 }
             }
         } else {
-            KdPrint(("  no special processing\n"));
+            UDFPrint(("  no special processing\n"));
         }
         
         return RC;
     }
 #endif //UDF_READ_ONLY_BUILD
-    KdPrint(("  no suitable track!\n"));
+    UDFPrint(("  no suitable track!\n"));
     return STATUS_INVALID_PARAMETER;
 } // end UDFPrepareForWriteOperation()
 
@@ -1308,14 +1308,14 @@ UDFRecoverFromError(
                 try_return(status);
         }
         if(status == STATUS_NO_SUCH_DEVICE) {
-            KdPrint(("Error recovery: STATUS_NO_SUCH_DEVICE, die.....\n"));
+            UDFPrint(("Error recovery: STATUS_NO_SUCH_DEVICE, die.....\n"));
             Vcb->VCBFlags |= UDF_VCB_FLAGS_UNSAFE_IOCTL | UDF_VCB_FLAGS_DEAD;
             try_return(status);
         }
 
 #ifdef _UDF_STRUCTURES_H_
         if(status == STATUS_NO_MEDIA_IN_DEVICE && !Vcb->EjectWaiter) {
-            KdPrint(("Error recovery: STATUS_NO_MEDIA_IN_DEVICE, prevent further remount.....\n"));
+            UDFPrint(("Error recovery: STATUS_NO_MEDIA_IN_DEVICE, prevent further remount.....\n"));
             // Make sure, that volume will never be quick-remounted
             // It is very important for ChkUdf utility and
             // some CD-recording libraries
@@ -1329,7 +1329,7 @@ UDFRecoverFromError(
                         NULL,0,
                         Error,sizeof(GET_LAST_ERROR_USER_OUT),
                         TRUE,NULL);
-        KdPrint(("SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
+        UDFPrint(("SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
                  Error->SenseKey, Error->AdditionalSenseCode, Error->AdditionalSenseCodeQualifier, Error->LastError));
         // check for Long Write In Progress
         if( ((Error->SenseKey == SCSI_SENSE_NOT_READY) &&
@@ -1338,28 +1338,28 @@ UDFRecoverFromError(
             // we should wait...
             if(WriteOp) {
                 if((*retry) == UDF_WRITE_MAX_RETRY-1) {
-                    KdPrint(("Error recovery: reserve retry count for write retries\n"));
+                    UDFPrint(("Error recovery: reserve retry count for write retries\n"));
                     (*retry) = UDF_WRITE_MAX_RETRY*3;
                 } else
                 if((*retry) == UDF_WRITE_MAX_RETRY) {
-                    KdPrint(("Error recovery: jump over UDF_WRITE_MAX_RETRY\n"));
+                    UDFPrint(("Error recovery: jump over UDF_WRITE_MAX_RETRY\n"));
                     (*retry)--;
                 }
                 delay.QuadPart = -500000; // 0.05 sec
                 KeDelayExecutionThread(KernelMode, FALSE, &delay);
                 if(WriteOp && ((*retry) > UDF_WRITE_MAX_RETRY-1)) {
-                    KdPrint(("Error recovery: simple write retry with delay\n"));
+                    UDFPrint(("Error recovery: simple write retry with delay\n"));
                     try_return(status = STATUS_SUCCESS);
                 }
             } else {
                 delay.QuadPart = -500000; // 0.05 sec
                 KeDelayExecutionThread(KernelMode, FALSE, &delay);
                 if((*retry) == UDF_WRITE_MAX_RETRY-1) {
-                    KdPrint(("Error recovery: retry read after small delay\n"));
+                    UDFPrint(("Error recovery: retry read after small delay\n"));
                     try_return(status = STATUS_SUCCESS);
                 }
             }
-            KdPrint(("Error recovery: sync cache\n"));
+            UDFPrint(("Error recovery: sync cache\n"));
             // ...flush device cache...
             UDFSyncCache(Vcb);
             // wait again & retry
@@ -1377,7 +1377,7 @@ UDFRecoverFromError(
            (Error->AdditionalSenseCodeQualifier == SCSI_SENSEQ_BECOMING_READY) ||
            (Error->AdditionalSenseCodeQualifier == SCSI_SENSEQ_OPERATION_IN_PROGRESS) ) ) {
             // we should wait & retry
-            KdPrint(("Error recovery: op. in progress, waiting 0.3 sec\n"));
+            UDFPrint(("Error recovery: op. in progress, waiting 0.3 sec\n"));
             delay.QuadPart = -3000000; // 0.3 sec
             KeDelayExecutionThread(KernelMode, FALSE, &delay);
 #ifdef _UDF_STRUCTURES_H_
@@ -1391,10 +1391,10 @@ UDFRecoverFromError(
            (Error->AdditionalSenseCode == SCSI_ADSENSE_INVALID_CMD_SEQUENCE)) {
             // we should wait & retry
             if(!WriteOp) {
-                KdPrint(("Error recovery: invalid command sequence on read\n"));
+                UDFPrint(("Error recovery: invalid command sequence on read\n"));
                 delay.QuadPart = -1000000; // 0.1 sec
                 KeDelayExecutionThread(KernelMode, FALSE, &delay);
-                KdPrint(("Error recovery: sync cache\n"));
+                UDFPrint(("Error recovery: sync cache\n"));
                 // ...flush device cache...
                 UDFSyncCache(Vcb);
                 // wait again & retry
@@ -1411,7 +1411,7 @@ UDFRecoverFromError(
         if((Error->SenseKey == SCSI_SENSE_UNIT_ATTENTION) &&
            (Error->AdditionalSenseCode == SCSI_ADSENSE_BUS_RESET) ) {
             // we should wait
-            KdPrint(("Error recovery: bus reset...\n"));
+            UDFPrint(("Error recovery: bus reset...\n"));
             Vcb->MediaChangeCount = Error->MediaChangeCount;
             delay.QuadPart = -1000000; // 0.1 sec
             KeDelayExecutionThread(KernelMode, FALSE, &delay);
@@ -1504,11 +1504,11 @@ bad_rw_seek_recovery:
             } else
             if((Vcb->CompatFlags & UDF_VCB_IC_BAD_RW_SEEK) &&
                (Vcb->IncrementalSeekState != INCREMENTAL_SEEK_DONE)) {
-                KdPrint(("Using incremental seek workaround...\n"));
+                UDFPrint(("Using incremental seek workaround...\n"));
                 Vcb->IncrementalSeekState = INCREMENTAL_SEEK_WORKAROUND;
                 try_return(status = STATUS_SUCCESS);
             } else {
-                KdPrint(("Seems to be BB @ %x\n", Lba));
+                UDFPrint(("Seems to be BB @ %x\n", Lba));
                 UpdateBB = TRUE;
             }
         } else
@@ -1517,7 +1517,7 @@ bad_rw_seek_recovery:
             if(WriteOp &&
                (Vcb->SavedFeatures & CDRW_FEATURE_STREAMING) &&
                Lba+BCount <= Vcb->LastLBA+1) {
-                KdPrint(("bad Session in streaming mode. Lba %x, try fix-up\n", Lba));
+                UDFPrint(("bad Session in streaming mode. Lba %x, try fix-up\n", Lba));
                 // ...flush device cache...
                 UDFSyncCache(Vcb);
                 // we should wait
@@ -1529,7 +1529,7 @@ bad_rw_seek_recovery:
         if((Error->LastError == CDRW_ERR_WRITE_IN_PROGRESS_BUSY) ||
            (status == STATUS_DEVICE_BUSY)) {
             delay.QuadPart = -5000000; // 0.5 sec
-            KdPrint(("CDRW_ERR_WRITE_IN_PROGRESS_BUSY || STATUS_DEVICE_BUSY\n"));
+            UDFPrint(("CDRW_ERR_WRITE_IN_PROGRESS_BUSY || STATUS_DEVICE_BUSY\n"));
             KeDelayExecutionThread(KernelMode, FALSE, &delay);
 #ifdef _UDF_STRUCTURES_H_
             if(Vcb->BGWriters) (*retry)++;
@@ -1553,15 +1553,15 @@ bad_rw_seek_recovery:
             (Error->AdditionalSenseCode == SCSI_ADSENSE_SEEK_ERROR))*/ &&
            !WriteOp) {
             if(Error->AdditionalSenseCode == SCSI_ADSENSE_SEEK_ERROR) {
-                KdPrint(("Seek error\n"));
+                UDFPrint(("Seek error\n"));
                 if(Vcb->CompatFlags & UDF_VCB_IC_BAD_RW_SEEK) {
-                    KdPrint(("try recovery\n"));
+                    UDFPrint(("try recovery\n"));
                     goto bad_rw_seek_recovery;
                 }
-                KdPrint(("map error to STATUS_NONEXISTENT_SECTOR\n"));
+                UDFPrint(("map error to STATUS_NONEXISTENT_SECTOR\n"));
                 status = STATUS_NONEXISTENT_SECTOR;
             }
-            KdPrint(("Seems to be BB @ %x (read 2)\n", Lba));
+            UDFPrint(("Seems to be BB @ %x (read 2)\n", Lba));
             UpdateBB = TRUE;
         } else
         // handle invalid block address
@@ -1570,7 +1570,7 @@ bad_rw_seek_recovery:
             if(!WriteOp &&
                (Vcb->SavedFeatures & CDRW_FEATURE_STREAMING) &&
                Lba+BCount <= Vcb->LastLBA+1) {
-                KdPrint(("bad LBA %x in streaming mode, try fix-up\n", Lba));
+                UDFPrint(("bad LBA %x in streaming mode, try fix-up\n", Lba));
                 // ...flush device cache...
                 UDFSyncCache(Vcb);
                 try_return(status = STATUS_SUCCESS);
@@ -1578,7 +1578,7 @@ bad_rw_seek_recovery:
 
             if((Lba+BCount >= Vcb->LastLBA) &&
                (Vcb->MRWStatus == DiscInfo_BGF_Interrupted)) {
-                KdPrint(("stupid drive, cannot read beyond formatted area on DiscInfo_BGF_Interrupted\n"));
+                UDFPrint(("stupid drive, cannot read beyond formatted area on DiscInfo_BGF_Interrupted\n"));
                 UpdateBB = FALSE;
                 try_return(status = STATUS_BUFFER_ALL_ZEROS);
             }
@@ -1590,7 +1590,7 @@ try_exit: NOTHING;
     } _SEH2_FINALLY {
 #ifdef UDF_DBG
         if(OS_SUCCESS(status)) {
-            KdPrint(("Retry\n"));
+            UDFPrint(("Retry\n"));
         }
 #endif //UDF_DBG
     } _SEH2_END;
@@ -1607,18 +1607,18 @@ try_exit: NOTHING;
                 if(bm) {
                     RtlZeroMemory(bm, i);
                 } else {
-                    KdPrint(("Can't alloc BSBM for %x blocks\n", Vcb->LastPossibleLBA));
+                    UDFPrint(("Can't alloc BSBM for %x blocks\n", Vcb->LastPossibleLBA));
                 }
             }
             if(bm) {
                 UDFSetBit(bm, Lba);
-                KdPrint(("Set BB @ %#x\n", Lba));
+                UDFPrint(("Set BB @ %#x\n", Lba));
             }
 #ifdef _BROWSE_UDF_
             bm = (uint32*)(Vcb->FSBM_Bitmap);
             if(bm) {
                 UDFSetUsedBit(bm, Lba);
-                KdPrint(("Set BB @ %#x as used\n", Lba));
+                UDFPrint(("Set BB @ %#x as used\n", Lba));
             }
 #endif //_BROWSE_UDF_
         }
@@ -1662,7 +1662,7 @@ MRWRetry_label:
                 NULL, 0, 
                 DiscInfo,sizeof(DISC_INFO_BLOCK_USER_OUT), TRUE, NULL);
         if(!OS_SUCCESS(RC)) {
-            KdPrint(("ReadDiskInfo failed. Use default.\n"));
+            UDFPrint(("ReadDiskInfo failed. Use default.\n"));
             if(Vcb->MediaClassEx == CdMediaClass_DVDRW ||
                 Vcb->MediaClassEx == CdMediaClass_DVDpRW ||
                 Vcb->MediaClassEx == CdMediaClass_DVDRAM) {
@@ -1685,17 +1685,17 @@ MRWRetry_label:
                 NULL, 0, 
                 &CapacityBuffer,sizeof(READ_CAPACITY_USER_OUT), TRUE, NULL);
         if(!OS_SUCCESS(RC)) {
-            KdPrint(("ReadCapacity failed.\n"));
+            UDFPrint(("ReadCapacity failed.\n"));
             if(Vcb->MediaClassEx == CdMediaClass_DVDpRW) {
                 Vcb->LastPossibleLBA = DEFAULT_LAST_LBA_DVD;
             }
         } else {
-            KdPrint(("ReadCapacity ok.\n"));
-            KdPrint(("Last possible LBA %#x.\n", CapacityBuffer.LogicalBlockAddress));
+            UDFPrint(("ReadCapacity ok.\n"));
+            UDFPrint(("Last possible LBA %#x.\n", CapacityBuffer.LogicalBlockAddress));
             if(!(CapacityBuffer.LogicalBlockAddress  & 0xc0000000) &&
                 (CapacityBuffer.LogicalBlockAddress != 0x7fffffff)) {
                 // good value from ReadCapacity
-                KdPrint(("Update Last possible LBA %#x.\n", CapacityBuffer.LogicalBlockAddress));
+                UDFPrint(("Update Last possible LBA %#x.\n", CapacityBuffer.LogicalBlockAddress));
                 Vcb->LastPossibleLBA = CapacityBuffer.LogicalBlockAddress;
 //                ReadCapacityOk = TRUE;
 #ifdef UDF_FORMAT_MEDIA
@@ -1715,7 +1715,7 @@ MRWRetry_label:
         // save OPC info
         if(DiscInfo->OPCNum)
             Vcb->OPCNum = DiscInfo->OPCNum;
-        KdPrint(("DiskInfo: SN %x, OPCn %x(%x), Stat %x, Flg: %x\n",
+        UDFPrint(("DiskInfo: SN %x, OPCn %x(%x), Stat %x, Flg: %x\n",
             Vcb->PhSerialNumber, Vcb->OPCNum, DiscInfo->OPCNum, DiscInfo->DiscStat.Flags, DiscInfo->Flags.Flags));
 #ifdef UDF_FORMAT_MEDIA
         if(fms && fms->opt_disk_info) {
@@ -1782,7 +1782,7 @@ MRWRetry_label:
         // Save disk status
         Vcb->DiscStat = DiscInfo->DiscStat.Flags;
         if((DiscInfo->DiscStat.Flags & DiscInfo_Disk_Mask) == DiscInfo_Disk_Empty) {
-            KdPrint(("Blank\n"));
+            UDFPrint(("Blank\n"));
             Vcb->BlankCD = TRUE;
         }
         if( (DiscInfo->DiscStat.Flags & DiscInfo_Disk_Mask) == DiscInfo_Disk_Empty ||
@@ -1790,7 +1790,7 @@ MRWRetry_label:
             // we shall mount empty disk to make it possible for
             // external applications to perform format operation
             // or something like this
-            KdPrint(("Try RAW_MOUNT\n"));
+            UDFPrint(("Try RAW_MOUNT\n"));
             Vcb->VCBFlags |= UDF_VCB_FLAGS_RAW_DISK;
             PacketTrack = TRUE;
         }
@@ -1801,7 +1801,7 @@ MRWRetry_label:
         if(Vcb->MediaClassEx != CdMediaClass_DVDpRW &&
            !ReadCapacityOk) {
             // +RW returns bad value
-            KdPrint(("+RW returns bad value\n"));
+            UDFPrint(("+RW returns bad value\n"));
             Vcb->LastPossibleLBA = (DiscInfo->LastSesLeadOutLBA & 0x80000000) ?
                 0 : DiscInfo->LastSesLeadOutLBA;
             if(!(DiscInfo->LastSesLeadInLBA & 0x80000000)) {
@@ -1810,7 +1810,7 @@ MRWRetry_label:
         }
 #endif // _BROWSE_UDF_
         if((DiscInfo->Flags.Flags & DiscInfo_BGF_Mask) != 0) {
-            KdPrint(("ForceFP + MRW\n"));
+            UDFPrint(("ForceFP + MRW\n"));
             ForceFP = TRUE;
             Vcb->MRWStatus = DiscInfo->Flags.Flags & DiscInfo_BGF_Mask;
             // update addressing mode
@@ -1820,22 +1820,22 @@ MRWRetry_label:
                 goto MRWRetry_label;
             }
         }
-        KdPrint(("MRW state %x\n", Vcb->MRWStatus));
+        UDFPrint(("MRW state %x\n", Vcb->MRWStatus));
         if(Vcb->MediaClassEx == CdMediaClass_DVDRW) {
             if(Vcb->PhMediaCapFlags & CdCapFlags_RandomWritable) {
-                KdPrint(("DVD-RW Rewritable\n"));
+                UDFPrint(("DVD-RW Rewritable\n"));
                 ForceFP = TRUE;
             } else
             if((DiscInfo->DiscStat.Flags & DiscInfo_Disk_Mask) == DiscInfo_Disk_Empty) {
-                KdPrint(("Blank DVD-RW\n"));
+                UDFPrint(("Blank DVD-RW\n"));
                 ForceFP = TRUE;
             } else {
-                KdPrint(("DVD-RW Sequential\n"));
+                UDFPrint(("DVD-RW Sequential\n"));
                 NotFP = TRUE;
             }
         } else
         if(CdrwIsDvdOverwritable(Vcb->MediaClassEx)) {
-            KdPrint(("force Rewritable (2)\n"));
+            UDFPrint(("force Rewritable (2)\n"));
             ForceFP = TRUE;
         }
         // We have incomplete last session, so process each track from last to first
@@ -1847,10 +1847,10 @@ MRWRetry_label:
         // some devices report LastTrackNum=0 for full disks
         Vcb->LastTrackNum = max(Vcb->LastTrackNum, Vcb->FirstTrackNum);
         if(!Vcb->LastTrackNum) {
-            KdPrint(("Try read 1st track...\n"));
+            UDFPrint(("Try read 1st track...\n"));
             Vcb->LastTrackNum = 1;
         }
-        KdPrint(("DiskInfo: 1st trk %x, last trk %x\n", Vcb->FirstTrackNum, Vcb->LastTrackNum));
+        UDFPrint(("DiskInfo: 1st trk %x, last trk %x\n", Vcb->FirstTrackNum, Vcb->LastTrackNum));
 #ifdef UDF_FORMAT_MEDIA
         if(fms && fms->opt_disk_info) {
             UserPrint(("First track: %d\n"
@@ -1882,11 +1882,11 @@ MRWRetry_label:
                 if(TrackInfoOut->TrackLength > 1) {
                     Vcb->LastPossibleLBA =
                         TrackInfoOut->TrackStartLBA + TrackInfoOut->TrackLength - (TrackInfoOut->TrackLength ? 1 : 0);
-                    KdPrint((" set LastPossibleLBA=%x\n", Vcb->LastPossibleLBA));
+                    UDFPrint((" set LastPossibleLBA=%x\n", Vcb->LastPossibleLBA));
                 }
             }
 
-            KdPrint(("Ses %d, Track %d (%x, len %x) PckSize %x: \n"
+            UDFPrint(("Ses %d, Track %d (%x, len %x) PckSize %x: \n"
                      "  NWA: %x (%s)  DatType:%x, %s %s %s %s TrkType:%x %s %s\n"
                      "  LRA: %x (%s)  RC_LBA:%x\n",
                 TrackInfoOut->SesNum,
@@ -1957,13 +1957,13 @@ MRWRetry_label:
                     TrackInfoOut,sizeof(TRACK_INFO_BLOCK_USER_OUT), TRUE, NULL);
             // fill sector type map
             if(TrackInfoOut->TrackStartLBA & 0x80000000) {
-                KdPrint(("TrkInfo: Bad FirstLba (%x), change to %x\n", TrackInfoOut->TrackStartLBA, 0));
+                UDFPrint(("TrkInfo: Bad FirstLba (%x), change to %x\n", TrackInfoOut->TrackStartLBA, 0));
                 Vcb->TrackMap[TrackNumber].FirstLba = 0;
             } else {
                 Vcb->TrackMap[TrackNumber].FirstLba = TrackInfoOut->TrackStartLBA;
             }
             if(TrackInfoOut->TrackLength & 0x80000000) {
-                KdPrint(("TrkInfo: Bad TrackLength (%x), change to %x\n", TrackInfoOut->TrackLength,
+                UDFPrint(("TrkInfo: Bad TrackLength (%x), change to %x\n", TrackInfoOut->TrackLength,
                     Vcb->LastPossibleLBA - Vcb->TrackMap[TrackNumber].FirstLba + 1));
                 TrackInfoOut->TrackLength = Vcb->LastPossibleLBA - Vcb->TrackMap[TrackNumber].FirstLba + 1;
             }
@@ -1977,21 +1977,21 @@ MRWRetry_label:
             if((TrackInfoOut->NextWriteLBA & 0x80000000) || 
                (TrackInfoOut->NextWriteLBA < TrackInfoOut->TrackStartLBA)) {
                 if(!(Vcb->TrackMap[TrackNumber].LastLba & 0x8000000)) {
-                    KdPrint(("TrkInfo: set NWA to LastLba (%x)\n", Vcb->TrackMap[TrackNumber].LastLba));
+                    UDFPrint(("TrkInfo: set NWA to LastLba (%x)\n", Vcb->TrackMap[TrackNumber].LastLba));
                     Vcb->TrackMap[TrackNumber].NWA =
                         Vcb->TrackMap[TrackNumber].LastLba;
                 } else {
-                    KdPrint(("TrkInfo: set NWA to INV (1)\n"));
+                    UDFPrint(("TrkInfo: set NWA to INV (1)\n"));
                     Vcb->TrackMap[TrackNumber].NWA = 0;
                     Vcb->TrackMap[TrackNumber].NWA_V = 0;
                 }
             } else {
                 if(!(TrackInfoOut->NextWriteLBA & 0x80000000)) {
-                    KdPrint(("TrkInfo: Good NWA (%x)\n", TrackInfoOut->NextWriteLBA));
+                    UDFPrint(("TrkInfo: Good NWA (%x)\n", TrackInfoOut->NextWriteLBA));
                     Vcb->TrackMap[TrackNumber].NWA =
                         TrackInfoOut->NextWriteLBA;
                 } else {
-                    KdPrint(("TrkInfo: set NWA to INV (2)\n"));
+                    UDFPrint(("TrkInfo: set NWA to INV (2)\n"));
                     Vcb->TrackMap[TrackNumber].NWA = 0;
                     Vcb->TrackMap[TrackNumber].NWA_V = 0;
                 }
@@ -2000,14 +2000,14 @@ MRWRetry_label:
             // for FP tracks we shall get PacketSize from returned info
             // otherwise set to default UDF value (0x20)
             if(NotFP) {
-                KdPrint(("Apply NotFP\n"));
+                UDFPrint(("Apply NotFP\n"));
                 Vcb->TrackMap[TrackNumber].DataParam &= ~TrkInfo_FP;
 #ifdef DBG
                 TrackInfoOut->DataParam.Flags &= ~TrkInfo_FP;
 #endif //DBG
             } else
             if(ForceFP) {
-                KdPrint(("Apply ForceFP\n"));
+                UDFPrint(("Apply ForceFP\n"));
                 PacketTrack = TRUE;
                 Vcb->TrackMap[TrackNumber].DataParam |= TrkInfo_FP;
 #ifdef DBG
@@ -2023,19 +2023,19 @@ MRWRetry_label:
             }
             // presence of Damaged track means, that we should mount this disk in RAW mode
             if(Vcb->TrackMap[TrackNumber].TrackParam & TrkInfo_Damage) {
-                KdPrint(("TrkInfo_Damage, Try RAW_MOUNT\n"));
+                UDFPrint(("TrkInfo_Damage, Try RAW_MOUNT\n"));
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_RAW_DISK;
             }
             // presence of track with Unknown data type means, that we should mount
             // this disk in RAW mode
             if((TrackInfoOut->DataParam.Flags & TrkInfo_Dat_Mask) == TrkInfo_Trk_unknown) {
-                KdPrint(("Unknown DatType, Try RAW_MOUNT\n"));
+                UDFPrint(("Unknown DatType, Try RAW_MOUNT\n"));
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_RAW_DISK;
             }
 
             PacketTrack |= ((TrackInfoOut->DataParam.Flags & TrkInfo_Packet) != 0);
 
-            KdPrint(("Ses %d, Track %d (%x - %x) PckSize %x: \n"
+            UDFPrint(("Ses %d, Track %d (%x - %x) PckSize %x: \n"
                      "  NWA: %x (%s)  DatType:%x, %s %s %s %s TrkType:%x %s %s\n"
                      "  LRA: %x (%s)  RC_LBA:%x\n",
                 TrackInfoOut->SesNum,
@@ -2095,13 +2095,13 @@ MRWRetry_label:
 
             if(TrackNumber == DiscInfo->FirstTrackNum) {
                 if(!(Vcb->TrackMap[TrackNumber].FirstLba & 0x80000000)) {
-                    KdPrint(("TrkInfo: Update FirstLBA (%x)\n", Vcb->TrackMap[TrackNumber].FirstLba));
+                    UDFPrint(("TrkInfo: Update FirstLBA (%x)\n", Vcb->TrackMap[TrackNumber].FirstLba));
                     Vcb->FirstLBA = Vcb->TrackMap[TrackNumber].FirstLba;
                 }
             }
             if((TrackInfoOut->SesNum == Vcb->LastSession) && !Vcb->FirstTrackNumLastSes) {
                 if(!(Vcb->TrackMap[TrackNumber].FirstLba & 0x80000000)) {
-                    KdPrint(("TrkInfo: Update FirstLBALastSes (%x)\n", Vcb->TrackMap[TrackNumber].FirstLba));
+                    UDFPrint(("TrkInfo: Update FirstLBALastSes (%x)\n", Vcb->TrackMap[TrackNumber].FirstLba));
                     Vcb->FirstLBALastSes = Vcb->TrackMap[TrackNumber].FirstLba;
                 }
                 Vcb->FirstTrackNumLastSes = TrackNumber;
@@ -2112,7 +2112,7 @@ MRWRetry_label:
            !(TrackInfoOut->TrackLength  & 0x80000000) &&
             (Vcb->NWA < TrackInfoOut->NextWriteLBA)
            ) {
-            KdPrint((" set NWA to %x\n", TrackInfoOut->NextWriteLBA));
+            UDFPrint((" set NWA to %x\n", TrackInfoOut->NextWriteLBA));
             if(Vcb->MediaClassEx != CdMediaClass_DVDpRW) {
                 Vcb->NWA = TrackInfoOut->NextWriteLBA;
             } else {
@@ -2125,22 +2125,22 @@ MRWRetry_label:
            TrackInfoOut->TrackLength > 1) {
             Vcb->LastPossibleLBA =
                 TrackInfoOut->TrackStartLBA + TrackInfoOut->TrackLength - (TrackInfoOut->TrackLength ? 1 : 0);
-            KdPrint((" set LastPossibleLBA=%x\n", Vcb->LastPossibleLBA));
+            UDFPrint((" set LastPossibleLBA=%x\n", Vcb->LastPossibleLBA));
         }
         TrackNumber = Vcb->LastTrackNum;
         // quick formatted +RW returns bogus value
         if(Vcb->MediaClassEx == CdMediaClass_DVDpRW) {
-            KdPrint((" check quick formatted +RW\n"));
+            UDFPrint((" check quick formatted +RW\n"));
             if(Vcb->TrackMap[TrackNumber].LastLba &&
                !(Vcb->TrackMap[TrackNumber].LastLba & 0x80000000) &&
                Vcb->TrackMap[TrackNumber].LastLba < Vcb->LastPossibleLBA /*&&
                Vcb->TrackMap[TrackNumber].LastLba != Vcb->LastPossibleLBA*/
                ) {
-                KdPrint((" track LastLBA %x != LastPossibleLBA %x, verify\n",
+                UDFPrint((" track LastLBA %x != LastPossibleLBA %x, verify\n",
                     Vcb->TrackMap[TrackNumber].LastLba, Vcb->LastPossibleLBA));
 
                 if(Vcb->MRWStatus == DiscInfo_BGF_Complete) {
-                    KdPrint((" complete MRW state\n"));
+                    UDFPrint((" complete MRW state\n"));
 #ifdef _BROWSE_UDF_
                     Vcb->LastPossibleLBA =
                     Vcb->NWA = 
@@ -2153,7 +2153,7 @@ MRWRetry_label:
                     uint8* buff;
                     uint32 ReadBytes;
 
-                    KdPrint((" MRW state %x\n", Vcb->MRWStatus));
+                    UDFPrint((" MRW state %x\n", Vcb->MRWStatus));
 
                     buff = (uint8*)DbgAllocatePoolWithTag(NonPagedPool, Vcb->WriteBlockSize, 'bNWD' );
                     if(buff) {
@@ -2165,7 +2165,7 @@ MRWRetry_label:
                                        PH_TMP_BUFFER);
                         DbgFreePool(buff);
                         if(!OS_SUCCESS(RC)) {
-                            KdPrint((" Can't read beyond track LastLBA (%x)\n", Vcb->TrackMap[TrackNumber].LastLba+1));
+                            UDFPrint((" Can't read beyond track LastLBA (%x)\n", Vcb->TrackMap[TrackNumber].LastLba+1));
                             Vcb->LastLBA = Vcb->TrackMap[TrackNumber].LastLba;
                             Vcb->NWA = Vcb->LastLBA+1;
                             Vcb->TrackMap[TrackNumber].NWA_V = 1;
@@ -2177,7 +2177,7 @@ MRWRetry_label:
                     }
                 }
             }
-            KdPrint((" set track LastLBA %x\n", Vcb->LastPossibleLBA));
+            UDFPrint((" set track LastLBA %x\n", Vcb->LastPossibleLBA));
             Vcb->NWA = 
             Vcb->LastLBA =
             Vcb->TrackMap[TrackNumber].LastLba =
@@ -2211,18 +2211,18 @@ valid_track_length:
 #endif //_BROWSE_UDF_
 
         if(Vcb->TrackMap[TrackNumber].NWA_V & TrkInfo_NWA_V) {
-            KdPrint((" NWA ok, set LastLBA to min(Last %x, NWA %x\n",
+            UDFPrint((" NWA ok, set LastLBA to min(Last %x, NWA %x\n",
                 Vcb->TrackMap[TrackNumber].LastLba,
                 Vcb->TrackMap[TrackNumber].NWA));
             Vcb->LastLBA = min(Vcb->TrackMap[TrackNumber].LastLba, Vcb->TrackMap[TrackNumber].NWA);
         } else {
-            KdPrint((" no NWA, set LastLBA to Last %x\n", Vcb->TrackMap[TrackNumber].LastLba));
+            UDFPrint((" no NWA, set LastLBA to Last %x\n", Vcb->TrackMap[TrackNumber].LastLba));
             Vcb->LastLBA = Vcb->TrackMap[TrackNumber].LastLba;
         }
 
         Vcb->VCBFlags |= UDF_VCB_FLAGS_TRACKMAP;
         if(!PacketTrack && Vcb->MediaClassEx != CdMediaClass_DVDRAM ) {
-            KdPrint((" disable Raw mount\n"));
+            UDFPrint((" disable Raw mount\n"));
             Vcb->VCBFlags &= ~UDF_VCB_FLAGS_RAW_DISK;
         }
 
@@ -2253,7 +2253,7 @@ UDFReadAndProcessFullToc(
     uint32 LastLeadOut = 0;
 //    BOOLEAN IsMRW = FALSE;
 
-    KdPrint(("UDFReadAndProcessFullToc\n"));
+    UDFPrint(("UDFReadAndProcessFullToc\n"));
 
     if(!toc) return STATUS_INSUFFICIENT_RESOURCES;
     Vcb->FirstTrackNum = 0xFF;
@@ -2364,7 +2364,7 @@ UDFReadAndProcessFullToc(
     }
 
 /*    if(!IsMRW) {
-        KdPrint(("No MRW\n"));
+        UDFPrint(("No MRW\n"));
         Vcb->CompatFlags &= ~UDF_VCB_IC_MRW_ADDR_PROBLEM;
     }*/
 //        Vcb->CompatFlags &= ~UDF_VCB_IC_MRW_ADDR_PROBLEM;
@@ -2405,7 +2405,7 @@ UDFUseStandard(
   #define fms FALSE
 #endif //UDF_FORMAT_MEDIA
 
-    KdPrint(("UDFUseStandard\n"));
+    UDFPrint(("UDFUseStandard\n"));
 
     _SEH2_TRY {
 
@@ -2533,11 +2533,11 @@ UDFUseStandard(
 #ifdef UDF_DBG
             if (TrkNum >= MAXIMUM_NUMBER_OF_TRACKS &&
                 TrkNum != TOC_LastTrack_ID) {
-                KdPrint(("UDFUseStandard: Array out of bounds\n"));
+                UDFPrint(("UDFUseStandard: Array out of bounds\n"));
                 BrutePoint();
                 try_return(RC = STATUS_SUCCESS);
             }
-            KdPrint(("Track N %d (0x%x) first LBA %ld (%lx) \n",TrkNum,TrkNum,
+            UDFPrint(("Track N %d (0x%x) first LBA %ld (%lx) \n",TrkNum,TrkNum,
                 MSF_TO_LBA(TempMSF[1],TempMSF[2],TempMSF[3]),
                 MSF_TO_LBA(TempMSF[1],TempMSF[2],TempMSF[3])));
 #endif // UDF_DBG
@@ -2550,7 +2550,7 @@ UDFUseStandard(
             if(TOC_LastTrack_ID   == TrkNum) {
                 Vcb->LastLBA  = MSF_TO_LBA(TempMSF[1],TempMSF[2],TempMSF[3])-1;
                 Vcb->TrackMap[OldTrkNum].LastLba = Vcb->LastLBA-1;
-                KdPrint(("UDFUseStandard: Last track entry, break TOC scan\n"));
+                UDFPrint(("UDFUseStandard: Last track entry, break TOC scan\n"));
 //                continue;
                 break;
             } else {
@@ -2559,7 +2559,7 @@ UDFUseStandard(
                     Vcb->TrackMap[TrkNum].FirstLba = 0;
                 if(TrkNum) {
                     if (TOC_LastTrack_ID == OldTrkNum) {
-                        KdPrint(("UDFUseStandard: Wrong previous track number\n"));
+                        UDFPrint(("UDFUseStandard: Wrong previous track number\n"));
                         BrutePoint();
                     } else {
                         Vcb->TrackMap[OldTrkNum].LastLba = Vcb->TrackMap[TrkNum].FirstLba-1;
@@ -2594,7 +2594,7 @@ UDFUseStandard(
         }
         // no valid tracks...
         if(!TrkNum) {
-            KdPrint(("UDFUseStandard: no valid tracks...\n"));
+            UDFPrint(("UDFUseStandard: no valid tracks...\n"));
             try_return(RC = STATUS_UNRECOGNIZED_VOLUME);
         }
         i = 0;
@@ -2706,7 +2706,7 @@ UDFGetBlockSize(
 #ifdef UDF_HDD_SUPPORT
     if(!fms) {
         if(UDFGetDevType(DeviceObject) == FILE_DEVICE_DISK) {
-            KdPrint(("UDFGetBlockSize: HDD\n"));
+            UDFPrint(("UDFGetBlockSize: HDD\n"));
             RC = UDFPhSendIOCTL(IOCTL_DISK_GET_DRIVE_GEOMETRY,DeviceObject,
                 0,NULL,
                 DiskGeometry,sizeof(DISK_GEOMETRY),
@@ -2719,13 +2719,13 @@ UDFGetBlockSize(
                 PartitionInfo,sizeof(PARTITION_INFORMATION),
                 TRUE,NULL );
             if(!NT_SUCCESS(RC)) {
-                KdPrint(("UDFGetBlockSize: IOCTL_DISK_GET_PARTITION_INFO failed\n"));
+                UDFPrint(("UDFGetBlockSize: IOCTL_DISK_GET_PARTITION_INFO failed\n"));
                 if(RC == STATUS_INVALID_DEVICE_REQUEST) /* ReactOS Code Change (was =) */
                     RC = STATUS_UNRECOGNIZED_VOLUME;
                 try_return(RC);
             }
             if(PartitionInfo->PartitionType != PARTITION_IFS) {
-                KdPrint(("UDFGetBlockSize: PartitionInfo->PartitionType != PARTITION_IFS\n"));
+                UDFPrint(("UDFGetBlockSize: PartitionInfo->PartitionType != PARTITION_IFS\n"));
                 try_return(RC = STATUS_UNRECOGNIZED_VOLUME);
             }
         } else {
@@ -2856,7 +2856,7 @@ UDFGetBlockSize(
 
 try_exit:   NOTHING;
 
-    KdPrint(("UDFGetBlockSize:\nBlock size is %x, Block size bits %x, Last LBA is %x\n",
+    UDFPrint(("UDFGetBlockSize:\nBlock size is %x, Block size bits %x, Last LBA is %x\n",
               Vcb->BlockSize, Vcb->BlockSizeBits, Vcb->LastLBA));
 
     MyFreePool__(PartitionInfo);
@@ -2936,14 +2936,14 @@ UDFCheckTrackFPAddressing(
 
         // skip unreadable
         if(!OS_SUCCESS(RC)) {
-            KdPrint(("  Read error at lba %x\n", i));
+            UDFPrint(("  Read error at lba %x\n", i));
             continue;
         }
 
         // skip strange (damaged ?) blocks
         if((pHdr->Mode.Flags & WParam_SubHdr_Mode_Mask) != WParam_SubHdr_Mode1 &&
            (pHdr->Mode.Flags & WParam_SubHdr_Mode_Mask) != WParam_SubHdr_Mode2) {
-            KdPrint(("  Unexpected data type (%x) at lba %x\n", pHdr->Mode.Flags & WParam_SubHdr_Mode_Mask, i));
+            UDFPrint(("  Unexpected data type (%x) at lba %x\n", pHdr->Mode.Flags & WParam_SubHdr_Mode_Mask, i));
             continue;
         }
 
@@ -2959,7 +2959,7 @@ UDFCheckTrackFPAddressing(
         if((pHdr->Mode.Flags & WParam_SubHdr_Format_Mask) != WParam_SubHdr_Format_UserData &&
             user_data) {
 //        if(!OS_SUCCESS(RC) && OS_SUCCESS(RC2)) {
-            KdPrint(("  %x - %x (%x sectors)\n", lba, i-1, i-lba));
+            UDFPrint(("  %x - %x (%x sectors)\n", lba, i-1, i-lba));
             if(!FirstChunkLen) {
                 FirstChunkLen = i-lba;
             } else {
@@ -3035,7 +3035,7 @@ UDFFixFPAddress(
             return Lba;
         pk = Lba / Vcb->TrackMap[i].PacketSize;
         rel = Lba % Vcb->TrackMap[i].PacketSize;
-        KdPrint(("FixFPAddr: %x -> %x\n", Lba, pk*(Vcb->TrackMap[i].PacketSize+7) + rel));
+        UDFPrint(("FixFPAddr: %x -> %x\n", Lba, pk*(Vcb->TrackMap[i].PacketSize+7) + rel));
         return pk*(Vcb->TrackMap[i].PacketSize+7) + rel /*- Vcb->TrackMap[i].PacketFPOffset*/;
     }
     return Lba;
@@ -3065,7 +3065,7 @@ UDFGetDiskInfo(
   #define fms FALSE
 #endif //UDF_FORMAT_MEDIA
 
-    KdPrint(("UDFGetDiskInfo\n"));
+    UDFPrint(("UDFGetDiskInfo\n"));
 
     if(!ioBuf) {
         return STATUS_INSUFFICIENT_RESOURCES;
@@ -3094,14 +3094,14 @@ UDFGetDiskInfo(
 #endif //_BROWSE_UDF_
         }
 
-        KdPrint(("UDF: Signature of low driver is : %s \n",
+        UDFPrint(("UDF: Signature of low driver is : %s \n",
             ((PGET_SIGNATURE_USER_OUT)(ioBuf))->VendorId));
     
         if(!strncmp( (const char *)(&( ((PGET_SIGNATURE_USER_OUT)(ioBuf))->VendorId[0]) ),
             Signature,strlen(Signature) )) {
-            KdPrint(("UDF: *****************************************\n"));
-            KdPrint(("UDF: ********* Our Device Driver Found ******\n"));
-            KdPrint(("UDF: *****************************************\n"));
+            UDFPrint(("UDF: *****************************************\n"));
+            UDFPrint(("UDF: ********* Our Device Driver Found ******\n"));
+            UDFPrint(("UDF: *****************************************\n"));
     
             (Vcb->VCBFlags) |= UDF_VCB_FLAGS_OUR_DEVICE_DRIVER;
 #ifndef _BROWSE_UDF_
@@ -3132,47 +3132,47 @@ UDFGetDiskInfo(
             Vcb->SavedFeatures =
                 SavedFeatures = ((PGET_DEVICE_INFO_USER_OUT)ioBuf)->Features;
             if(!(SavedFeatures & CDRW_FEATURE_SYNC_ON_WRITE)) {
-                KdPrint(("UDFGetDiskInfo: UDF_VCB_IC_NO_SYNCCACHE_AFTER_WRITE\n"));
+                UDFPrint(("UDFGetDiskInfo: UDF_VCB_IC_NO_SYNCCACHE_AFTER_WRITE\n"));
                 Vcb->CompatFlags |= UDF_VCB_IC_NO_SYNCCACHE_AFTER_WRITE;
             }
             if(!(SavedFeatures & CDRW_FEATURE_FORCE_SYNC_BEFORE_READ)) {
-                KdPrint(("UDFGetDiskInfo: UDF_VCB_IC_SYNCCACHE_BEFORE_READ\n"));
+                UDFPrint(("UDFGetDiskInfo: UDF_VCB_IC_SYNCCACHE_BEFORE_READ\n"));
                 Vcb->CompatFlags |= UDF_VCB_IC_SYNCCACHE_BEFORE_READ;
             }
             if(SavedFeatures & CDRW_FEATURE_BAD_RW_SEEK) {
-                KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_BAD_RW_SEEK\n"));
+                UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_BAD_RW_SEEK\n"));
                 Vcb->CompatFlags |= UDF_VCB_IC_BAD_RW_SEEK;
             }
             // we must check if this is FP-formatted disk in old devices
             // independently of MediaType they report
             if(SavedFeatures & CDRW_FEATURE_FP_ADDRESSING_PROBLEM) {
-                KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_FP_ADDRESSING_PROBLEM ?\n"));
+                UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_FP_ADDRESSING_PROBLEM ?\n"));
                 Vcb->CompatFlags |= UDF_VCB_IC_FP_ADDR_PROBLEM;
             }
             if(SavedFeatures & CDRW_FEATURE_MRW_ADDRESSING_PROBLEM) {
-                KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM ?\n"));
+                UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM ?\n"));
             }
             if(SavedFeatures & CDRW_FEATURE_FORCE_SYNC_ON_WRITE) {
-                KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_FORCE_SYNC_ON_WRITE\n"));
+                UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_FORCE_SYNC_ON_WRITE\n"));
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_FORCE_SYNC_CACHE;
             }
             if(SavedFeatures & CDRW_FEATURE_BAD_DVD_LAST_LBA) {
-                KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_BAD_DVD_LAST_LBA\n"));
+                UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_BAD_DVD_LAST_LBA\n"));
                 Vcb->CompatFlags |= UDF_VCB_IC_BAD_DVD_LAST_LBA;
             }
             if(SavedFeatures & CDRW_FEATURE_STREAMING) {
-                KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_STREAMING\n"));
+                UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_STREAMING\n"));
             }
             if(SavedFeatures & CDRW_FEATURE_OPC) {
-                KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_OPC -> assume OPCNum=1\n"));
+                UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_OPC -> assume OPCNum=1\n"));
                 Vcb->OPCNum = 1;
             }
 #ifdef UDF_FORMAT_MEDIA
             if(SavedFeatures & CDRW_FEATURE_FULL_BLANK_ON_FORMAT) {
-                KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_FULL_BLANK_ON_FORMAT\n"));
+                UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_FULL_BLANK_ON_FORMAT\n"));
                 if((fms->opt_probe || fms->opt_smart_f)/* &&
                    (fms->format_media && fms->blank_media*/) {
-                    KdPrint(("UDFGetDiskInfo: force Full Erase\n"));
+                    UDFPrint(("UDFGetDiskInfo: force Full Erase\n"));
                     fms->opt_qblank = FALSE;
                 }
             }
@@ -3189,7 +3189,7 @@ UDFGetDiskInfo(
             } else {
                 Vcb->CdrwBufferSize = 0;
             }
-            KdPrint(("UDFGetDiskInfo: CdrwBufferSize = %dKb\n", Vcb->CdrwBufferSize / 1024));
+            UDFPrint(("UDFGetDiskInfo: CdrwBufferSize = %dKb\n", Vcb->CdrwBufferSize / 1024));
             Vcb->CdrwBufferSizeCounter = 0;
 #endif //_BROWSE_UDF_
             // get media type
@@ -3199,7 +3199,7 @@ UDFGetDiskInfo(
             if(!OS_SUCCESS(RC)) goto Try_FullToc;
             Vcb->MediaType =
             MediaType = ((PGET_MEDIA_TYPE_USER_OUT)ioBuf)->MediaType;
-            KdPrint(("UDFGetDiskInfo: MediaType %x\n", MediaType));
+            UDFPrint(("UDFGetDiskInfo: MediaType %x\n", MediaType));
 
 #ifndef UDF_FORMAT_MEDIA
             // we shall ignore audio-disks
@@ -3211,19 +3211,19 @@ UDFGetDiskInfo(
             case MediaType_120mm_CDRW_AudioOnly:
             case MediaType_80mm_CDRW_AudioOnly:
 //            case :
-                KdPrint(("UDFGetDiskInfo: we shall ignore audio-disks...\n"));
+                UDFPrint(("UDFGetDiskInfo: we shall ignore audio-disks...\n"));
                 try_return(RC = STATUS_UNRECOGNIZED_VOLUME);
             }
 #endif //UDF_FORMAT_MEDIA
 
-            KdPrint(("UDFGetDiskInfo: Check DVD-disks...\n"));
+            UDFPrint(("UDFGetDiskInfo: Check DVD-disks...\n"));
             RC = UDFPhSendIOCTL(IOCTL_CDRW_GET_MEDIA_TYPE_EX,DeviceObject,
                     NULL,0,ioBuf,sizeof(GET_MEDIA_TYPE_EX_USER_OUT),
                     FALSE, NULL);
             if(!OS_SUCCESS(RC)) goto Try_FullToc;
             Vcb->MediaClassEx =
             MediaType = (((PGET_MEDIA_TYPE_EX_USER_OUT)ioBuf)->MediaClass);
-            KdPrint(("UDFGetDiskInfo: MediaClassEx %x\n", MediaType));
+            UDFPrint(("UDFGetDiskInfo: MediaClassEx %x\n", MediaType));
 
 #ifdef _BROWSE_UDF_
             if(!fms) {
@@ -3235,13 +3235,13 @@ UDFGetDiskInfo(
                 case CdMediaClass_DVDpR:
                 case CdMediaClass_HD_DVDR:
                 case CdMediaClass_BDR:
-                    KdPrint(("UDFGetDiskInfo: MediaClass R\n"));
+                    UDFPrint(("UDFGetDiskInfo: MediaClass R\n"));
                     Vcb->MediaType = MediaType_UnknownSize_CDR;
                     break;
                 case CdMediaClass_CDRW:
 
                     if(SavedFeatures & CDRW_FEATURE_MRW_ADDRESSING_PROBLEM) {
-                        KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM on CD-RW\n"));
+                        UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM on CD-RW\n"));
                         Vcb->CompatFlags |= UDF_VCB_IC_MRW_ADDR_PROBLEM;
                     }
 
@@ -3251,19 +3251,19 @@ UDFGetDiskInfo(
                 case CdMediaClass_HD_DVDRW:
                 case CdMediaClass_HD_DVDRAM:
                 case CdMediaClass_BDRE:
-                    KdPrint(("UDFGetDiskInfo: MediaClass RW\n"));
+                    UDFPrint(("UDFGetDiskInfo: MediaClass RW\n"));
                     Vcb->MediaType = MediaType_UnknownSize_CDRW;
                     break;
                 case CdMediaClass_CDROM:
                 case CdMediaClass_DVDROM:
                 case CdMediaClass_HD_DVDROM:
                 case CdMediaClass_BDROM:
-                    KdPrint(("UDFGetDiskInfo: MediaClass ROM\n"));
+                    UDFPrint(("UDFGetDiskInfo: MediaClass ROM\n"));
                     Vcb->MediaType = MediaType_Unknown;
     //                    Vcb->MediaType = MediaType_UnknownSize_CDROM;
                     break;
                 default:
-                    KdPrint(("UDFGetDiskInfo: MediaClass Unknown\n"));
+                    UDFPrint(("UDFGetDiskInfo: MediaClass Unknown\n"));
                     Vcb->MediaType = MediaType_Unknown;
                     break;
                 }
@@ -3278,93 +3278,93 @@ UDFGetDiskInfo(
 
                 switch(MediaType) {
                 case CdMediaClass_CDR:
-                    KdPrint(("CdMediaClass_CDR\n"));
+                    UDFPrint(("CdMediaClass_CDR\n"));
                     MediaType = MediaType_UnknownSize_CDR;
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_CDR;
                     break;
                 case CdMediaClass_DVDR:
-                    KdPrint(("CdMediaClass_DVDR -> MediaType_UnknownSize_CDR\n"));
+                    UDFPrint(("CdMediaClass_DVDR -> MediaType_UnknownSize_CDR\n"));
                     MediaType = MediaType_UnknownSize_CDR;
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_DVDR;
                     break;
                 case CdMediaClass_DVDpR:
-                    KdPrint(("CdMediaClass_DVDpR -> MediaType_UnknownSize_CDR\n"));
+                    UDFPrint(("CdMediaClass_DVDpR -> MediaType_UnknownSize_CDR\n"));
                     MediaType = MediaType_UnknownSize_CDR;
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_DVDpR;
                     break;
                 case CdMediaClass_HD_DVDR:
-                    KdPrint(("CdMediaClass_HD_DVDR -> MediaType_UnknownSize_CDR\n"));
+                    UDFPrint(("CdMediaClass_HD_DVDR -> MediaType_UnknownSize_CDR\n"));
                     MediaType = MediaType_UnknownSize_CDR;
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_DVDR;
                     break;
                 case CdMediaClass_BDR:
-                    KdPrint(("CdMediaClass_BDR -> MediaType_UnknownSize_CDR\n"));
+                    UDFPrint(("CdMediaClass_BDR -> MediaType_UnknownSize_CDR\n"));
                     MediaType = MediaType_UnknownSize_CDR;
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_DVDR;
                     break;
                 case CdMediaClass_CDRW:
-                    KdPrint(("CdMediaClass_CDRW\n"));
+                    UDFPrint(("CdMediaClass_CDRW\n"));
                     MediaType = MediaType_UnknownSize_CDRW;
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_CDRW;
                     if(SavedFeatures & CDRW_FEATURE_MRW_ADDRESSING_PROBLEM) {
-                        KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM on CD-RW\n"));
+                        UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM on CD-RW\n"));
                         Vcb->CompatFlags |= UDF_VCB_IC_MRW_ADDR_PROBLEM;
                     }
                     break;
                 case CdMediaClass_DVDRW:
-                    KdPrint(("  CdMediaClass_DVDRW -> MediaType_UnknownSize_CDRW\n"));
+                    UDFPrint(("  CdMediaClass_DVDRW -> MediaType_UnknownSize_CDRW\n"));
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_DVDRW;
                     MediaType = MediaType_UnknownSize_CDRW;
                     break;
                 case CdMediaClass_DVDpRW:
-                    KdPrint(("  CdMediaClass_DVDpRW -> MediaType_UnknownSize_CDRW\n"));
+                    UDFPrint(("  CdMediaClass_DVDpRW -> MediaType_UnknownSize_CDRW\n"));
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_DVDpRW;
                     MediaType = MediaType_UnknownSize_CDRW;
                     break;
                 case CdMediaClass_DVDRAM:
-                    KdPrint(("  CdMediaClass_DVDRAM -> MediaType_UnknownSize_CDRW\n"));
+                    UDFPrint(("  CdMediaClass_DVDRAM -> MediaType_UnknownSize_CDRW\n"));
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_DVDRAM;
                     MediaType = MediaType_UnknownSize_CDRW;
                     break;
                 case CdMediaClass_HD_DVDRW:
-                    KdPrint(("  CdMediaClass_HD_DVDRW -> MediaType_UnknownSize_CDRW\n"));
+                    UDFPrint(("  CdMediaClass_HD_DVDRW -> MediaType_UnknownSize_CDRW\n"));
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_DVDRW;
                     MediaType = MediaType_UnknownSize_CDRW;
                     break;
                 case CdMediaClass_HD_DVDRAM:
-                    KdPrint(("  CdMediaClass_HD_DVDRAM -> MediaType_UnknownSize_CDRW\n"));
+                    UDFPrint(("  CdMediaClass_HD_DVDRAM -> MediaType_UnknownSize_CDRW\n"));
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_DVDRAM;
                     MediaType = MediaType_UnknownSize_CDRW;
                     break;
                 case CdMediaClass_BDRE:
-                    KdPrint(("  CdMediaClass_BDRE -> MediaType_UnknownSize_CDRW\n"));
+                    UDFPrint(("  CdMediaClass_BDRE -> MediaType_UnknownSize_CDRW\n"));
                     if(fms->opt_media == MT_AUTO)
                         fms->opt_media = MT_DVDRW;
                     MediaType = MediaType_UnknownSize_CDRW;
                     break;
                 case CdMediaClass_NoDiscPresent:
-                    KdPrint(("  CdMediaClass_NoDiscPresent -> MediaType_NoDiscPresent\n"));
+                    UDFPrint(("  CdMediaClass_NoDiscPresent -> MediaType_NoDiscPresent\n"));
                     MediaType = MediaType_NoDiscPresent;
                     fms->opt_media = MT_none;
                     break;
                 case CdMediaClass_DoorOpen:
-                    KdPrint(("  CdMediaClass_DoorOpen -> MediaType_DoorOpen\n"));
+                    UDFPrint(("  CdMediaClass_DoorOpen -> MediaType_DoorOpen\n"));
                     MediaType = MediaType_DoorOpen;
                     fms->opt_media = MT_none;
                     break;
                 default:
-                    KdPrint(("  MediaType_Unknown\n"));
+                    UDFPrint(("  MediaType_Unknown\n"));
                     MediaType = MediaType_Unknown;
                     break;
                 }
@@ -3380,8 +3380,8 @@ UDFGetDiskInfo(
             Vcb->WriteParamsReq = (Vcb->PhMediaCapFlags & CdCapFlags_WriteParamsReq) ? TRUE : FALSE;
             if(Vcb->DVD_Mode &&
                 !(Vcb->PhMediaCapFlags & CdCapFlags_RandomWritable)) {
-                KdPrint(("UDFGetDiskInfo: DVD && !CdCapFlags_RandomWritable\n"));
-                KdPrint(("  Read-only volume\n"));
+                UDFPrint(("UDFGetDiskInfo: DVD && !CdCapFlags_RandomWritable\n"));
+                UDFPrint(("  Read-only volume\n"));
 //                BrutePoint();
 #ifndef UDF_CDRW_EMULATION_ON_ROM
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
@@ -3397,10 +3397,10 @@ UDFGetDiskInfo(
             }
 #endif //UDF_FORMAT_MEDIA
             if(!Vcb->WriteParamsReq) {
-                KdPrint(("UDFGetDiskInfo: do not use WriteParams\n"));
+                UDFPrint(("UDFGetDiskInfo: do not use WriteParams\n"));
             }
             if(Vcb->PhMediaCapFlags & CdCapFlags_Cav) {
-                KdPrint(("UDFGetDiskInfo: Use CAV (1)\n"));
+                UDFPrint(("UDFGetDiskInfo: Use CAV (1)\n"));
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_USE_CAV;
             }
 
@@ -3409,13 +3409,13 @@ UDFGetDiskInfo(
                 // check if this device is capable to write on such media
                 if(UDFIsDvdMedia(Vcb)) {
                     //RC =
-                    KdPrint(("UDFGetDiskInfo: update defaulted LastLBA\n"));
+                    UDFPrint(("UDFGetDiskInfo: update defaulted LastLBA\n"));
                     UDFGetBlockSize(DeviceObject,Vcb);
                     //if(!OS_SUCCESS(RC)) goto Try_FullToc;
                 } else {
                     if((SavedFeatures & CDRW_FEATURE_MRW_ADDRESSING_PROBLEM) &&
                        (SavedFeatures & UDF_VCB_IC_FP_ADDR_PROBLEM)) {
-                        KdPrint(("UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM on old CD-ROM\n"));
+                        UDFPrint(("UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM on old CD-ROM\n"));
                         Vcb->CompatFlags |= UDF_VCB_IC_MRW_ADDR_PROBLEM;
                     }
                 }
@@ -3442,7 +3442,7 @@ UDFGetDiskInfo(
             RC = UDFPhSendIOCTL(IOCTL_DISK_IS_WRITABLE,DeviceObject,
                     NULL,0,NULL,0,FALSE, NULL);
             if(RC != STATUS_SUCCESS) {
-                KdPrint(("IS_WRITABLE - false, doing additional check...\n"));
+                UDFPrint(("IS_WRITABLE - false, doing additional check...\n"));
                 if( ((MediaType >= MediaType_UnknownSize_CDRW) && !(cap->WriteCap & DevCap_write_cd_rw)) ||
                     ((MediaType >= MediaType_UnknownSize_CDR) && !(cap->WriteCap & DevCap_write_cd_r)) ||
                      (MediaType < MediaType_UnknownSize_CDR) ) {
@@ -3456,7 +3456,7 @@ UDFGetDiskInfo(
 #endif //UDF_FORMAT_MEDIA
                 }
             } else {
-                KdPrint(("Writable disk\n"));
+                UDFPrint(("Writable disk\n"));
             }
             Vcb->MaxWriteSpeed = cap->MaximumWriteSpeedSupported;
             Vcb->MaxReadSpeed  = cap->MaximumSpeedSupported;
@@ -3464,7 +3464,7 @@ UDFGetDiskInfo(
                 Vcb->CurSpeed = max(cap->CurrentSpeed, cap->CurrentWriteSpeed3);
                 if(cap->LunWPerfDescriptorCount && cap->LunWPerfDescriptorCount != 0xffff) {
                     ULONG n;
-                    KdPrint(("Write performance descriptor(s) found: %x\n", cap->LunWPerfDescriptorCount));
+                    UDFPrint(("Write performance descriptor(s) found: %x\n", cap->LunWPerfDescriptorCount));
                     n = (4096 - sizeof(GET_CAPABILITIES_3_USER_OUT)) / sizeof(LUN_WRITE_PERF_DESC_USER);
                     n = min(n, cap->LunWPerfDescriptorCount);
                     // get device capabilities
@@ -3481,16 +3481,16 @@ UDFGetDiskInfo(
                                 if(!n) {
                                     Vcb->CurSpeed = WPerfDesc[i].WriteSpeedSupported;
                                     n = TRUE;
-                                    KdPrint(("Use CAV\n"));
+                                    UDFPrint(("Use CAV\n"));
                                 } else {
                                     Vcb->CurSpeed = max(WPerfDesc[i].WriteSpeedSupported, Vcb->CurSpeed);
                                 }
-                                KdPrint(("supports speed %dX\n", Vcb->CurSpeed/176));
+                                UDFPrint(("supports speed %dX\n", Vcb->CurSpeed/176));
                                 //break;
                             }
                         }
                         if(n) {
-                            KdPrint(("Set r/w speeds to %dX\n", Vcb->CurSpeed/176));
+                            UDFPrint(("Set r/w speeds to %dX\n", Vcb->CurSpeed/176));
                             Vcb->MaxWriteSpeed =
                             Vcb->MaxReadSpeed  = Vcb->CurSpeed;
                         }
@@ -3499,7 +3499,7 @@ UDFGetDiskInfo(
             } else {
                 Vcb->CurSpeed = max(cap->CurrentSpeed, cap->CurrentWriteSpeed);
             }
-            KdPrint((" Speeds r/w %dX/%dX\n", Vcb->CurSpeed/176, cap->CurrentWriteSpeed/176));
+            UDFPrint((" Speeds r/w %dX/%dX\n", Vcb->CurSpeed/176, cap->CurrentWriteSpeed/176));
 
             if(Vcb->VCBFlags & UDF_VCB_FLAGS_USE_CAV) {
                 // limit both read & write speed to last write speed for CAV mode
@@ -3530,7 +3530,7 @@ UDFGetDiskInfo(
             if(!OS_SUCCESS(RC)) {
                 // may be we have a CD-ROM device
 Try_FullToc:
-                KdPrint(("Hardware Read-only volume (2)\n"));
+                UDFPrint(("Hardware Read-only volume (2)\n"));
 //                BrutePoint();
 #ifndef UDF_CDRW_EMULATION_ON_ROM
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
@@ -3563,20 +3563,20 @@ try_exit:   NOTHING;
            (Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) &&
             Vcb->LastLBA &&
            (Vcb->LastLBA < DEFAULT_LAST_LBA_DVD)) {
-            KdPrint(("UDF: Bad DVD last LBA %x, fixup!\n", Vcb->LastLBA));
+            UDFPrint(("UDF: Bad DVD last LBA %x, fixup!\n", Vcb->LastLBA));
             Vcb->LastLBA = DEFAULT_LAST_LBA_DVD;
             Vcb->NWA = 0;
         }
 
 
         if(UDFIsDvdMedia(Vcb) && !Vcb->FirstLBA && !Vcb->LastPossibleLBA) {
-            KdPrint(("UDF: Empty DVD. Use bogus values for now\n"));
+            UDFPrint(("UDF: Empty DVD. Use bogus values for now\n"));
             Vcb->LastPossibleLBA = DEFAULT_LAST_LBA_DVD;
             Vcb->LastLBA = 0;
         }
         
         if((Vcb->LastPossibleLBA & 0x80000000) || (Vcb->LastPossibleLBA < Vcb->LastLBA)) {
-            KdPrint(("UDF: bad LastPossibleLBA %x -> %x\n", Vcb->LastPossibleLBA, Vcb->LastLBA));
+            UDFPrint(("UDF: bad LastPossibleLBA %x -> %x\n", Vcb->LastPossibleLBA, Vcb->LastLBA));
             Vcb->LastPossibleLBA = Vcb->LastLBA;
         }
         if(!Vcb->WriteBlockSize)
@@ -3614,7 +3614,7 @@ try_exit:   NOTHING;
             UDFCheckTrackFPAddressing(Vcb, Vcb->FirstTrackNum);
             // if we really have such a problem, fix LastLBA
             if(Vcb->CompatFlags & UDF_VCB_IC_FP_ADDR_PROBLEM) {
-                KdPrint(("UDF: Fix LastLBA: %x -> %x\n", Vcb->LastLBA, (Vcb->LastLBA*32) / 39));
+                UDFPrint(("UDF: Fix LastLBA: %x -> %x\n", Vcb->LastLBA, (Vcb->LastLBA*32) / 39));
                 Vcb->LastLBA = (Vcb->LastLBA*32) / 39;
             }
         }
@@ -3622,30 +3622,30 @@ try_exit:   NOTHING;
 
         if(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) {
             if(!Vcb->BlankCD && Vcb->MediaType != MediaType_UnknownSize_CDRW) {
-                KdPrint(("UDFGetDiskInfo: R/O+!Blank+!RW -> !RAW\n"));
+                UDFPrint(("UDFGetDiskInfo: R/O+!Blank+!RW -> !RAW\n"));
                 Vcb->VCBFlags &= ~UDF_VCB_FLAGS_RAW_DISK;
             } else {
-                KdPrint(("UDFGetDiskInfo: Blank or RW\n"));
+                UDFPrint(("UDFGetDiskInfo: Blank or RW\n"));
             }
         }
 
-        KdPrint(("UDF: ------------------------------------------\n"));
-        KdPrint(("UDF: Media characteristics\n"));
-        KdPrint(("UDF: Last session: %d\n",Vcb->LastSession));
-        KdPrint(("UDF: First track in first session: %d\n",Vcb->FirstTrackNum));
-        KdPrint(("UDF: First track in last session: %d\n",Vcb->FirstTrackNumLastSes));
-        KdPrint(("UDF: Last track in last session: %d\n",Vcb->LastTrackNum));
-        KdPrint(("UDF: First LBA in first session: %x\n",Vcb->FirstLBA));
-        KdPrint(("UDF: First LBA in last session: %x\n",Vcb->FirstLBALastSes));
-        KdPrint(("UDF: Last LBA in last session: %x\n",Vcb->LastLBA));
-        KdPrint(("UDF: First writable LBA (NWA) in last session: %x\n",Vcb->NWA));
-        KdPrint(("UDF: Last available LBA beyond end of last session: %x\n",Vcb->LastPossibleLBA));
-        KdPrint(("UDF: blocks per frame: %x\n",1 << Vcb->WCacheBlocksPerFrameSh));
-        KdPrint(("UDF: Flags: %s%s\n",
+        UDFPrint(("UDF: ------------------------------------------\n"));
+        UDFPrint(("UDF: Media characteristics\n"));
+        UDFPrint(("UDF: Last session: %d\n",Vcb->LastSession));
+        UDFPrint(("UDF: First track in first session: %d\n",Vcb->FirstTrackNum));
+        UDFPrint(("UDF: First track in last session: %d\n",Vcb->FirstTrackNumLastSes));
+        UDFPrint(("UDF: Last track in last session: %d\n",Vcb->LastTrackNum));
+        UDFPrint(("UDF: First LBA in first session: %x\n",Vcb->FirstLBA));
+        UDFPrint(("UDF: First LBA in last session: %x\n",Vcb->FirstLBALastSes));
+        UDFPrint(("UDF: Last LBA in last session: %x\n",Vcb->LastLBA));
+        UDFPrint(("UDF: First writable LBA (NWA) in last session: %x\n",Vcb->NWA));
+        UDFPrint(("UDF: Last available LBA beyond end of last session: %x\n",Vcb->LastPossibleLBA));
+        UDFPrint(("UDF: blocks per frame: %x\n",1 << Vcb->WCacheBlocksPerFrameSh));
+        UDFPrint(("UDF: Flags: %s%s\n",
                  Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK ? "RAW " : "",
                  Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY ? "R/O " : "WR "
                  ));
-        KdPrint(("UDF: ------------------------------------------\n"));
+        UDFPrint(("UDF: ------------------------------------------\n"));
 
 #ifdef UDF_FORMAT_MEDIA
         if(fms && fms->opt_disk_info) {
@@ -3659,7 +3659,7 @@ try_exit:   NOTHING;
 
     } _SEH2_END;
 
-    KdPrint(("UDFGetDiskInfo: %x\n", RC));
+    UDFPrint(("UDFGetDiskInfo: %x\n", RC));
     return(RC);
 
 } // end UDFGetDiskInfo()
@@ -3690,7 +3690,7 @@ UDFPrepareForReadOperation(
         ULONG i;
         for(i=0; i<BCount; i++) {
             if(UDFGetBit((uint32*)(Vcb->BSBM_Bitmap), Lba+i)) {
-                KdPrint(("R: Known BB @ %#x\n", Lba));
+                UDFPrint(("R: Known BB @ %#x\n", Lba));
                 //return STATUS_FT_WRITE_RECOVERY; // this shall not be treated as error and
                                                    // we shall get IO request to BAD block
                 return STATUS_DEVICE_DATA_ERROR;
@@ -3758,7 +3758,7 @@ UDFPrepareForReadOperation(
             if(Vcb->VCBFlags & UDF_VCB_FLAGS_USE_CAV) {
                 Vcb->SpeedBuf.RotCtrl = CdSpeed_RotCtrl_CAV;
             }
-            KdPrint(("    UDFPrepareForReadOperation: set speed to %s %dX/%dX\n",
+            UDFPrint(("    UDFPrepareForReadOperation: set speed to %s %dX/%dX\n",
                 (Vcb->VCBFlags & UDF_VCB_FLAGS_USE_CAV) ? "CAV" : "CLV",
                 Vcb->SpeedBuf.ReadSpeed,
                 Vcb->SpeedBuf.WriteSpeed));
@@ -3801,7 +3801,7 @@ check_for_data_track:
         Vcb->IncrementalSeekState = INCREMENTAL_SEEK_NONE;
         return STATUS_SUCCESS;
     }
-    KdPrint(("    UDFPrepareForReadOperation: seek workaround...\n"));
+    UDFPrint(("    UDFPrepareForReadOperation: seek workaround...\n"));
     Vcb->IncrementalSeekState = INCREMENTAL_SEEK_DONE;
 
     tmp = (PUCHAR)DbgAllocatePoolWithTag(NonPagedPool, Vcb->BlockSize, 'bNWD');
@@ -3812,7 +3812,7 @@ check_for_data_track:
     for(i=0x1000; i<=Lba; i+=0x1000) {
         RC = UDFPhReadSynchronous(Vcb->TargetDeviceObject, tmp, Vcb->BlockSize,
                    ((uint64)UDFFixFPAddress(Vcb,i)) << Vcb->BlockSizeBits, &ReadBytes, 0);
-        KdPrint(("    seek workaround, LBA %x, status %x\n", i, RC));
+        UDFPrint(("    seek workaround, LBA %x, status %x\n", i, RC));
     }
     DbgFreePool(tmp);
 #endif //_BROWSE_UDF_
@@ -3852,7 +3852,7 @@ UDFUpdateNWA(
 /*        if(Vcb->CdrwBufferSize) {
             Vcb->CdrwBufferSizeCounter += BCount * 2048;
             if(Vcb->CdrwBufferSizeCounter >= Vcb->CdrwBufferSize + 2*2048) {
-                KdPrint(("    UDFUpdateNWA: buffer is full, sync...\n"));
+                UDFPrint(("    UDFUpdateNWA: buffer is full, sync...\n"));
                 Vcb->CdrwBufferSizeCounter = 0;
                 goto sync_cache;
             }
@@ -3869,7 +3869,7 @@ UDFUpdateNWA(
         Vcb->NWA+=BCount+7;
 sync_cache:
     if(!(Vcb->CompatFlags & UDF_VCB_IC_NO_SYNCCACHE_AFTER_WRITE)) {
-        KdPrint(("    UDFUpdateNWA: syncing...\n"));
+        UDFPrint(("    UDFUpdateNWA: syncing...\n"));
         RC = UDFSyncCache(Vcb);
     }
 #endif //_BROWSE_UDF_
@@ -4128,7 +4128,7 @@ EO_WrSctD:
     }
     ASSERT(OS_SUCCESS(status));
     if(!OS_SUCCESS(status)) {
-        KdPrint(("UDFWriteInSector() for LBA %x failed\n", Lba));
+        UDFPrint(("UDFWriteInSector() for LBA %x failed\n", Lba));
     }
 #endif //_BROWSE_UDF_
     return status;
@@ -4247,7 +4247,7 @@ UDFSetSpeeds(
         Vcb->SpeedBuf.ReadSpeed  = Vcb->CurSpeed;
         Vcb->SpeedBuf.WriteSpeed = Vcb->MaxWriteSpeed;
     }
-    KdPrint(("    UDFSetSpeeds: set speed to %s %dX/%dX\n",
+    UDFPrint(("    UDFSetSpeeds: set speed to %s %dX/%dX\n",
         (Vcb->VCBFlags & UDF_VCB_FLAGS_USE_CAV) ? "CAV" : "CLV",
         Vcb->SpeedBuf.ReadSpeed / 176,
         Vcb->SpeedBuf.WriteSpeed / 176));
@@ -4255,7 +4255,7 @@ UDFSetSpeeds(
                         Vcb->TargetDeviceObject,
                         &(Vcb->SpeedBuf),sizeof(SET_CD_SPEED_EX_USER_IN),
                         NULL,0,TRUE,NULL);
-    KdPrint(("UDFSetSpeeds: %x\n", RC));
+    UDFPrint(("UDFSetSpeeds: %x\n", RC));
     return RC;
 } // end UDFSetSpeeds()
 
@@ -4285,7 +4285,7 @@ UDFSetCaching(
     MODE_SENSE_USER_IN ModeSenseCtl;
     OSSTATUS RC;
 
-    KdPrint(("UDFSetCaching:\n"));
+    UDFPrint(("UDFSetCaching:\n"));
 
     ModeSenseCtl.PageCode.Byte = MODE_PAGE_ERROR_RECOVERY;
     RC = UDFPhSendIOCTL(IOCTL_CDRW_MODE_SENSE, Vcb->TargetDeviceObject,
@@ -4293,7 +4293,7 @@ UDFSetCaching(
                     (PVOID)&RecoveryPage,sizeof(RecoveryPage),
                     FALSE, NULL);
     if(OS_SUCCESS(RC)) {
-        KdPrint(("  Error recovery page:\n"
+        UDFPrint(("  Error recovery page:\n"
             "PageCode         %d\n"
             "PageLength       %d\n"
 
@@ -4348,7 +4348,7 @@ UDFSetCaching(
         return RC;
     }
 
-    KdPrint(("  Caching page:\n"
+    UDFPrint(("  Caching page:\n"
         "PageCode         %d\n"
         "PageLength       %d\n"
         "ReadDisableCache %d\n"
@@ -4380,6 +4380,6 @@ UDFSetCaching(
     } else {
         RC = STATUS_SUCCESS;
     }
-    KdPrint(("UDFSetCaching: %x\n", RC));
+    UDFPrint(("UDFSetCaching: %x\n", RC));
     return RC;
 } // end UDFSetCaching()
index 1b77b59..60da197 100644 (file)
@@ -19,7 +19,7 @@ RegTGetKeyHandle(
     UNICODE_STRING NameString;
     NTSTATUS status;
 
-    //KdPrint(("RegTGetKeyHandle: h=%x, %S\n", hRootKey, KeyName));
+    //UDFPrint(("RegTGetKeyHandle: h=%x, %S\n", hRootKey, KeyName));
 
     RtlInitUnicodeString(&NameString, KeyName);
 
@@ -38,7 +38,7 @@ RegTGetKeyHandle(
                 );
 
     if(!NT_SUCCESS(status)) {
-        //KdPrint(("    status %x\n", status));
+        //UDFPrint(("    status %x\n", status));
         *hKey = NULL;
     }
 
@@ -135,7 +135,7 @@ RegTGetDwordValue(
 
 #ifndef WIN_32_MODE
 /*
-    KdPrint(("h=%x|%S, %S (%x)\n",
+    UDFPrint(("h=%x|%S, %S (%x)\n",
         hRootKey, RegistryPath, Name, *pUlong));
 */
     len = sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG) + 0x20;
@@ -160,9 +160,9 @@ RegTGetDwordValue(
        ValInfo->DataLength == sizeof(ULONG)) {
         RtlCopyMemory(pUlong, ValInfo->Data, sizeof(ULONG));
         retval = TRUE;
-        //KdPrint(("  -> %x\n",*pUlong));
+        //UDFPrint(("  -> %x\n",*pUlong));
     } else {
-        //KdPrint(("  err %x\n",status));
+        //UDFPrint(("  err %x\n",status));
     }
 
     MyFreePool__(ValInfo);
index f2d8344..db47913 100644 (file)
@@ -58,7 +58,7 @@ OSSTATUS __fastcall WCacheDecodeFlags(IN PW_CACHE Cache,
 #define USE_WC_PRINT
 
 #ifdef USE_WC_PRINT
- #define WcPrint KdPrint
+ #define WcPrint UDFPrint
 #else
  #define WcPrint(x) {;}
 #endif
@@ -182,41 +182,41 @@ WCacheInit__(
     _SEH2_TRY {
         // check input parameters
         if(Mode == WCACHE_MODE_R) {
-            KdPrint(("Disable Async-Write for WORM media\n"));
+            UDFPrint(("Disable Async-Write for WORM media\n"));
             WriteProcAsync = NULL;
         }
         if((MaxBlocks % PacketSize) || !MaxBlocks) {
-            KdPrint(("Total number of sectors must be packet-size-aligned\n"));
+            UDFPrint(("Total number of sectors must be packet-size-aligned\n"));
             try_return(RC = STATUS_INVALID_PARAMETER);
         }
         if(BlocksPerFrame % PacketSize) {
-            KdPrint(("Number of sectors per Frame must be packet-size-aligned\n"));
+            UDFPrint(("Number of sectors per Frame must be packet-size-aligned\n"));
             try_return(RC = STATUS_INVALID_PARAMETER);
         }
         if(!ReadProc) {
-            KdPrint(("Read routine pointer must be valid\n"));
+            UDFPrint(("Read routine pointer must be valid\n"));
             try_return(RC = STATUS_INVALID_PARAMETER);
         }
         if(FirstLba >= LastLba) {
-            KdPrint(("Invalid cached area parameters: (%x - %x)\n",FirstLba, LastLba));
+            UDFPrint(("Invalid cached area parameters: (%x - %x)\n",FirstLba, LastLba));
             try_return(RC = STATUS_INVALID_PARAMETER);
         }
         if(!MaxFrames) {
-            KdPrint(("Total frame number must be non-zero\n",FirstLba, LastLba));
+            UDFPrint(("Total frame number must be non-zero\n",FirstLba, LastLba));
             try_return(RC = STATUS_INVALID_PARAMETER);
         }
         if(Mode > WCACHE_MODE_MAX) {
-            KdPrint(("Invalid media mode. Should be 0-%x\n",WCACHE_MODE_MAX));
+            UDFPrint(("Invalid media mode. Should be 0-%x\n",WCACHE_MODE_MAX));
             try_return(RC = STATUS_INVALID_PARAMETER);
         }
         if(FramesToKeepFree >= MaxFrames/2) {
-            KdPrint(("Invalid FramesToKeepFree (%x). Should be Less or equal to MaxFrames/2 (%x)\n", FramesToKeepFree, MaxFrames/2));
+            UDFPrint(("Invalid FramesToKeepFree (%x). Should be Less or equal to MaxFrames/2 (%x)\n", FramesToKeepFree, MaxFrames/2));
             try_return(RC = STATUS_INVALID_PARAMETER);
         }
         // check 'features'
         if(!WriteProc) {
-            KdPrint(("Write routine not specified\n"));
-            KdPrint(("Read-only mode enabled\n"));
+            UDFPrint(("Write routine not specified\n"));
+            UDFPrint(("Read-only mode enabled\n"));
         }
         MaxBlocks = max(MaxBlocks, BlocksPerFrame*3);
         // initialize required structures
@@ -224,22 +224,22 @@ WCacheInit__(
         // avoid system crashes caused by pool fragmentation
         if(!(Cache->FrameList =
             (PW_CACHE_FRAME)MyAllocatePoolTag__(NonPagedPool, l1 = (((LastLba >> BlocksPerFrameSh)+1)*sizeof(W_CACHE_FRAME)), MEM_WCFRM_TAG) )) {
-            KdPrint(("Cache init err 1\n"));
+            UDFPrint(("Cache init err 1\n"));
             try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
         }
         if(!(Cache->CachedBlocksList =
             (PULONG)MyAllocatePoolTag__(NonPagedPool, l2 = ((MaxBlocks+2)*sizeof(lba_t)), MEM_WCFRM_TAG) )) {
-            KdPrint(("Cache init err 2\n"));
+            UDFPrint(("Cache init err 2\n"));
             try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
         }
         if(!(Cache->CachedModifiedBlocksList =
             (PULONG)MyAllocatePoolTag__(NonPagedPool, l2, MEM_WCFRM_TAG) )) {
-            KdPrint(("Cache init err 3\n"));
+            UDFPrint(("Cache init err 3\n"));
             try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
         }
         if(!(Cache->CachedFramesList =
             (PULONG)MyAllocatePoolTag__(NonPagedPool, l3 = ((MaxFrames+2)*sizeof(lba_t)), MEM_WCFRM_TAG) )) {
-            KdPrint(("Cache init err 4\n"));
+            UDFPrint(("Cache init err 4\n"));
             try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
         }
         RtlZeroMemory(Cache->FrameList, l1);
@@ -278,21 +278,21 @@ WCacheInit__(
         // init permanent tmp buffers
         if(!(Cache->tmp_buff =
             (PCHAR)MyAllocatePoolTag__(NonPagedPool, PacketSize*BlockSize, MEM_WCFRM_TAG))) {
-            KdPrint(("Cache init err 5.W\n"));
+            UDFPrint(("Cache init err 5.W\n"));
             try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
         }
         if(!(Cache->tmp_buff_r =
             (PCHAR)MyAllocatePoolTag__(NonPagedPool, PacketSize*BlockSize, MEM_WCFRM_TAG))) {
-            KdPrint(("Cache init err 5.R\n"));
+            UDFPrint(("Cache init err 5.R\n"));
             try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
         }
         if(!(Cache->reloc_tab =
             (PULONG)MyAllocatePoolTag__(NonPagedPool, Cache->PacketSize*sizeof(ULONG), MEM_WCFRM_TAG))) {
-            KdPrint(("Cache init err 6\n"));
+            UDFPrint(("Cache init err 6\n"));
             try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
         }
         if(!OS_SUCCESS(RC = ExInitializeResourceLite(&(Cache->WCacheLock)))) {
-            KdPrint(("Cache init err (res)\n"));
+            UDFPrint(("Cache init err (res)\n"));
             try_return(RC);
         }
         res_init_flags |= WCLOCK_RES;
@@ -1402,7 +1402,7 @@ Try_Another_Frame:
         if(!Cache->FrameCount || !Cache->BlockCount) {
             //ASSERT(!Cache->FrameCount);
             if(Cache->FrameCount) {
-                KdPrint(("ASSERT: Cache->FrameCount = %d, when 0 is expected\n", Cache->FrameCount));
+                UDFPrint(("ASSERT: Cache->FrameCount = %d, when 0 is expected\n", Cache->FrameCount));
             }
             ASSERT(!Cache->BlockCount);
             if(!Cache->FrameCount)
@@ -1435,7 +1435,7 @@ Try_Another_Frame:
         block_array = Cache->FrameList[frame].Frame;
 
         if(!block_array) {
-            KdPrint(("Hmm...\n"));
+            UDFPrint(("Hmm...\n"));
             BrutePoint();
             return STATUS_DRIVER_INTERNAL_ERROR;
         }
@@ -1701,7 +1701,7 @@ Try_Another_Frame:
         block_array = Cache->FrameList[frame].Frame;
 
         if(!block_array) {
-            KdPrint(("Hmm...\n"));
+            UDFPrint(("Hmm...\n"));
             BrutePoint();
             return STATUS_DRIVER_INTERNAL_ERROR;
         }
@@ -1784,7 +1784,7 @@ WCachePurgeAllRAM(
         block_array = Cache->FrameList[frame].Frame;
 
         if(!block_array) {
-            KdPrint(("Hmm...\n"));
+            UDFPrint(("Hmm...\n"));
             BrutePoint();
             return STATUS_DRIVER_INTERNAL_ERROR;
         }
@@ -1832,7 +1832,7 @@ WCacheFlushAllRAM(
         block_array = Cache->FrameList[frame].Frame;
 
         if(!block_array) {
-            KdPrint(("Hmm...\n"));
+            UDFPrint(("Hmm...\n"));
             BrutePoint();
             return STATUS_DRIVER_INTERNAL_ERROR;
         }
@@ -2172,7 +2172,7 @@ WCacheReadBlocks__(
                 *ReadBytes += BS*n;
             }
 //        } else {
-//            KdPrint(("Unaligned\n"));
+//            UDFPrint(("Unaligned\n"));
         }
         // read non-cached extent (if any)
         // firstable, we'll get total number of sectors to read
@@ -2309,7 +2309,7 @@ WCacheWriteBlocks__(
     WcPrint(("WC:W %x (%x)\n", Lba, BCount));
 
     *WrittenBytes = 0;
-//    KdPrint(("BCount:%x\n",BCount));
+//    UDFPrint(("BCount:%x\n",BCount));
     // check if we try to read too much data
     if(BCount >= Cache->MaxBlocks) {
         i = 0;
@@ -2318,7 +2318,7 @@ WCacheWriteBlocks__(
             goto EO_WCache_W2;
         }
         while(TRUE) {
-//            KdPrint(("  BCount:%x\n",BCount));
+//            UDFPrint(("  BCount:%x\n",BCount));
             status = WCacheWriteBlocks__(Cache, Context, Buffer + (i<<BSh), Lba, min(PS,BCount), &_WrittenBytes, FALSE);
             (*WrittenBytes) += _WrittenBytes;
             BCount -= PS;
@@ -2387,7 +2387,7 @@ WCacheWriteBlocks__(
     }
 
     Cache->FrameList[frame].UpdateCount++;
-//    KdPrint(("    BCount:%x\n",BCount));
+//    UDFPrint(("    BCount:%x\n",BCount));
     while(BCount) {
         if(i >= Cache->BlocksPerFrame) {
             frame++;
@@ -2407,7 +2407,7 @@ WCacheWriteBlocks__(
         while(BCount &&
               (i < Cache->BlocksPerFrame) &&
               (addr = (PCHAR)WCacheSectorAddr(block_array, i)) ) {
-//            KdPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",addr, Buffer, BS, BCount));
+//            UDFPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",addr, Buffer, BS, BCount));
             block_type = Cache->CheckUsedProc(Context, Lba+saved_BC-BCount);
             if(Cache->NoWriteBB &&
                /*WCacheGetBadFlag(block_array,i)*/
@@ -2434,7 +2434,7 @@ WCacheWriteBlocks__(
                 status = STATUS_INSUFFICIENT_RESOURCES;
                 goto EO_WCache_W;
             }
-//            KdPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",block_array[i].Sector, Buffer, BS, BCount));
+//            UDFPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",block_array[i].Sector, Buffer, BS, BCount));
             DbgCopyMemory(block_array[i].Sector, Buffer, BS);
             WCacheSetModFlag(block_array, i);
             i++;
@@ -2495,7 +2495,7 @@ WCacheWriteBlocks__(
                 status = STATUS_INSUFFICIENT_RESOURCES;
                 goto EO_WCache_W;
             }
-//            KdPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",block_array[i].Sector, Buffer, BS, BCount));
+//            UDFPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",block_array[i].Sector, Buffer, BS, BCount));
             DbgCopyMemory(block_array[i].Sector, Buffer, BS);
             WCacheSetModFlag(block_array, i);
             i++;
@@ -2910,7 +2910,7 @@ WCacheFlushBlocks__(
     // check if we try to access beyond cached area
     if((Lba < Cache->FirstLba) ||
        (Lba+BCount-1 > Cache->LastLba)) {
-        KdPrint(("LBA %#x (%x) is beyond cacheable area\n", Lba, BCount));
+        UDFPrint(("LBA %#x (%x) is beyond cacheable area\n", Lba, BCount));
         BrutePoint();
         status = STATUS_INVALID_PARAMETER;
         goto EO_WCache_F;
@@ -2972,7 +2972,7 @@ WCacheDirect__(
     // check if we try to access beyond cached area
     if((Lba < Cache->FirstLba) ||
        (Lba > Cache->LastLba)) {
-        KdPrint(("LBA %#x is beyond cacheable area\n", Lba));
+        UDFPrint(("LBA %#x is beyond cacheable area\n", Lba));
         BrutePoint();
         status = STATUS_INVALID_PARAMETER;
         goto EO_WCache_D;
@@ -3057,7 +3057,7 @@ WCacheDirect__(
         ASSERT(block_type & WCACHE_BLOCK_USED);
 #else
         if(!(block_type & WCACHE_BLOCK_USED)) {
-            KdPrint(("LBA %#x is not marked as used\n", Lba));
+            UDFPrint(("LBA %#x is not marked as used\n", Lba));
         }
 #endif
         if(Modified &&
@@ -3533,7 +3533,7 @@ WCacheDiscardBlocks__(
 
     ExAcquireResourceExclusiveLite(&(Cache->WCacheLock), TRUE);
 
-    KdPrint(("  Discard req: %x@%x\n",BCount, ReqLba));
+    UDFPrint(("  Discard req: %x@%x\n",BCount, ReqLba));
 
     List = Cache->CachedBlocksList;
     if(!List) {
@@ -3609,7 +3609,7 @@ WCacheDecodeFlags(
 {
     //ULONG OldFlags;
     if(Flags & ~WCACHE_VALID_FLAGS) {
-        KdPrint(("Invalid flags: %x\n", Flags & ~WCACHE_VALID_FLAGS));
+        UDFPrint(("Invalid flags: %x\n", Flags & ~WCACHE_VALID_FLAGS));
         return STATUS_INVALID_PARAMETER;
     }
     Cache->CacheWholePacket = (Flags & WCACHE_CACHE_WHOLE_PACKET) ? TRUE : FALSE;
index 4c1b751..2dbe587 100644 (file)
@@ -63,7 +63,7 @@ UDFCleanup(
         Irp->IoStatus.Information = 0;
 
         if(UDFGlobalData.AutoFormatCount == IoGetCurrentIrpStackLocation(Irp)->FileObject) {
-            KdPrint(("Deregister Autoformat\n"));
+            UDFPrint(("Deregister Autoformat\n"));
             UDFGlobalData.AutoFormatCount = NULL;
         }
 
index 74fa49e..7923958 100644 (file)
@@ -567,7 +567,7 @@ UDFCleanUpFcbChain(
                     NtReqFcb->CommonFCBHeader.Resource =
                     NtReqFcb->CommonFCBHeader.PagingIoResource = NULL;
                     UDFDeassignAcl(NtReqFcb, AutoInherited);
-                    KdPrint(("UDFReleaseNtReqFCB: %x\n", NtReqFcb));
+                    UDFPrint(("UDFReleaseNtReqFCB: %x\n", NtReqFcb));
 #ifdef DBG
 //                    NtReqFcb->FileObject->FsContext2 = NULL;
 //                    ASSERT(NtReqFcb->FileObject);
@@ -816,7 +816,7 @@ UDFBuildTreeItemsList(
     PUDF_FILE_INFO     SDirInfo;
     ULONG              i;
 
-    KdPrint(("    UDFBuildTreeItemsList():\n"));
+    UDFPrint(("    UDFBuildTreeItemsList():\n"));
     if(!(*PassedList) || !(*FoundList)) {
 
         (*PassedList) = (PUDF_FILE_INFO*)
@@ -935,7 +935,7 @@ UDFCloseAllXXXDelayedInDir(
 
     _SEH2_TRY {
 
-        KdPrint(("    UDFCloseAllXXXDelayedInDir(): Acquire DelayedCloseResource\n"));
+        UDFPrint(("    UDFCloseAllXXXDelayedInDir(): Acquire DelayedCloseResource\n"));
         // Acquire DelayedCloseResource
         UDFAcquireResourceExclusive(&(UDFGlobalData.DelayedCloseResource), TRUE);
         ResAcq = TRUE;
@@ -948,7 +948,7 @@ UDFCloseAllXXXDelayedInDir(
                 &PassedList, &PassedListSize, &FoundList, &FoundListSize);
 
         if(!NT_SUCCESS(RC)) {
-            KdPrint(("    UDFBuildTreeItemsList(): error %x\n", RC));
+            UDFPrint(("    UDFBuildTreeItemsList(): error %x\n", RC));
             try_return(RC);
         }
 
@@ -959,7 +959,7 @@ UDFCloseAllXXXDelayedInDir(
         // build array of referenced pointers
         ListPtrArray = (PFE_LIST_ENTRY*)(MyAllocatePool__(NonPagedPool, FoundListSize*sizeof(PFE_LIST_ENTRY)));
         if(!ListPtrArray) {
-            KdPrint(("    Can't alloc ListPtrArray for %x items\n", FoundListSize));
+            UDFPrint(("    Can't alloc ListPtrArray for %x items\n", FoundListSize));
             try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
         }
 
@@ -971,7 +971,7 @@ UDFCloseAllXXXDelayedInDir(
                 if(!CurFileInfo->ListPtr) {
                     CurFileInfo->ListPtr = (PFE_LIST_ENTRY)(MyAllocatePool__(NonPagedPool, sizeof(FE_LIST_ENTRY)));
                     if(!CurFileInfo->ListPtr) {
-                        KdPrint(("    Can't alloc ListPtrEntry for items %x\n", i));
+                        UDFPrint(("    Can't alloc ListPtrEntry for items %x\n", i));
                         try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
                     }
                     CurFileInfo->ListPtr->FileInfo = CurFileInfo;
index f1cb00b..0928ff1 100644 (file)
@@ -584,7 +584,7 @@ UDFCommonCreate(
             }
 #endif //UDF_READ_ONLY_BUILD
 
-            KdPrint(("  ShareAccess %x, DesiredAccess %x\n", ShareAccess, DesiredAccess));
+            UDFPrint(("  ShareAccess %x, DesiredAccess %x\n", ShareAccess, DesiredAccess));
 /*
             if(!(ShareAccess & (FILE_SHARE_WRITE | FILE_SHARE_DELETE)) &&
                !(DesiredAccess & (FILE_GENERIC_WRITE & ~SYNCHRONIZE)) &&
@@ -592,12 +592,12 @@ UDFCommonCreate(
 */
             if(!(DesiredAccess & ((GENERIC_WRITE | FILE_GENERIC_WRITE) & ~(SYNCHRONIZE | READ_CONTROL))) &&
                 (ShareAccess & FILE_SHARE_READ) ) {
-                KdPrint(("  R/O volume open\n"));
+                UDFPrint(("  R/O volume open\n"));
             } else {
 
-                KdPrint(("  R/W volume open\n"));
+                UDFPrint(("  R/W volume open\n"));
                 if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) {
-                    KdPrint(("  media-ro\n"));
+                    UDFPrint(("  media-ro\n"));
                     try_return(RC = STATUS_MEDIA_WRITE_PROTECTED);
                 }
             }
@@ -613,7 +613,7 @@ UDFCommonCreate(
                     // As soon as OpenVolume flushes the volume
                     // we should complete all pending requests (Close)
 
-                    KdPrint(("  set UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
+                    UDFPrint(("  set UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
                     PtrIrpContext->IrpContextFlags |= UDF_IRP_CONTEXT_FLUSH2_REQUIRED;
 
 /*
@@ -642,12 +642,12 @@ UDFCommonCreate(
                 if ((Vcb->VCBHandleCount) &&
                     !(ShareAccess & FILE_SHARE_READ)) {
                     // Sharing violation
-                    KdPrint(("  !FILE_SHARE_READ + open handles (%d)\n", Vcb->VCBHandleCount));
+                    UDFPrint(("  !FILE_SHARE_READ + open handles (%d)\n", Vcb->VCBHandleCount));
                     try_return(RC = STATUS_SHARING_VIOLATION);
                 }
                 if(PtrIrpContext->IrpContextFlags & UDF_IRP_CONTEXT_FLUSH2_REQUIRED) {
 
-                    KdPrint(("  perform flush\n"));
+                    UDFPrint(("  perform flush\n"));
                     PtrIrpContext->IrpContextFlags &= ~UDF_IRP_CONTEXT_FLUSH2_REQUIRED;
                     
                     UDFInterlockedIncrement((PLONG)&(Vcb->VCBOpenCount));
@@ -669,7 +669,7 @@ UDFCommonCreate(
 
                     if((ShareAccess & FILE_SHARE_READ) &&
                        ((Vcb->VCBOpenCount - UDF_RESIDUAL_REFERENCE) != (Vcb->VCBOpenCountRO))) {
-                        KdPrint(("  FILE_SHARE_READ + R/W handles: %d(%d) -> STATUS_SHARING_VIOLATION ?\n",
+                        UDFPrint(("  FILE_SHARE_READ + R/W handles: %d(%d) -> STATUS_SHARING_VIOLATION ?\n",
                             Vcb->VCBOpenCount - UDF_RESIDUAL_REFERENCE,
                             Vcb->VCBOpenCountRO));
                         /* we shall not check it here, let System do it in IoCheckShareAccess() */
@@ -678,13 +678,13 @@ UDFCommonCreate(
                 }
                 // Lock the volume
                 if(!(ShareAccess & FILE_SHARE_READ)) {
-                    KdPrint(("  set Lock\n"));
+                    UDFPrint(("  set Lock\n"));
                     Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_LOCKED;
                     Vcb->VolumeLockFileObject = PtrNewFileObject;
                     UndoLock = TRUE;
                 } else 
                 if(DesiredAccess & ((GENERIC_WRITE | FILE_GENERIC_WRITE) & ~(SYNCHRONIZE | READ_CONTROL))) {
-                    KdPrint(("  set UDF_IRP_CONTEXT_FLUSH_REQUIRED\n"));
+                    UDFPrint(("  set UDF_IRP_CONTEXT_FLUSH_REQUIRED\n"));
                     PtrIrpContext->IrpContextFlags |= UDF_IRP_CONTEXT_FLUSH_REQUIRED;
                 }
             }
@@ -765,7 +765,7 @@ op_vol_accs_dnd:
             PUNICODE_STRING TmpPath;
             LONGLONG Id;
 
-            KdPrint(("    open by File ID\n"));
+            UDFPrint(("    open by File ID\n"));
             if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
                 ReturnedInformation = 0;
                 AdPrint(("    Can't open by FileID on blank volume ;)\n"));
@@ -809,7 +809,7 @@ op_vol_accs_dnd:
             //  This implies a "relative" open i.e. relative to the directory
             //  represented by the related file object ...
 
-            KdPrint(("    PtrRelatedFileObject %x, FCB %x\n", PtrRelatedFileObject, PtrRelatedFCB));
+            UDFPrint(("    PtrRelatedFileObject %x, FCB %x\n", PtrRelatedFileObject, PtrRelatedFCB));
             //  Note: The only purpose FSD implementations ever have for
             //  the related file object is to determine whether this
             //  is a relative open or not. At all other times (including
@@ -880,7 +880,7 @@ op_vol_accs_dnd:
         // ****************
             // The suplied path-name must be an absolute path-name i.e.
             //  starting at the root of the file system tree
-            KdPrint(("    Absolute open\n"));
+            UDFPrint(("    Absolute open\n"));
             ASSERT(TargetObjectName.Buffer);
             if (!TargetObjectName.Length || TargetObjectName.Buffer[0] != L'\\') {
                 AdPrint(("    Wrong target name (1)\n"));
@@ -2325,7 +2325,7 @@ UDFFirstOpenFile(
                     (PtrUDFNTRequiredFCB)MyAllocatePool__(NonPagedPool, UDFQuadAlign(sizeof(UDFNTRequiredFCB))) ) )
             return STATUS_INSUFFICIENT_RESOURCES;
 
-        KdPrint(("UDFAllocateNtReqFCB: %x\n", (*PtrNewFcb)->NTRequiredFCB));
+        UDFPrint(("UDFAllocateNtReqFCB: %x\n", (*PtrNewFcb)->NTRequiredFCB));
         RtlZeroMemory((*PtrNewFcb)->NTRequiredFCB, UDFQuadAlign(sizeof(UDFNTRequiredFCB)));
         (*PtrNewFcb)->FileInfo->Dloc->CommonFcb = (*PtrNewFcb)->NTRequiredFCB;
         Linked = FALSE;
index 5b6a7d1..004c1e8 100644 (file)
@@ -171,7 +171,7 @@ UDFCommonDeviceControl(
     PCHAR                   CdbData;
     PCHAR                   ModeSelectData;
 
-    KdPrint(("UDFCommonDeviceControl\n"));
+    UDFPrint(("UDFCommonDeviceControl\n"));
 
     _SEH2_TRY {
         // First, get a pointer to the current I/O stack location
@@ -197,14 +197,14 @@ UDFCommonDeviceControl(
             case IOCTL_UDF_REGISTER_AUTOFORMAT:
                 break;
             default:
-                KdPrint(("UDFCommonDeviceControl: STATUS_INVALID_PARAMETER %x for FsDevObj\n", IoControlCode));
+                UDFPrint(("UDFCommonDeviceControl: STATUS_INVALID_PARAMETER %x for FsDevObj\n", IoControlCode));
                 CompleteIrp = TRUE;
                 try_return(RC = STATUS_INVALID_PARAMETER);
             }
         } else {
             Ccb = (PtrUDFCCB)(FileObject->FsContext2);
             if(!Ccb) {
-                KdPrint(("  !Ccb\n"));
+                UDFPrint(("  !Ccb\n"));
                 goto ioctl_do_default;
             }
             ASSERT(Ccb);
@@ -225,7 +225,7 @@ UDFCommonDeviceControl(
                 case IOCTL_UDF_SET_FILE_ALLOCATION_MODE:
                     break;
                 default:
-                    KdPrint(("UDFCommonDeviceControl: STATUS_INVALID_PARAMETER %x for File/Dir Obj\n", IoControlCode));
+                    UDFPrint(("UDFCommonDeviceControl: STATUS_INVALID_PARAMETER %x for File/Dir Obj\n", IoControlCode));
                     try_return(RC = STATUS_INVALID_PARAMETER);
                 }
             }
@@ -323,7 +323,7 @@ UDFCommonDeviceControl(
             AcquiredVcb = TRUE;
         }
 
-        KdPrint(("UDF Irp %x, ctx %x, DevIoCtl %x\n", Irp, PtrIrpContext, IoControlCode));
+        UDFPrint(("UDF Irp %x, ctx %x, DevIoCtl %x\n", Irp, PtrIrpContext, IoControlCode));
 
         // We may wish to allow only   volume open operations.
         switch (IoControlCode) {
@@ -349,7 +349,7 @@ UDFCommonDeviceControl(
             ScsiCommand = Cdb->CDB6.OperationCode;
 
             if(ScsiCommand == SCSIOP_WRITE_CD) {
-                KdPrint(("Write10, LBA %2.2x%2.2x%2.2x%2.2x\n",
+                UDFPrint(("Write10, LBA %2.2x%2.2x%2.2x%2.2x\n",
                          Cdb->WRITE_CD.LBA[0],
                          Cdb->WRITE_CD.LBA[1],
                          Cdb->WRITE_CD.LBA[2],
@@ -357,7 +357,7 @@ UDFCommonDeviceControl(
                          ));
             } else
             if(ScsiCommand == SCSIOP_WRITE12) {
-                KdPrint(("Write12, LBA %2.2x%2.2x%2.2x%2.2x\n",
+                UDFPrint(("Write12, LBA %2.2x%2.2x%2.2x%2.2x\n",
                          Cdb->CDB12READWRITE.LBA[0],
                          Cdb->CDB12READWRITE.LBA[1],
                          Cdb->CDB12READWRITE.LBA[2],
@@ -374,7 +374,7 @@ UDFCommonDeviceControl(
                 case MODE_PAGE_MRW2:
                 case MODE_PAGE_WRITE_PARAMS:
                 case MODE_PAGE_MRW:
-                    KdPrint(("Unsafe MODE_SELECT_6 via pass-through (%2.2x)\n", ModeSelectData[0]));
+                    UDFPrint(("Unsafe MODE_SELECT_6 via pass-through (%2.2x)\n", ModeSelectData[0]));
                     goto unsafe_direct_scsi_cmd;
                 }
                 break; }
@@ -386,7 +386,7 @@ UDFCommonDeviceControl(
                 case MODE_PAGE_MRW2:
                 case MODE_PAGE_WRITE_PARAMS:
                 case MODE_PAGE_MRW:
-                    KdPrint(("Unsafe MODE_SELECT_10 via pass-through (%2.2x)\n", ModeSelectData[0]));
+                    UDFPrint(("Unsafe MODE_SELECT_10 via pass-through (%2.2x)\n", ModeSelectData[0]));
                     goto unsafe_direct_scsi_cmd;
                 }
                 break; }
@@ -401,12 +401,12 @@ UDFCommonDeviceControl(
             case SCSIOP_BLANK:
             case SCSIOP_WRITE12:
             case SCSIOP_SET_STREAMING:
-                KdPrint(("UDF Direct media modification via pass-through (%2.2x)\n", ScsiCommand));
+                UDFPrint(("UDF Direct media modification via pass-through (%2.2x)\n", ScsiCommand));
 unsafe_direct_scsi_cmd:
                 if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED))
                     goto ioctl_do_default;
 
-                KdPrint(("Forget this volume\n"));
+                UDFPrint(("Forget this volume\n"));
                 // Acquire Vcb resource (Shared -> Exclusive)
                 UDFInterlockedIncrement((PLONG)&(Vcb->VCBOpenCount));
                 UDFReleaseResource(&(Vcb->VCBResource));
@@ -447,7 +447,7 @@ unsafe_direct_scsi_cmd:
                 // some CD-recording libraries
                 Vcb->SerialNumber--;
 
-                KdPrint(("Forgotten\n"));
+                UDFPrint(("Forgotten\n"));
 
                 goto notify_media_change;
 
@@ -455,7 +455,7 @@ unsafe_direct_scsi_cmd:
             case SCSIOP_DOORLOCK:
             case SCSIOP_DOORUNLOCK:
             case SCSIOP_MEDIUM_REMOVAL:
-                KdPrint(("UDF Medium/Tray control IOCTL via pass-through\n"));
+                UDFPrint(("UDF Medium/Tray control IOCTL via pass-through\n"));
             }
             goto ioctl_do_default;
 
@@ -473,7 +473,7 @@ notify_media_change:
 
         case IOCTL_UDF_REGISTER_AUTOFORMAT: {
 
-            KdPrint(("UDF Register Autoformat\n"));
+            UDFPrint(("UDF Register Autoformat\n"));
             if(UDFGlobalData.AutoFormatCount) {
                 RC = STATUS_SHARING_VIOLATION;
             } else {
@@ -487,7 +487,7 @@ notify_media_change:
 
         case IOCTL_UDF_DISABLE_DRIVER: {
 
-            KdPrint(("UDF Disable driver\n"));
+            UDFPrint(("UDF Disable driver\n"));
             IoUnregisterFileSystem(UDFGlobalData.UDFDeviceObject);
             // Now, delete any device objects, etc. we may have created
             if (UDFGlobalData.UDFDeviceObject) {
@@ -513,7 +513,7 @@ notify_media_change:
             break;
         }
         case IOCTL_UDF_INVALIDATE_VOLUMES: {
-            KdPrint(("UDF Invaidate volume\n"));
+            UDFPrint(("UDF Invaidate volume\n"));
             if(AcquiredVcb) {
                 UDFReleaseResource(&(Vcb->VCBResource));
                 AcquiredVcb = FALSE;
@@ -594,13 +594,13 @@ notify_media_change:
 
         //case FSCTL_GET_RETRIEVAL_POINTERS
         case IOCTL_UDF_GET_RETRIEVAL_POINTERS: {
-            KdPrint(("UDF: Get Retrieval Pointers\n"));
+            UDFPrint(("UDF: Get Retrieval Pointers\n"));
             RC = UDFGetRetrievalPointers( PtrIrpContext, Irp, 0 );
             CompleteIrp = TRUE;
             break;
         }
         case IOCTL_UDF_GET_SPEC_RETRIEVAL_POINTERS: {
-            KdPrint(("UDF: Get Spec Retrieval Pointers\n"));
+            UDFPrint(("UDF: Get Spec Retrieval Pointers\n"));
             PUDF_GET_SPEC_RETRIEVAL_POINTERS_IN SpecRetrPointer;
             SpecRetrPointer = (PUDF_GET_SPEC_RETRIEVAL_POINTERS_IN)(Irp->AssociatedIrp.SystemBuffer);
             RC = UDFGetRetrievalPointers( PtrIrpContext, Irp, SpecRetrPointer->Special );
@@ -608,14 +608,14 @@ notify_media_change:
             break;
         }
         case IOCTL_UDF_GET_FILE_ALLOCATION_MODE: {
-            KdPrint(("UDF: Get File Alloc mode (from ICB)\n"));
+            UDFPrint(("UDF: Get File Alloc mode (from ICB)\n"));
             RC = UDFGetFileAllocModeFromICB( PtrIrpContext, Irp );
             CompleteIrp = TRUE;
             break;
         }
 #ifndef UDF_READ_ONLY_BUILD
         case IOCTL_UDF_SET_FILE_ALLOCATION_MODE: {
-            KdPrint(("UDF: Set File Alloc mode\n"));
+            UDFPrint(("UDF: Set File Alloc mode\n"));
             RC = UDFSetFileAllocModeFromICB( PtrIrpContext, Irp );
             CompleteIrp = TRUE;
             break;
@@ -650,24 +650,24 @@ notify_media_change:
 
             PUDF_GET_VERSION_OUT udf_ver;
 
-            KdPrint(("UDFUserFsCtrlRequest: IOCTL_UDF_GET_VERSION\n"));
+            UDFPrint(("UDFUserFsCtrlRequest: IOCTL_UDF_GET_VERSION\n"));
 
             Irp->IoStatus.Information = 0;
             CompleteIrp = TRUE;
 
             if(!IrpSp->Parameters.DeviceIoControl.OutputBufferLength) {
-                KdPrint(("!OutputBufferLength\n"));
+                UDFPrint(("!OutputBufferLength\n"));
                 try_return(RC = STATUS_SUCCESS);
             }
             //  Check the size of the output buffer.
             if(IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(UDF_GET_VERSION_OUT)) {
-                KdPrint(("OutputBufferLength < %x\n", sizeof(UDF_GET_VERSION_OUT)));
+                UDFPrint(("OutputBufferLength < %x\n", sizeof(UDF_GET_VERSION_OUT)));
                 try_return(RC = STATUS_BUFFER_TOO_SMALL);
             }
 
             udf_ver = (PUDF_GET_VERSION_OUT)(Irp->AssociatedIrp.SystemBuffer);
             if(!udf_ver) {
-                KdPrint(("!udf_ver\n"));
+                UDFPrint(("!udf_ver\n"));
                 try_return(RC = STATUS_INVALID_USER_BUFFER);
             }
 
@@ -685,23 +685,23 @@ notify_media_change:
                 (Vcb->CompatFlags & UDF_VCB_IC_DIRTY_RO)) 
                     ||
                (Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) ) {
-                KdPrint(("  UDF_USER_FS_FLAGS_RO\n"));
+                UDFPrint(("  UDF_USER_FS_FLAGS_RO\n"));
                 udf_ver->FSFlags |= UDF_USER_FS_FLAGS_RO;
             }
             if(Vcb->VCBFlags & UDF_VCB_FLAGS_OUR_DEVICE_DRIVER) {
-                KdPrint(("  UDF_USER_FS_FLAGS_OUR_DRIVER\n"));
+                UDFPrint(("  UDF_USER_FS_FLAGS_OUR_DRIVER\n"));
                 udf_ver->FSFlags |= UDF_USER_FS_FLAGS_OUR_DRIVER;
             }
             if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
-                KdPrint(("  UDF_USER_FS_FLAGS_RAW\n"));
+                UDFPrint(("  UDF_USER_FS_FLAGS_RAW\n"));
                 udf_ver->FSFlags |= UDF_USER_FS_FLAGS_RAW;
             }
             if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) {
-                KdPrint(("  UDF_USER_FS_FLAGS_MEDIA_RO\n"));
+                UDFPrint(("  UDF_USER_FS_FLAGS_MEDIA_RO\n"));
                 udf_ver->FSFlags |= UDF_USER_FS_FLAGS_MEDIA_RO;
             }
             if(Vcb->FP_disc) {
-                KdPrint(("  UDF_USER_FS_FLAGS_FP\n"));
+                UDFPrint(("  UDF_USER_FS_FLAGS_FP\n"));
                 udf_ver->FSFlags |= UDF_USER_FS_FLAGS_FP;
             }
             udf_ver->FSCompatFlags = Vcb->CompatFlags;
@@ -718,24 +718,24 @@ notify_media_change:
             PUDF_SET_OPTIONS_IN udf_opt;
             BOOLEAN PrevVerifyOnWrite;
 
-            KdPrint(("UDF: IOCTL_UDF_SET_OPTIONS\n"));
+            UDFPrint(("UDF: IOCTL_UDF_SET_OPTIONS\n"));
 
             Irp->IoStatus.Information = 0;
             CompleteIrp = TRUE;
 
             if(IrpSp->Parameters.DeviceIoControl.InputBufferLength < sizeof(UDF_SET_OPTIONS_IN)) {
-                KdPrint(("InputBufferLength < %x\n", sizeof(UDF_SET_OPTIONS_IN)));
+                UDFPrint(("InputBufferLength < %x\n", sizeof(UDF_SET_OPTIONS_IN)));
                 try_return(RC = STATUS_BUFFER_TOO_SMALL);
             }
 
             udf_opt = (PUDF_SET_OPTIONS_IN)(Irp->AssociatedIrp.SystemBuffer);
             if(!udf_opt) {
-                KdPrint(("!udf_opt\n"));
+                UDFPrint(("!udf_opt\n"));
                 try_return(RC = STATUS_INVALID_USER_BUFFER);
             }
 
             if((udf_opt->header.Flags & UDF_SET_OPTIONS_FLAG_MASK) != UDF_SET_OPTIONS_FLAG_TEMPORARY) {
-                KdPrint(("invalid opt target\n"));
+                UDFPrint(("invalid opt target\n"));
                 try_return(RC = STATUS_INVALID_PARAMETER);
             }
 
@@ -772,19 +772,19 @@ notify_media_change:
 
             PUDF_GET_OPTIONS_VERSION_OUT udf_opt_ver;
 
-            KdPrint(("UDF: IOCTL_UDF_GET_OPTIONS_VERSION\n"));
+            UDFPrint(("UDF: IOCTL_UDF_GET_OPTIONS_VERSION\n"));
 
             Irp->IoStatus.Information = 0;
             CompleteIrp = TRUE;
 
             if(IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(UDF_GET_OPTIONS_VERSION_OUT)) {
-                KdPrint(("OutputBufferLength < %x\n", sizeof(UDF_GET_OPTIONS_VERSION_OUT)));
+                UDFPrint(("OutputBufferLength < %x\n", sizeof(UDF_GET_OPTIONS_VERSION_OUT)));
                 try_return(RC = STATUS_BUFFER_TOO_SMALL);
             }
 
             udf_opt_ver = (PUDF_GET_OPTIONS_VERSION_OUT)(Irp->AssociatedIrp.SystemBuffer);
             if(!udf_opt_ver) {
-                KdPrint(("!udf_opt-ver\n"));
+                UDFPrint(("!udf_opt-ver\n"));
                 try_return(RC = STATUS_INVALID_USER_BUFFER);
             }
 /*
@@ -803,14 +803,14 @@ notify_media_change:
 #endif //0
         case IOCTL_CDRW_RESET_DRIVER:
 
-            KdPrint(("UDF: IOCTL_CDRW_RESET_DRIVER\n"));
+            UDFPrint(("UDF: IOCTL_CDRW_RESET_DRIVER\n"));
             Vcb->MediaLockCount = 0;
             Vcb->VCBFlags &= ~UDF_VCB_FLAGS_MEDIA_LOCKED;
             goto ioctl_do_default;
 
         case FSCTL_ALLOW_EXTENDED_DASD_IO:
 
-            KdPrint(("UDFUserFsCtrlRequest: FSCTL_ALLOW_EXTENDED_DASD_IO\n"));
+            UDFPrint(("UDFUserFsCtrlRequest: FSCTL_ALLOW_EXTENDED_DASD_IO\n"));
             // DASD i/o is always permitted
             // So, no-op this call
             RC = STATUS_SUCCESS;
@@ -822,7 +822,7 @@ notify_media_change:
 
         case FSCTL_IS_VOLUME_DIRTY:
 
-            KdPrint(("UDFUserFsCtrlRequest: FSCTL_IS_VOLUME_DIRTY\n"));
+            UDFPrint(("UDFUserFsCtrlRequest: FSCTL_IS_VOLUME_DIRTY\n"));
             // DASD i/o is always permitted
             // So, no-op this call
             RC = UDFIsVolumeDirty(PtrIrpContext, Irp);
@@ -833,18 +833,18 @@ notify_media_change:
         case IOCTL_DISK_EJECT_MEDIA:
         case IOCTL_CDROM_EJECT_MEDIA: {
 
-            KdPrint(("UDF Reset/Eject request\n"));
+            UDFPrint(("UDF Reset/Eject request\n"));
 //            PPREVENT_MEDIA_REMOVAL_USER_IN Buf;
 
             if(Vcb->EjectWaiter) {
-                KdPrint(("  Vcb->EjectWaiter present\n"));
+                UDFPrint(("  Vcb->EjectWaiter present\n"));
                 Irp->IoStatus.Information = 0;
                 Vcb->EjectWaiter->SoftEjectReq = TRUE;
                 Vcb->SoftEjectReq = TRUE;
                 CompleteIrp = TRUE;
                 try_return(RC = STATUS_SUCCESS);
             }
-            KdPrint(("  !Vcb->EjectWaiter\n"));
+            UDFPrint(("  !Vcb->EjectWaiter\n"));
             goto ioctl_do_default;
 /*
             Buf = (PPREVENT_MEDIA_REMOVAL_USER_IN)MyAllocatePool__(NonPagedPool, sizeof(PREVENT_MEDIA_REMOVAL_USER_IN));
@@ -869,7 +869,7 @@ notify_media_change:
         }
         case IOCTL_CDROM_DISK_TYPE: {
 
-            KdPrint(("UDF Cdrom Disk Type\n"));
+            UDFPrint(("UDF Cdrom Disk Type\n"));
             CompleteIrp = TRUE;
             //  Verify the Vcb in this case to detect if the volume has changed.
             Irp->IoStatus.Information = 0;
@@ -900,15 +900,15 @@ notify_media_change:
         case IOCTL_STORAGE_MEDIA_REMOVAL:
         case IOCTL_DISK_MEDIA_REMOVAL:
         case IOCTL_CDROM_MEDIA_REMOVAL: {
-            KdPrint(("UDF Lock/Unlock\n"));
+            UDFPrint(("UDF Lock/Unlock\n"));
             PPREVENT_MEDIA_REMOVAL_USER_IN buffer; // user supplied buffer
             buffer = (PPREVENT_MEDIA_REMOVAL_USER_IN)(Irp->AssociatedIrp.SystemBuffer);
             if(!buffer) {
                 if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
-                    KdPrint(("!mounted\n"));
+                    UDFPrint(("!mounted\n"));
                     goto ioctl_do_default;
                 }
-                KdPrint(("abort\n"));
+                UDFPrint(("abort\n"));
                 CompleteIrp = TRUE;
                 Irp->IoStatus.Information = 0;
                 UnsafeIoctl = FALSE;
@@ -918,9 +918,9 @@ notify_media_change:
             if(!buffer->PreventMediaRemoval &&
                !Vcb->MediaLockCount) {
 
-                KdPrint(("!locked + unlock req\n"));
+                UDFPrint(("!locked + unlock req\n"));
                 if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
-                    KdPrint(("!mounted\n"));
+                    UDFPrint(("!mounted\n"));
                     goto ioctl_do_default;
                 }
 #if 0
@@ -954,40 +954,40 @@ notify_media_change:
                 // just ignore
 #endif
 ignore_lock:
-                KdPrint(("ignore lock/unlock\n"));
+                UDFPrint(("ignore lock/unlock\n"));
                 CompleteIrp = TRUE;
                 Irp->IoStatus.Information = 0;
                 RC = STATUS_SUCCESS;
                 break;
             }
             if(buffer->PreventMediaRemoval) {
-                KdPrint(("lock req\n"));
+                UDFPrint(("lock req\n"));
                 Vcb->MediaLockCount++;
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_MEDIA_LOCKED;
                 UnsafeIoctl = FALSE;
             } else {
-                KdPrint(("unlock req\n"));
+                UDFPrint(("unlock req\n"));
                 if(Vcb->MediaLockCount) {
-                    KdPrint(("lock count %d\n", Vcb->MediaLockCount));
+                    UDFPrint(("lock count %d\n", Vcb->MediaLockCount));
                     UnsafeIoctl = FALSE;
                     Vcb->MediaLockCount--;
                 }
             }
             if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
-                KdPrint(("!mounted\n"));
+                UDFPrint(("!mounted\n"));
                 goto ioctl_do_default;
             }
             goto ignore_lock;
         }
         default:
 
-            KdPrint(("default processing Irp %x, ctx %x, DevIoCtl %x\n", Irp, PtrIrpContext, IoControlCode));
+            UDFPrint(("default processing Irp %x, ctx %x, DevIoCtl %x\n", Irp, PtrIrpContext, IoControlCode));
 ioctl_do_default:
 
             // make sure volume is Sync'ed BEFORE sending unsafe IOCTL
             if(Vcb && UnsafeIoctl) {
                 UDFFlushLogicalVolume(NULL, NULL, Vcb, 0);
-                KdPrint(("  sync'ed\n"));
+                UDFPrint(("  sync'ed\n"));
             }
             // Invoke the lower level driver in the chain.
             //PtrNextIoStackLocation = IoGetNextIrpStackLocation(Irp);
@@ -1007,7 +1007,7 @@ ioctl_do_default:
         }
 
         if(Vcb && UnsafeIoctl) {
-            KdPrint(("  set UnsafeIoctl\n"));
+            UDFPrint(("  set UnsafeIoctl\n"));
             Vcb->VCBFlags |= UDF_VCB_FLAGS_UNSAFE_IOCTL;
         }
 
@@ -1026,7 +1026,7 @@ try_exit: NOTHING;
 
         if (!_SEH2_AbnormalTermination() &&
             CompleteIrp) {
-            KdPrint(("  complete Irp %x, ctx %x, status %x, iolen %x\n",
+            UDFPrint(("  complete Irp %x, ctx %x, status %x, iolen %x\n",
                 Irp, PtrIrpContext, RC, Irp->IoStatus.Information));
             Irp->IoStatus.Status = RC;
             // complete the IRP
@@ -1065,9 +1065,9 @@ UDFDevIoctlCompletion(
     ULONG                   IoControlCode = 0;*/
     PtrUDFIrpContext       PtrIrpContext = (PtrUDFIrpContext)Context;
 
-    KdPrint(("UDFDevIoctlCompletion Irp %x, ctx %x\n", Irp, Context));
+    UDFPrint(("UDFDevIoctlCompletion Irp %x, ctx %x\n", Irp, Context));
     if (Irp->PendingReturned) {
-        KdPrint(("  IoMarkIrpPending\n"));
+        UDFPrint(("  IoMarkIrpPending\n"));
         IoMarkIrpPending(Irp);
     }
 
@@ -1111,7 +1111,7 @@ VOID           *BufferPointer)
     ULONG                       LengthOfMatchedName = 0;
     WCHAR                *NameToBeMatched = RequestBuffer->FilePathName;
 
-    KdPrint(("UDFHandleQueryPath\n"));
+    UDFPrint(("UDFHandleQueryPath\n"));
     // So here we are. Simply check the name supplied.
     // We can use whatever algorithm we like to determine whether the
     // sent in name is acceptable.
@@ -1142,7 +1142,7 @@ UDFGetFileAllocModeFromICB(
     PtrUDFCCB Ccb;
     PUDF_GET_FILE_ALLOCATION_MODE_OUT OutputBuffer;
 
-    KdPrint(("UDFGetFileAllocModeFromICB\n"));
+    UDFPrint(("UDFGetFileAllocModeFromICB\n"));
 
     // Decode the file object, the only type of opens we accept are
     // user volume opens.
@@ -1181,7 +1181,7 @@ UDFSetFileAllocModeFromICB(
     NTSTATUS RC;
     UCHAR AllocMode;
 
-    KdPrint(("UDFSetFileAllocModeFromICB\n"));
+    UDFPrint(("UDFSetFileAllocModeFromICB\n"));
 
     Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
     Fcb = Ccb->Fcb;
index 60f9215..e99d22a 100644 (file)
@@ -256,7 +256,7 @@ UDFQueryDirectory(
     // do some pre-init...
     SearchPattern.Buffer = NULL;
 
-    KdPrint(("UDFQueryDirectory: @=%#x\n", &PtrIrpContext));
+    UDFPrint(("UDFQueryDirectory: @=%#x\n", &PtrIrpContext));
 
 #define CanBe8dot3    (FNM_Flags & UDF_FNM_FLAG_CAN_BE_8D3)
 #define IgnoreCase    (FNM_Flags & UDF_FNM_FLAG_IGNORE_CASE)
@@ -589,7 +589,7 @@ try_exit:   NOTHING;
         } else {
 #ifdef UDF_DBG
             if(!NT_SUCCESS(RC)) {
-               KdPrint(("    Not found\n"));
+               UDFPrint(("    Not found\n"));
             }
 #endif // UDF_DBG
             // Remember to update the CurrentByteOffset field in the CCB if required.
@@ -700,7 +700,7 @@ UDFNotifyChangeDirectory(
     BOOLEAN                     AcquiredFCB = FALSE;
     PEXTENDED_IO_STACK_LOCATION pStackLocation = (PEXTENDED_IO_STACK_LOCATION) IrpSp;
 
-    KdPrint(("UDFNotifyChangeDirectory\n"));
+    UDFPrint(("UDFNotifyChangeDirectory\n"));
 
     _SEH2_TRY {
 
index cdf7663..abd299a 100644 (file)
@@ -51,7 +51,7 @@ THREAD_REC_BLOCK DLDThreadAcquireChain[DLD_MAX_REC_LEVEL];
 VOID DLDInit(ULONG MaxThrdCount /// Maximum supported number of threads
 ) {
     if (KeNumberProcessors>1) {
-        KdPrint(("Deadlock Detector is designed for uniprocessor machines only!\n"));
+        UDFPrint(("Deadlock Detector is designed for uniprocessor machines only!\n"));
         BrutePoint();
     }
     DLDpTimeout.QuadPart = -40000000I64;
@@ -84,7 +84,7 @@ PTHREAD_STRUCT DLDAllocFindThread(ULONG ThreadId) {
     // Not found. Allocate new one.
     if (i == MaxThreadCount) {
         if (FirstEmpty == -1) {
-            KdPrint(("Not enough table entries. Try to increase MaxThrdCount on next build"));
+            UDFPrint(("Not enough table entries. Try to increase MaxThrdCount on next build"));
             BrutePoint();
         }
         i = FirstEmpty;
@@ -127,18 +127,18 @@ BOOLEAN DLDProcessThread(PTHREAD_STRUCT ThrdOwner,
 
     if (ThrdOwner == ThrdStruct) {
         // ERESOURCE wait cycle. Deadlock detected.
-        KdPrint(("DLD: *********DEADLOCK DETECTED*********\n"));
-        KdPrint(("Thread %x holding resource %x\n",ThrdOwner->ThreadId,Resource));
+        UDFPrint(("DLD: *********DEADLOCK DETECTED*********\n"));
+        UDFPrint(("Thread %x holding resource %x\n",ThrdOwner->ThreadId,Resource));
         return TRUE;
     }
 
     for (int i=RecLevel+1;i<DLD_MAX_REC_LEVEL;i++) {
         if (DLDThreadAcquireChain[i].Thread->ThreadId == ThrdOwner->ThreadId) {
             // ERESOURCE wait cycle. Deadlock detected.
-            KdPrint(("DLD: *********DEADLOCK DETECTED*********\n"));
-            KdPrint(("Thread %x holding resource %x\n",ThrdOwner->ThreadId,Resource));
+            UDFPrint(("DLD: *********DEADLOCK DETECTED*********\n"));
+            UDFPrint(("Thread %x holding resource %x\n",ThrdOwner->ThreadId,Resource));
             for (int j=RecLevel+1;j<=i;j++) {
-                KdPrint((" awaited by thread %x at (BugCheckId:%x:Line:%d) holding resource %x\n",
+                UDFPrint((" awaited by thread %x at (BugCheckId:%x:Line:%d) holding resource %x\n",
                 DLDThreadAcquireChain[i].Thread->ThreadId,
                 DLDThreadAcquireChain[i].Thread->BugCheckId, 
                 DLDThreadAcquireChain[i].Thread->Line,
@@ -154,7 +154,7 @@ BOOLEAN DLDProcessThread(PTHREAD_STRUCT ThrdOwner,
     // Find resource, awaited by thread
     if (ThrdOwner->WaitingResource) {
         if (DLDProcessResource(ThrdOwner->WaitingResource, ThrdStruct,RecLevel)) {
-            KdPrint((" awaited by thread %x at (BugCheckId:%x:Line:%d) holding resource %x\n",
+            UDFPrint((" awaited by thread %x at (BugCheckId:%x:Line:%d) holding resource %x\n",
             ThrdOwner->ThreadId, 
             ThrdOwner->BugCheckId, 
             ThrdOwner->Line, 
@@ -239,7 +239,7 @@ VOID DLDpWaitForResource(
             ResourceWaitCount = 0;
 
             if (DLDProcessResource(Resource, ThrdStruct,DLD_MAX_REC_LEVEL)) {
-                KdPrint((" which thread %x has tried to acquire at (BugCheckId:%x:Line:%d)\n",
+                UDFPrint((" which thread %x has tried to acquire at (BugCheckId:%x:Line:%d)\n",
                 ThrdStruct->ThreadId,
                 ThrdStruct->BugCheckId,
                 ThrdStruct->Line      
index 5ea45ce..aed3a06 100644 (file)
@@ -43,7 +43,7 @@ UDFAsyncCompletionRoutine(
     IN PVOID Contxt
     )
 {
-    KdPrint(("UDFAsyncCompletionRoutine ctx=%x\n", Contxt));
+    UDFPrint(("UDFAsyncCompletionRoutine ctx=%x\n", Contxt));
     PUDF_PH_CALL_CONTEXT Context = (PUDF_PH_CALL_CONTEXT)Contxt;
     PMDL Mdl, NextMdl;
 
@@ -85,7 +85,7 @@ UDFSyncCompletionRoutine(
     IN PVOID Contxt
     )
 {
-    KdPrint(("UDFSyncCompletionRoutine ctx=%x\n", Contxt));
+    UDFPrint(("UDFSyncCompletionRoutine ctx=%x\n", Contxt));
     PUDF_PH_CALL_CONTEXT Context = (PUDF_PH_CALL_CONTEXT)Contxt;
 
     Context->IosbToUse = Irp->IoStatus;
@@ -102,7 +102,7 @@ UDFSyncCompletionRoutine2(
     IN PVOID Contxt
     )
 {
-    KdPrint(("UDFSyncCompletionRoutine2\n"));
+    UDFPrint(("UDFSyncCompletionRoutine2\n"));
     PKEVENT SyncEvent = (PKEVENT)Contxt;
 
     KeSetEvent( SyncEvent, 0, FALSE );
@@ -160,8 +160,8 @@ UDFPhReadSynchronous(
     KeQuerySystemTime((PLARGE_INTEGER)&IoEnterTime);
 #endif //MEASURE_IO_PERFORMANCE
 
-    KdPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0xb,Offset>>0xb));
-//    KdPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0x9,Offset>>0x9));
+    UDFPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0xb,Offset>>0xb));
+//    UDFPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0x9,Offset>>0x9));
 
     ROffset.QuadPart = Offset;
     (*ReadBytes) = 0;
@@ -175,12 +175,12 @@ UDFPhReadSynchronous(
         IoBuf = DbgAllocatePoolWithTag(NonPagedPool, Length, 'bNWD');
     }
     if (!IoBuf) {
-        KdPrint(("    !IoBuf\n"));
+        UDFPrint(("    !IoBuf\n"));
         return STATUS_INSUFFICIENT_RESOURCES;
     }
     Context = (PUDF_PH_CALL_CONTEXT)MyAllocatePool__( NonPagedPool, sizeof(UDF_PH_CALL_CONTEXT) );
     if (!Context) {
-        KdPrint(("    !Context\n"));
+        UDFPrint(("    !Context\n"));
         try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
     }
     // Create notification event object to be used to signal the request completion.
@@ -190,7 +190,7 @@ UDFPhReadSynchronous(
         irp = IoBuildAsynchronousFsdRequest(IRP_MJ_READ, DeviceObject, IoBuf,
                                                Length, &ROffset, &(Context->IosbToUse) );
         if (!irp) {
-            KdPrint(("    !irp Async\n"));
+            UDFPrint(("    !irp Async\n"));
             try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
         }
         MmPrint(("    Alloc async Irp MDL=%x, ctx=%x\n", irp->MdlAddress, Context));
@@ -200,7 +200,7 @@ UDFPhReadSynchronous(
         irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ, DeviceObject, IoBuf,
                                                Length, &ROffset, &(Context->event), &(Context->IosbToUse) );
         if (!irp) {
-            KdPrint(("    !irp Sync\n"));
+            UDFPrint(("    !irp Sync\n"));
             try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
         }
         MmPrint(("    Alloc Irp MDL=%x, ctx=%x\n", irp->MdlAddress, Context));
@@ -228,7 +228,7 @@ UDFPhReadSynchronous(
     if(NT_SUCCESS(RC)) {
 /*
         for(i=0; i<(*ReadBytes); i+=2048) {
-            KdPrint(("IOCRC %8.8x R %x\n", crc32((PUCHAR)Buffer+i, 2048), (ULONG)((Offset+i)/2048) ));
+            UDFPrint(("IOCRC %8.8x R %x\n", crc32((PUCHAR)Buffer+i, 2048), (ULONG)((Offset+i)/2048) ));
         }
 */
 #ifdef _BROWSE_UDF_
@@ -250,7 +250,7 @@ try_exit: NOTHING;
     dtm = (ULONG)(((IoExitTime-IoEnterTime)/10)%1000);
     PerfPrint(("\nUDFPhReadSynchronous() exit: %08X, after %d.%4.4d msec.\n", RC, dt, dtm));
 #else
-    KdPrint(("UDFPhReadSynchronous() exit: %08X\n", RC));
+    UDFPrint(("UDFPhReadSynchronous() exit: %08X\n", RC));
 #endif //MEASURE_IO_PERFORMANCE
     
     return(RC);
@@ -311,7 +311,7 @@ UDFPhWriteSynchronous(
     ULONG Lba = (ULONG)(Offset>>0xb);
 //    ASSERT(!(Lba & (32-1)));
     PerfPrint(("UDFPhWrite: Length: %x Lba: %lx\n",Length>>0xb,Lba));
-//    KdPrint(("UDFPhWrite: Length: %x Lba: %lx\n",Length>>0x9,Offset>>0x9));
+//    UDFPrint(("UDFPhWrite: Length: %x Lba: %lx\n",Length>>0x9,Offset>>0x9));
 #endif //DBG
 
 #ifdef DBG
@@ -367,7 +367,7 @@ UDFPhWriteSynchronous(
     RC = IoCallDriver(DeviceObject, irp);
 /*
     for(i=0; i<Length; i+=2048) {
-        KdPrint(("IOCRC %8.8x W %x\n", crc32((PUCHAR)Buffer+i, 2048), (ULONG)((Offset+i)/2048) ));
+        UDFPrint(("IOCRC %8.8x W %x\n", crc32((PUCHAR)Buffer+i, 2048), (ULONG)((Offset+i)/2048) ));
     }
 */
 #ifdef _BROWSE_UDF_
@@ -395,7 +395,7 @@ try_exit: NOTHING;
 //    if(IoBuf) ExFreePool(IoBuf);
 //    if(IoBuf && !(Flags & PH_TMP_BUFFER)) DbgFreePool(IoBuf);
     if(!NT_SUCCESS(RC)) {
-        KdPrint(("WriteError\n"));
+        UDFPrint(("WriteError\n"));
     }
 
 #ifdef MEASURE_IO_PERFORMANCE
@@ -411,7 +411,7 @@ try_exit: NOTHING;
     dtm = (ULONG)(((IoExitTime-IoEnterTime)/10)%1000);
     PerfPrint(("\nUDFPhWriteSynchronous() exit: %08X, after %d.%4.4d msec.\n", RC, dt, dtm));
 #else
-    KdPrint(("nUDFPhWriteSynchronous() exit: %08X\n", RC));
+    UDFPrint(("nUDFPhWriteSynchronous() exit: %08X\n", RC));
 #endif //MEASURE_IO_PERFORMANCE
     
     return(RC);
@@ -524,7 +524,7 @@ UDFPhSendIOCTL(
     PUDF_PH_CALL_CONTEXT Context;
     LARGE_INTEGER timeout;
 
-    KdPrint(("UDFPhDevIOCTL: Code %8x  \n",IoControlCode));
+    UDFPrint(("UDFPhDevIOCTL: Code %8x  \n",IoControlCode));
 
     Context = (PUDF_PH_CALL_CONTEXT)MyAllocatePool__( NonPagedPool, sizeof(UDF_PH_CALL_CONTEXT) );
     if (!Context) return STATUS_INSUFFICIENT_RESOURCES;
@@ -540,7 +540,7 @@ UDFPhSendIOCTL(
     MmPrint(("    Alloc Irp MDL=%x, ctx=%x\n", irp->MdlAddress, Context));
 /*
     if (KeGetCurrentIrql() > PASSIVE_LEVEL) {
-        KdPrint(("Setting completion routine\n"));
+        UDFPrint(("Setting completion routine\n"));
         IoSetCompletionRoutine( irp, &UDFSyncCompletionRoutine,
                                 Context, TRUE, TRUE, TRUE );
     }
@@ -553,15 +553,15 @@ UDFPhSendIOCTL(
 
     if (RC == STATUS_PENDING) {
         ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
-        KdPrint(("Enter wait state on evt %x\n", Context));
+        UDFPrint(("Enter wait state on evt %x\n", Context));
 
         if (KeGetCurrentIrql() > PASSIVE_LEVEL) {
             timeout.QuadPart = -1000;
-            KdPrint(("waiting, TO=%I64d\n", timeout.QuadPart));
+            UDFPrint(("waiting, TO=%I64d\n", timeout.QuadPart));
             RC = DbgWaitForSingleObject(&(Context->event), &timeout);
             while(RC == STATUS_TIMEOUT) {
                 timeout.QuadPart *= 2;
-                KdPrint(("waiting, TO=%I64d\n", timeout.QuadPart));
+                UDFPrint(("waiting, TO=%I64d\n", timeout.QuadPart));
                 RC = DbgWaitForSingleObject(&(Context->event), &timeout);
             }
 
@@ -571,12 +571,12 @@ UDFPhSendIOCTL(
         if ((RC = Context->IosbToUse.Status) == STATUS_DATA_OVERRUN) {
             RC = STATUS_SUCCESS;
         }
-        KdPrint(("Exit wait state on evt %x, status %8.8x\n", Context, RC));
+        UDFPrint(("Exit wait state on evt %x, status %8.8x\n", Context, RC));
 /*        if(Iosb) {
             (*Iosb) = Context->IosbToUse;
         }*/
     } else {
-        KdPrint(("No wait completion on evt %x\n", Context));
+        UDFPrint(("No wait completion on evt %x\n", Context));
 /*        if(Iosb) {
             (*Iosb) = irp->IoStatus;
         }*/
index 0fae689..66a07df 100644 (file)
@@ -121,7 +121,7 @@ UDFIsFastIoPossible(
 {
     if( !(Fcb->Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED) /*||
         !FsRtlOplockIsFastIoPossible(&(Fcb->Oplock))*/ ) {
-        KdPrint(("    FastIoIsNotPossible\n"));
+        UDFPrint(("    FastIoIsNotPossible\n"));
         return FastIoIsNotPossible;
     }
 /*
@@ -132,10 +132,10 @@ UDFIsFastIoPossible(
     }
 */
     if(FsRtlAreThereCurrentFileLocks(&(Fcb->NTRequiredFCB->FileLock)) ) {
-        KdPrint(("    FastIoIsQuestionable\n"));
+        UDFPrint(("    FastIoIsQuestionable\n"));
         return FastIoIsQuestionable;
     }
-    KdPrint(("    FastIoIsPossible\n"));
+    UDFPrint(("    FastIoIsPossible\n"));
     return FastIoIsPossible;
 } // end UDFIsFastIoPossible()
 
@@ -175,7 +175,7 @@ UDFFastIoQueryBasicInfo(
 
     FsRtlEnterFileSystem();
 
-    KdPrint(("UDFFastIo  \n"));
+    UDFPrint(("UDFFastIo  \n"));
     // if the file is already opended we can satisfy this request
     // immediately 'cause all the data we need must be cached
     _SEH2_TRY {
@@ -265,7 +265,7 @@ UDFFastIoQueryStdInfo(
 
     FsRtlEnterFileSystem();
 
-    KdPrint(("UDFFastIo  \n"));
+    UDFPrint(("UDFFastIo  \n"));
     // if the file is already opended we can satisfy this request
     // immediately 'cause all the data we need must be cached
     _SEH2_TRY {
@@ -616,7 +616,7 @@ UDFFastIoQueryNetInfo(
 
     FsRtlEnterFileSystem();
 
-    KdPrint(("UDFFastIo  \n"));
+    UDFPrint(("UDFFastIo  \n"));
     // if the file is already opended we can satisfy this request
     // immediately 'cause all the data we need must be cached
     _SEH2_TRY {
index f364dd3..a4dadde 100644 (file)
@@ -139,26 +139,26 @@ UDFCommonFileInfo(
         TopIrp = IoGetTopLevelIrp();
         switch((ULONG)TopIrp) {
         case FSRTL_FSP_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_FSP_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_FSP_TOP_LEVEL_IRP\n"));
             break;
         case FSRTL_CACHE_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_CACHE_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_CACHE_TOP_LEVEL_IRP\n"));
             break;
         case FSRTL_MOD_WRITE_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
             break;
         case FSRTL_FAST_IO_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
             BrutePoint()
             break;
         case NULL:
-            KdPrint(("  NULL TOP_LEVEL_IRP\n"));
+            UDFPrint(("  NULL TOP_LEVEL_IRP\n"));
             break;
         default:
             if(TopIrp == Irp) {
-                KdPrint(("  TOP_LEVEL_IRP\n"));
+                UDFPrint(("  TOP_LEVEL_IRP\n"));
             } else {
-                KdPrint(("  RECURSIVE_IRP, TOP = %x\n", TopIrp));
+                UDFPrint(("  RECURSIVE_IRP, TOP = %x\n", TopIrp));
             }
         }
 
@@ -2029,7 +2029,7 @@ UDFRename(
             // removed (in UDFRenameMoveFile__()). Otherwise
             // return STATUS_ACCESS_DENIED
             if(UDFHasAStreamDir(File1)) {
-                KdPrint(("TODO: We should remove Streams from source file\n"));
+                UDFPrint(("TODO: We should remove Streams from source file\n"));
                 try_return (RC = STATUS_ACCESS_DENIED);
             }
 #else  //UDF_ENABLE_SECURITY
index aba666d..85b755c 100644 (file)
@@ -63,9 +63,9 @@ UDFCheckOtherFS(PDEVICE_OBJECT deviceObject) {
     FilterDevExt->NodeIdentifier.NodeType = UDF_NODE_TYPE_FILTER_DEVOBJ;
     FilterDevExt->NodeIdentifier.NodeSize = sizeof(FILTER_DEV_EXTENSION);
 
-    KdPrint(("UDFCheckOtherFS: Attaching filter devobj %x to FS devobj %x \n",filterDeviceObject,deviceObject));
+    UDFPrint(("UDFCheckOtherFS: Attaching filter devobj %x to FS devobj %x \n",filterDeviceObject,deviceObject));
     deviceObject = IoGetAttachedDevice( deviceObject );
-    KdPrint(("UDFCheckOtherFS: top devobj is %x \n",deviceObject));
+    UDFPrint(("UDFCheckOtherFS: top devobj is %x \n",deviceObject));
     FilterDevExt->lowerFSDeviceObject = deviceObject;
 
     RC = IoAttachDeviceByPointer( filterDeviceObject, deviceObject );
@@ -85,7 +85,7 @@ UDFCheckOtherFSByName(PCWSTR DeviceObjectName) {
     UNICODE_STRING nameString;
     NTSTATUS RC;
 
-    KdPrint(("UDFCheckOtherFSByName: trying %s \n",DeviceObjectName));
+    UDFPrint(("UDFCheckOtherFSByName: trying %s \n",DeviceObjectName));
 
     RtlInitUnicodeString( &nameString, DeviceObjectName );
     RC = IoGetDeviceObjectPointer(
@@ -96,7 +96,7 @@ UDFCheckOtherFSByName(PCWSTR DeviceObjectName) {
                 );
         
     if (!NT_SUCCESS(RC)) {
-        KdPrint(("UDFCheckOtherFSByName: error %x while calling IoGetDeviceObjectPointer \n",RC));
+        UDFPrint(("UDFCheckOtherFSByName: error %x while calling IoGetDeviceObjectPointer \n",RC));
         return;        
     }
 
@@ -151,7 +151,7 @@ Return Value:
     // Begin by determining whether this file system is registering or
     // unregistering as an active file system.
     if (FsActive) {
-        KdPrint(("UDFFSNotification \n"));
+        UDFPrint(("UDFFSNotification \n"));
         UDFCheckOtherFS(DeviceObject);
     }
 }
index 9fd044f..a7cdb9f 100644 (file)
@@ -47,7 +47,7 @@ UDFFlush(
     PtrUDFIrpContext    PtrIrpContext = NULL;
     BOOLEAN             AreWeTopLevel = FALSE;
 
-    KdPrint(("UDFFlush: \n"));
+    UDFPrint(("UDFFlush: \n"));
 
     FsRtlEnterFileSystem();
     ASSERT(DeviceObject);
@@ -124,7 +124,7 @@ UDFCommonFlush(
     BOOLEAN             PostRequest = FALSE;
     BOOLEAN             CanWait = TRUE;
 
-    KdPrint(("UDFCommonFlush: \n"));
+    UDFPrint(("UDFCommonFlush: \n"));
 
     _SEH2_TRY {
 
@@ -296,7 +296,7 @@ UDFFlushAFile(
 //    BOOLEAN PurgeCache = FALSE;
     ULONG ret_val = 0;
 
-    KdPrint(("UDFFlushAFile: \n"));
+    UDFPrint(("UDFFlushAFile: \n"));
     if(!Fcb)
         return 0;
 
@@ -419,7 +419,7 @@ UDFFlushADirectory(
     IN ULONG               FlushFlags
     )
 {
-    KdPrint(("UDFFlushADirectory: \n"));
+    UDFPrint(("UDFFlushADirectory: \n"));
 //    PDIR_INDEX_HDR hDI;
     PDIR_INDEX_ITEM DI;
 //    BOOLEAN Referenced = FALSE;
@@ -514,7 +514,7 @@ UDFFlushLogicalVolume(
 #ifndef UDF_READ_ONLY_BUILD
     IO_STATUS_BLOCK IoStatus;
 
-    KdPrint(("UDFFlushLogicalVolume: \n"));
+    UDFPrint(("UDFFlushLogicalVolume: \n"));
 
     _SEH2_TRY {
         if(Vcb->VCBFlags & (UDF_VCB_FLAGS_RAW_DISK/* |
@@ -534,10 +534,10 @@ UDFFlushLogicalVolume(
 //            return;
         // flush internal cache
         if(FlushFlags & UDF_FLUSH_FLAGS_LITE) {
-            KdPrint(("  Lite flush, keep Modified=%d.\n", Vcb->Modified));
+            UDFPrint(("  Lite flush, keep Modified=%d.\n", Vcb->Modified));
         } else {
             if(Vcb->VerifyOnWrite) {
-                KdPrint(("UDF: Flushing cache for verify\n"));
+                UDFPrint(("UDF: Flushing cache for verify\n"));
                 //WCacheFlushAll__(&(Vcb->FastCache), Vcb);
                 WCacheFlushBlocks__(&(Vcb->FastCache), Vcb, 0, Vcb->LastLBA);
                 UDFVFlush(Vcb);
@@ -583,7 +583,7 @@ UDFFlushCompletion(
 {
 //    NTSTATUS        RC = STATUS_SUCCESS;
 
-    KdPrint(("UDFFlushCompletion: \n"));
+    UDFPrint(("UDFFlushCompletion: \n"));
 
     if (Irp->PendingReturned) {
         IoMarkIrpPending(Irp);
index bd024e4..8f5d21b 100644 (file)
@@ -45,7 +45,7 @@ UDFFSControl(
     PtrUDFIrpContext    PtrIrpContext;
     BOOLEAN             AreWeTopLevel = FALSE;
 
-    KdPrint(("\nUDFFSControl: \n\n"));
+    UDFPrint(("\nUDFFSControl: \n\n"));
 
     FsRtlEnterFileSystem();
     ASSERT(DeviceObject);
@@ -70,7 +70,7 @@ UDFFSControl(
 
     } _SEH2_EXCEPT(UDFExceptionFilter(PtrIrpContext, _SEH2_GetExceptionInformation())) {
 
-        KdPrint(("UDFFSControl: exception ***"));
+        UDFPrintErr(("UDFFSControl: exception ***"));
         RC = UDFExceptionHandler(PtrIrpContext, Irp);
 
         UDFLogEvent(UDF_ERROR_INTERNAL_ERROR, RC);
@@ -109,7 +109,7 @@ UDFCommonFSControl(
     PIO_STACK_LOCATION      IrpSp = NULL;
 //    PDEVICE_OBJECT          PtrTargetDeviceObject = NULL;
 
-    KdPrint(("\nUDFCommonFSControl\n\n"));
+    UDFPrint(("\nUDFCommonFSControl\n\n"));
 //    BrutePoint();
 
     _SEH2_TRY {
@@ -120,24 +120,24 @@ UDFCommonFSControl(
         switch ((IrpSp)->MinorFunction) 
         {
         case IRP_MN_USER_FS_REQUEST:
-            KdPrint(("  UDFFSControl: UserFsReq request ....\n"));
+            UDFPrint(("  UDFFSControl: UserFsReq request ....\n"));
                 
             RC = UDFUserFsCtrlRequest(PtrIrpContext,Irp);
             break;
         case IRP_MN_MOUNT_VOLUME:
 
-            KdPrint(("  UDFFSControl: MOUNT_VOLUME request ....\n"));
+            UDFPrint(("  UDFFSControl: MOUNT_VOLUME request ....\n"));
                 
             RC = UDFMountVolume(PtrIrpContext,Irp);
             break;
         case IRP_MN_VERIFY_VOLUME:
 
-            KdPrint(("  UDFFSControl: VERIFY_VOLUME request ....\n"));
+            UDFPrint(("  UDFFSControl: VERIFY_VOLUME request ....\n"));
 
             RC = UDFVerifyVolume(Irp);                              
             break;
         default:
-            KdPrint(("  UDFFSControl: STATUS_INVALID_DEVICE_REQUEST MinorFunction %x\n", (IrpSp)->MinorFunction));
+            UDFPrintErr(("  UDFFSControl: STATUS_INVALID_DEVICE_REQUEST MinorFunction %x\n", (IrpSp)->MinorFunction));
             RC = STATUS_INVALID_DEVICE_REQUEST;
 
             Irp->IoStatus.Status = RC;
@@ -151,10 +151,10 @@ UDFCommonFSControl(
     } _SEH2_FINALLY {
         if (!_SEH2_AbnormalTermination()) {
             // Free up the Irp Context
-            KdPrint(("  UDFCommonFSControl: finally\n"));
+            UDFPrint(("  UDFCommonFSControl: finally\n"));
             UDFReleaseIrpContext(PtrIrpContext);
         } else {
-            KdPrint(("  UDFCommonFSControl: finally after exception ***\n"));
+            UDFPrint(("  UDFCommonFSControl: finally after exception ***\n"));
         }
     } _SEH2_END;
 
@@ -195,7 +195,7 @@ UDFUserFsCtrlRequest(
     case FSCTL_OPLOCK_BREAK_ACK_NO_2 :
     case FSCTL_REQUEST_FILTER_OPLOCK :
 
-        KdPrint(("UDFUserFsCtrlRequest: OPLOCKS\n"));
+        UDFPrint(("UDFUserFsCtrlRequest: OPLOCKS\n"));
         RC = STATUS_INVALID_DEVICE_REQUEST;
 
         Irp->IoStatus.Information = 0;
@@ -229,7 +229,7 @@ UDFUserFsCtrlRequest(
 
     case FSCTL_ALLOW_EXTENDED_DASD_IO:
 
-        KdPrint(("UDFUserFsCtrlRequest: FSCTL_ALLOW_EXTENDED_DASD_IO\n"));
+        UDFPrint(("UDFUserFsCtrlRequest: FSCTL_ALLOW_EXTENDED_DASD_IO\n"));
         // DASD i/o is always permitted
         // So, no-op this call
         RC = STATUS_SUCCESS;
@@ -270,13 +270,13 @@ UDFUserFsCtrlRequest(
 
     case FSCTL_GET_VOLUME_BITMAP:
 
-        KdPrint(("UDFUserFsCtrlRequest: FSCTL_GET_VOLUME_BITMAP\n"));
+        UDFPrint(("UDFUserFsCtrlRequest: FSCTL_GET_VOLUME_BITMAP\n"));
         RC = UDFGetVolumeBitmap( IrpContext, Irp );
         break;
 
     case FSCTL_GET_RETRIEVAL_POINTERS:
 
-        KdPrint(("UDFUserFsCtrlRequest: FSCTL_GET_RETRIEVAL_POINTERS\n"));
+        UDFPrint(("UDFUserFsCtrlRequest: FSCTL_GET_RETRIEVAL_POINTERS\n"));
         RC = UDFGetRetrievalPointers( IrpContext, Irp, 0 );
         break;
 
@@ -284,7 +284,7 @@ UDFUserFsCtrlRequest(
     //  We don't support any of the known or unknown requests.
     default:
 
-        KdPrint(("UDFUserFsCtrlRequest: STATUS_INVALID_DEVICE_REQUEST for %x\n",
+        UDFPrintErr(("UDFUserFsCtrlRequest: STATUS_INVALID_DEVICE_REQUEST for %x\n",
             IrpSp->Parameters.FileSystemControl.FsControlCode));
         RC = STATUS_INVALID_DEVICE_REQUEST;
 
@@ -344,11 +344,11 @@ UDFMountVolume(
     int8*                   ioBuf = NULL;
 
     ASSERT(IrpSp);
-    KdPrint(("\n !!! UDFMountVolume\n"));
-//    KdPrint(("Build " VER_STR_PRODUCT "\n\n"));
+    UDFPrint(("\n !!! UDFMountVolume\n"));
+//    UDFPrint(("Build " VER_STR_PRODUCT "\n\n"));
 
     fsDeviceObject = PtrIrpContext->TargetDeviceObject;
-    KdPrint(("Mount on device object %x\n", fsDeviceObject));
+    UDFPrint(("Mount on device object %x\n", fsDeviceObject));
     filterDevExt = (PFILTER_DEV_EXTENSION)fsDeviceObject->DeviceExtension;
     if (filterDevExt->NodeIdentifier.NodeType == UDF_NODE_TYPE_FILTER_DEVOBJ &&
         filterDevExt->NodeIdentifier.NodeSize == sizeof(FILTER_DEV_EXTENSION)) {
@@ -358,7 +358,7 @@ UDFMountVolume(
         filterDevExt->NodeIdentifier.NodeSize == sizeof(UDFFS_DEV_EXTENSION)) {
         CompleteIrp = TRUE;
     } else {
-        KdPrint(("Invalid node type in FS or FILTER DeviceObject\n"));
+        UDFPrintErr(("Invalid node type in FS or FILTER DeviceObject\n"));
         ASSERT(FALSE);
     }
     // Get a pointer to the target physical/virtual device object.
@@ -405,7 +405,7 @@ UDFMountVolume(
         if(WrongMedia) try_return(RC = STATUS_UNRECOGNIZED_VOLUME);
 
         if(RemovableMedia) {
-            KdPrint(("UDFMountVolume: removable media\n"));
+            UDFPrint(("UDFMountVolume: removable media\n"));
             // just remember current MediaChangeCount
             // or fail if No Media ....
 
@@ -431,13 +431,13 @@ UDFMountVolume(
                                          &Mode,sizeof(Mode),
                                          &TestUnitReadyBuffer,sizeof(TEST_UNIT_READY_USER_OUT),
                                          FALSE,NULL);
-                    KdPrint(("UDFMountVolume: TEST_UNIT_READY %x\n", RC));
+                    UDFPrint(("UDFMountVolume: TEST_UNIT_READY %x\n", RC));
                     if(!NT_SUCCESS(RC))
                         break;
                     if(TestUnitReadyBuffer.SenseKey == SCSI_SENSE_NOT_READY &&
                        TestUnitReadyBuffer.AdditionalSenseCode == SCSI_ADSENSE_LUN_NOT_READY &&
                        TestUnitReadyBuffer.AdditionalSenseCodeQualifier == SCSI_SENSEQ_BECOMING_READY) {
-                        KdPrint(("UDFMountVolume: retry\n"));
+                        UDFPrint(("UDFMountVolume: retry\n"));
                         KeDelayExecutionThread(KernelMode, FALSE, &delay);
                         //delay.QuadPart -= 10000000LL; // 1.0 sec
                     } else {
@@ -445,7 +445,7 @@ UDFMountVolume(
                     }
                 }
                 if(i) {
-                    KdPrint(("UDFMountVolume: additional delay 3 sec\n"));
+                    UDFPrint(("UDFMountVolume: additional delay 3 sec\n"));
                     delay.QuadPart = -30000000LL; // 3.0 sec
                     KeDelayExecutionThread(KernelMode, FALSE, &delay);
                 }
@@ -460,7 +460,7 @@ UDFMountVolume(
                                  FALSE,&Iosb );
     
             if(RC == STATUS_IO_DEVICE_ERROR) {
-                KdPrint(("UDFMountVolume: retry check verify\n"));
+                UDFPrint(("UDFMountVolume: retry check verify\n"));
                 RC = UDFPhSendIOCTL( IOCTL_STORAGE_CHECK_VERIFY,
                                      TargetDeviceObject,
                                      NULL,0,
@@ -513,7 +513,7 @@ UDFMountVolume(
         // Now before we can initialize the Vcb we need to set up the
         // Get our device object and alignment requirement.
         // Device extension == VCB
-        KdPrint(("UDFMountVolume: create device\n"));
+        UDFPrint(("UDFMountVolume: create device\n"));
         RC = IoCreateDevice( UDFGlobalData.DriverObject,
                                  sizeof(VCB),
                                  NULL,
@@ -622,17 +622,17 @@ UDFMountVolume(
 #endif //UDF_READ_ONLY_BUILD
 
         if(!NT_SUCCESS(RC)) {
-            KdPrint(("UDFMountVolume: try raw mount\n"));
+            UDFPrint(("UDFMountVolume: try raw mount\n"));
             if(Vcb->NSRDesc & VRS_ISO9660_FOUND) {
-                KdPrint(("UDFMountVolume: block raw mount due to ISO9660 presence\n"));
+                UDFPrint(("UDFMountVolume: block raw mount due to ISO9660 presence\n"));
                 Vcb->VCBFlags &= ~UDF_VCB_FLAGS_RAW_DISK;
                 try_return(RC);
             }
 try_raw_mount:
-            KdPrint(("UDFMountVolume: try raw mount (2)\n"));
+            UDFPrint(("UDFMountVolume: try raw mount (2)\n"));
             if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
 
-                KdPrint(("UDFMountVolume: trying raw mount...\n"));
+                UDFPrint(("UDFMountVolume: trying raw mount...\n"));
                 Vcb->VolIdent.Length =
                 (Vcb->VolIdent.MaximumLength = sizeof(UDF_BLANK_VOLUME_LABEL)) - 2;
                 if(Vcb->VolIdent.Buffer)
@@ -654,14 +654,14 @@ try_raw_mount:
 #ifndef UDF_READ_ONLY_BUILD
             // set cache mode according to media type
             if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY)) {
-                KdPrint(("UDFMountVolume: writable volume\n"));
+                UDFPrint(("UDFMountVolume: writable volume\n"));
                 if(!Vcb->CDR_Mode) {
                     if((FsDeviceType == FILE_DEVICE_DISK_FILE_SYSTEM) ||
                        CdrwMediaClassEx_IsRAM(Vcb->MediaClassEx)) {
-                        KdPrint(("UDFMountVolume: RAM mode\n"));
+                        UDFPrint(("UDFMountVolume: RAM mode\n"));
                         Mode = WCACHE_MODE_RAM;
                     } else {
-                        KdPrint(("UDFMountVolume: RW mode\n"));
+                        UDFPrint(("UDFMountVolume: RW mode\n"));
                         Mode = WCACHE_MODE_RW;
                     }
 /*                    if(FsDeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM) {
@@ -669,12 +669,12 @@ try_raw_mount:
                         Vcb->WriteSecurity = TRUE;
                     }*/
                 } else {
-                    KdPrint(("UDFMountVolume: R mode\n"));
+                    UDFPrint(("UDFMountVolume: R mode\n"));
                     Mode = WCACHE_MODE_R;
                 }
                 // we can't record ACL on old format disks
                 if(!UDFNtAclSupported(Vcb)) {
-                    KdPrint(("UDFMountVolume: NO ACL and ExtFE support\n"));
+                    UDFPrint(("UDFMountVolume: NO ACL and ExtFE support\n"));
                     Vcb->WriteSecurity = FALSE;
                     Vcb->UseExtendedFE = FALSE;
                 }
@@ -707,7 +707,7 @@ try_raw_mount:
             RC = UDFStartEjectWaiter(Vcb);
             if(!NT_SUCCESS(RC)) try_return(RC);
         } else {
-            KdPrint(("UDFMountVolume: RO mount\n"));
+            UDFPrint(("UDFMountVolume: RO mount\n"));
             Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
         }
 #endif //UDF_READ_ONLY_BUILD
@@ -725,7 +725,7 @@ try_raw_mount:
         Vcb->FreeAllocUnits = UDFGetFreeSpace(Vcb);
         // Register shutdown routine
         if(!Vcb->ShutdownRegistered) {
-            KdPrint(("UDFMountVolume: Register shutdown routine\n"));
+            UDFPrint(("UDFMountVolume: Register shutdown routine\n"));
             IoRegisterShutdownNotification(Vcb->VCBDeviceObject);
             Vcb->ShutdownRegistered = TRUE;
         }
@@ -733,7 +733,7 @@ try_raw_mount:
         // unlock media
         if(RemovableMedia) {
             if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) {
-                KdPrint(("UDFMountVolume: unlock media on RO volume\n"));
+                UDFPrint(("UDFMountVolume: unlock media on RO volume\n"));
                 ((PPREVENT_MEDIA_REMOVAL_USER_IN)(&MediaChangeCount))->PreventMediaRemoval = FALSE;
                 UDFPhSendIOCTL( IOCTL_STORAGE_MEDIA_REMOVAL,
                                      TargetDeviceObject,
@@ -761,7 +761,7 @@ try_raw_mount:
 try_exit: NOTHING;
     } _SEH2_FINALLY {
 
-        KdPrint(("UDFMountVolume: RC = %x\n", RC));
+        UDFPrint(("UDFMountVolume: RC = %x\n", RC));
 
         if(ioBuf) {
             MyFreePool__(ioBuf);
@@ -770,7 +770,7 @@ try_exit: NOTHING;
         if(!NT_SUCCESS(RC)) {
 
             if(RemovableMedia && Locked) {
-                KdPrint(("UDFMountVolume: unlock media\n"));
+                UDFPrint(("UDFMountVolume: unlock media\n"));
                 ((PPREVENT_MEDIA_REMOVAL_USER_IN)(&MediaChangeCount))->PreventMediaRemoval = FALSE;
                 UDFPhSendIOCTL( IOCTL_STORAGE_MEDIA_REMOVAL,
                                      TargetDeviceObject,
@@ -783,12 +783,12 @@ try_exit: NOTHING;
                 // reset driver
             if(!DeviceNotTouched &&
                (!Vcb || (Vcb && (Vcb->VCBFlags & UDF_VCB_FLAGS_OUR_DEVICE_DRIVER)))) {
-                KdPrint(("UDFMountVolume: reset driver\n"));
+                UDFPrint(("UDFMountVolume: reset driver\n"));
                 UDFResetDeviceDriver(Vcb, TargetDeviceObject, TRUE);
             }
 
             if(RC == STATUS_CRC_ERROR || RC == STATUS_FILE_CORRUPT_ERROR) {
-                KdPrint(("UDFMountVolume: status -> STATUS_UNRECOGNIZED_VOLUME\n"));
+                UDFPrint(("UDFMountVolume: status -> STATUS_UNRECOGNIZED_VOLUME\n"));
                 RC = STATUS_UNRECOGNIZED_VOLUME;
             }
 
@@ -820,7 +820,7 @@ try_exit: NOTHING;
             if(!_SEH2_AbnormalTermination()) {
                 // Set mount event
 
-                KdPrint(("UDFMountVolume: complete req RC %x\n", RC));
+                UDFPrint(("UDFMountVolume: complete req RC %x\n", RC));
                 UDFNotifyVolumeEvent(IrpSp->FileObject, FSRTL_VOLUME_MOUNT);
                 // Complete the IRP.
                 Irp->IoStatus.Status = RC;
@@ -841,7 +841,7 @@ try_exit: NOTHING;
 
     } _SEH2_END;
 
-    KdPrint(("UDFMountVolume: final RC = %x\n", RC));
+    UDFPrint(("UDFMountVolume: final RC = %x\n", RC));
     return RC;
 
 } // end UDFMountVolume()
@@ -853,31 +853,31 @@ UDFStartEjectWaiter(
 {
 //    NTSTATUS RC;
     PREVENT_MEDIA_REMOVAL_USER_IN Buff;
-    KdPrint(("UDFStartEjectWaiter:\n"));
+    UDFPrint(("UDFStartEjectWaiter:\n"));
 
     if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) {
-        KdPrint(("  UDF_VCB_FLAGS_MEDIA_READ_ONLY\n"));
+        UDFPrint(("  UDF_VCB_FLAGS_MEDIA_READ_ONLY\n"));
     }
     if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) {
-        KdPrint(("  UDF_VCB_FLAGS_MEDIA_LOCKED\n"));
+        UDFPrint(("  UDF_VCB_FLAGS_MEDIA_LOCKED\n"));
     }
-    KdPrint(("  EjectWaiter=%x\n", Vcb->EjectWaiter));
+    UDFPrint(("  EjectWaiter=%x\n", Vcb->EjectWaiter));
     if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) &&
        /*!(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) &&*/
        !(Vcb->EjectWaiter)) {
 
-        KdPrint(("UDFStartEjectWaiter: check driver\n"));
+        UDFPrint(("UDFStartEjectWaiter: check driver\n"));
         if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_OUR_DEVICE_DRIVER) &&
             (Vcb->FsDeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM)) {
             // we don't know how to write without our device driver
             Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
-            KdPrint(("  not our driver, ignore\n"));
+            UDFPrint(("  not our driver, ignore\n"));
             return STATUS_SUCCESS;
         }
-        KdPrint(("UDFStartEjectWaiter: check removable\n"));
+        UDFPrint(("UDFStartEjectWaiter: check removable\n"));
         if(Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA) {
             // prevent media removal
-            KdPrint(("UDFStartEjectWaiter: lock media\n"));
+            UDFPrint(("UDFStartEjectWaiter: lock media\n"));
             Buff.PreventMediaRemoval = TRUE;
             UDFTSendIOCTL( IOCTL_STORAGE_MEDIA_REMOVAL,
                            Vcb,
@@ -886,7 +886,7 @@ UDFStartEjectWaiter(
                            FALSE,NULL );
             Vcb->VCBFlags |= UDF_VCB_FLAGS_MEDIA_LOCKED;
         }
-        KdPrint(("UDFStartEjectWaiter: prepare to start\n"));
+        UDFPrint(("UDFStartEjectWaiter: prepare to start\n"));
         // initialize Eject Request waiter
         Vcb->EjectWaiter = (PUDFEjectWaitContext)MyAllocatePool__(NonPagedPool, sizeof(UDFEjectWaitContext));
         if(!(Vcb->EjectWaiter)) return STATUS_INSUFFICIENT_RESOURCES;
@@ -901,10 +901,10 @@ UDFStartEjectWaiter(
         ASSERT(!(Vcb->VCBFlags & UDF_VCB_FLAGS_STOP_WAITER_EVENT));
         Vcb->VCBFlags |= UDF_VCB_FLAGS_STOP_WAITER_EVENT;
         ExInitializeWorkItem(&(Vcb->EjectWaiter->EjectReqWorkQueueItem), (PWORKER_THREAD_ROUTINE)UDFEjectReqWaiter, Vcb->EjectWaiter);
-        KdPrint(("UDFStartEjectWaiter: create thread\n"));
+        UDFPrint(("UDFStartEjectWaiter: create thread\n"));
         ExQueueWorkItem(&(Vcb->EjectWaiter->EjectReqWorkQueueItem), DelayedWorkQueue);
     } else {
-        KdPrint(("  ignore\n"));
+        UDFPrint(("  ignore\n"));
     }
     return STATUS_SUCCESS;
 } // end UDFStartEjectWaiter()
@@ -921,18 +921,18 @@ UDFCompleteMount(
     PtrUDFObjectName            RootName;
     PtrUDFFCB                   RootFcb;
 
-    KdPrint(("UDFCompleteMount:\n"));
+    UDFPrint(("UDFCompleteMount:\n"));
     Vcb->ZBuffer = (PCHAR)DbgAllocatePoolWithTag(NonPagedPool, max(Vcb->LBlockSize, PAGE_SIZE), 'zNWD');
     if(!Vcb->ZBuffer) return STATUS_INSUFFICIENT_RESOURCES;
     RtlZeroMemory(Vcb->ZBuffer, Vcb->LBlockSize);
 
-    KdPrint(("UDFCompleteMount: alloc Root FCB\n"));
+    UDFPrint(("UDFCompleteMount: alloc Root FCB\n"));
     // Create the root index and reference it in the Vcb.
     RootFcb =
     Vcb->RootDirFCB = UDFAllocateFCB();
     if(!RootFcb) return STATUS_INSUFFICIENT_RESOURCES;
 
-    KdPrint(("UDFCompleteMount: alloc Root ObjName\n"));
+    UDFPrint(("UDFCompleteMount: alloc Root ObjName\n"));
     // Allocate and set root FCB unique name
     RootName = UDFAllocateObjectName();
     if(!RootName) {
@@ -954,7 +954,7 @@ insuf_res_1:
         Vcb->RootDirFCB = NULL;
         return RC;
     }
-    KdPrint(("UDFCompleteMount: open Root Dir\n"));
+    UDFPrint(("UDFCompleteMount: open Root Dir\n"));
     // Open Root Directory
     RC = UDFOpenRootFile__( Vcb, &(Vcb->RootLbAddr), RootFcb->FileInfo );
     if(!NT_SUCCESS(RC)) {
@@ -966,7 +966,7 @@ insuf_res_2:
     RootFcb->FileInfo->Fcb = RootFcb;
 
     if(!(RootFcb->NTRequiredFCB = RootFcb->FileInfo->Dloc->CommonFcb)) {
-        KdPrint(("UDFCompleteMount: alloc Root ObjName (2)\n"));
+        UDFPrint(("UDFCompleteMount: alloc Root ObjName (2)\n"));
         if(!(RootFcb->NTRequiredFCB =
                     (PtrUDFNTRequiredFCB)MyAllocatePool__(NonPagedPool, UDFQuadAlign(sizeof(UDFNTRequiredFCB))) ) ) {
             RC = STATUS_INSUFFICIENT_RESOURCES;
@@ -975,7 +975,7 @@ insuf_res_2:
         RtlZeroMemory(RootFcb->NTRequiredFCB, UDFQuadAlign(sizeof(UDFNTRequiredFCB)));
         RootFcb->FileInfo->Dloc->CommonFcb = RootFcb->NTRequiredFCB;
     }
-    KdPrint(("UDFCompleteMount: init FCB\n"));
+    UDFPrint(("UDFCompleteMount: init FCB\n"));
     RC = UDFInitializeFCB(RootFcb,Vcb,RootName,UDF_FCB_ROOT_DIRECTORY | UDF_FCB_DIRECTORY,NULL);
     if(!NT_SUCCESS(RC)) {
         // if we get here, no resources are inited
@@ -1353,7 +1353,7 @@ UDFCloseResidual(
     //  Deinitialize Non-alloc file
     if(Vcb->VCBOpenCount)
         UDFInterlockedDecrement((PLONG)&(Vcb->VCBOpenCount));
-    KdPrint(("UDFCloseResidual: NonAllocFileInfo %x\n", Vcb->NonAllocFileInfo));
+    UDFPrint(("UDFCloseResidual: NonAllocFileInfo %x\n", Vcb->NonAllocFileInfo));
     if(Vcb->NonAllocFileInfo) {
         UDFCloseFile__(Vcb,Vcb->NonAllocFileInfo);
         UDFCleanUpFile__(Vcb, Vcb->NonAllocFileInfo);
@@ -1361,7 +1361,7 @@ UDFCloseResidual(
         Vcb->NonAllocFileInfo = NULL;
     }
     //  Deinitialize Unique ID Mapping
-    KdPrint(("UDFCloseResidual: NonAllocFileInfo %x\n", Vcb->NonAllocFileInfo));
+    UDFPrint(("UDFCloseResidual: NonAllocFileInfo %x\n", Vcb->NonAllocFileInfo));
     if(Vcb->UniqueIDMapFileInfo) {
         UDFCloseFile__(Vcb,Vcb->UniqueIDMapFileInfo);
         UDFCleanUpFile__(Vcb, Vcb->UniqueIDMapFileInfo);
@@ -1369,7 +1369,7 @@ UDFCloseResidual(
         Vcb->UniqueIDMapFileInfo = NULL;
     }
     //  Deinitialize VAT file
-    KdPrint(("UDFCloseResidual: VatFileInfo %x\n", Vcb->VatFileInfo));
+    UDFPrint(("UDFCloseResidual: VatFileInfo %x\n", Vcb->VatFileInfo));
     if(Vcb->VatFileInfo) {
         UDFCloseFile__(Vcb,Vcb->VatFileInfo);
         UDFCleanUpFile__(Vcb, Vcb->VatFileInfo);
@@ -1377,7 +1377,7 @@ UDFCloseResidual(
         Vcb->VatFileInfo = NULL;
     }
     //  System StreamDir
-    KdPrint(("UDFCloseResidual: SysSDirFileInfo %x\n", Vcb->SysSDirFileInfo));
+    UDFPrint(("UDFCloseResidual: SysSDirFileInfo %x\n", Vcb->SysSDirFileInfo));
     if(Vcb->SysSDirFileInfo) {
         UDFCloseFile__(Vcb, Vcb->SysSDirFileInfo);
         UDFCleanUpFile__(Vcb, Vcb->SysSDirFileInfo);
@@ -1411,7 +1411,7 @@ UDFCloseResidual(
     }*/
 
     // Deinitialize root dir fcb
-    KdPrint(("UDFCloseResidual: RootDirFCB %x\n", Vcb->RootDirFCB));
+    UDFPrint(("UDFCloseResidual: RootDirFCB %x\n", Vcb->RootDirFCB));
     if(Vcb->RootDirFCB) {
         UDFCloseFile__(Vcb,Vcb->RootDirFCB->FileInfo);
         if(Vcb->RootDirFCB->OpenHandleCount)
@@ -1559,11 +1559,11 @@ UDFIsVolumeMounted(
     PtrUDFFCB Fcb;
     PtrUDFCCB Ccb;
 
-    KdPrint(("UDFIsVolumeMounted\n"));
+    UDFPrint(("UDFIsVolumeMounted\n"));
 
     Ccb = (PtrUDFCCB)IrpSp->FileObject->FsContext2;
     if(!Ccb) {
-        KdPrint(("  !Ccb\n"));
+        UDFPrintErr(("  !Ccb\n"));
         Irp->IoStatus.Information = 0;
         Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
         return STATUS_INVALID_PARAMETER;
@@ -1612,7 +1612,7 @@ UDFGetStatistics(
     ULONG StatsSize;
     ULONG BytesToCopy;
 
-    KdPrint(("UDFGetStatistics\n"));
+    UDFPrint(("UDFGetStatistics\n"));
 
     // Extract the buffer
     BufferLength = IrpSp->Parameters.FileSystemControl.OutputBufferLength;
@@ -1669,7 +1669,7 @@ UDFIsPathnameValid(
     UNICODE_STRING              CurName;
     PWCHAR                      TmpBuffer;
 
-    KdPrint(("UDFIsPathnameValid\n"));
+    UDFPrint(("UDFIsPathnameValid\n"));
 
     // Extract the pathname
     PathnameBuffer = (PPATHNAME_BUFFER)Irp->AssociatedIrp.SystemBuffer;
@@ -1737,13 +1737,13 @@ UDFLockVolume(
     PtrUDFCCB Ccb;
     BOOLEAN VcbAcquired = FALSE;
 
-    KdPrint(("UDFLockVolume: PID %x\n", PID));
+    UDFPrint(("UDFLockVolume: PID %x\n", PID));
 
     //  Decode the file object, the only type of opens we accept are
     //  user volume opens.
     Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
     if(!Ccb) {
-        KdPrint(("  !Ccb\n"));
+        UDFPrintErr(("  !Ccb\n"));
         Irp->IoStatus.Information = 0;
         Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
         return STATUS_INVALID_PARAMETER;
@@ -1871,13 +1871,13 @@ UDFUnlockVolume(
     PtrUDFFCB Fcb;
     PtrUDFCCB Ccb;
 
-    KdPrint(("UDFUnlockVolume: PID %x\n", PID));
+    UDFPrint(("UDFUnlockVolume: PID %x\n", PID));
 
     //  Decode the file object, the only type of opens we accept are
     //  user volume opens.
     Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
     if(!Ccb) {
-        KdPrint(("  !Ccb\n"));
+        UDFPrintErr(("  !Ccb\n"));
         Irp->IoStatus.Information = 0;
         Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
         return STATUS_INVALID_PARAMETER;
@@ -1954,13 +1954,13 @@ UDFDismountVolume(
     PPREVENT_MEDIA_REMOVAL_USER_IN Buf = NULL;
     BOOLEAN VcbAcquired = FALSE;
 
-    KdPrint(("\n ### UDFDismountVolume ###\n\n"));
+    UDFPrint(("\n ### UDFDismountVolume ###\n\n"));
 
     //  Decode the file object, the only type of opens we accept are
     //  user volume opens.
     Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
     if(!Ccb) {
-        KdPrint(("  !Ccb\n"));
+        UDFPrintErr(("  !Ccb\n"));
         Irp->IoStatus.Information = 0;
         Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
         return STATUS_INVALID_PARAMETER;
@@ -2080,7 +2080,7 @@ UDFGetVolumeBitmap(
     PtrUDFFCB Fcb;
     PtrUDFCCB Ccb;
 
-    KdPrint(("UDFGetVolumeBitmap\n"));
+    UDFPrint(("UDFGetVolumeBitmap\n"));
 
     ULONG BytesToCopy;
     ULONG TotalClusters;
@@ -2099,7 +2099,7 @@ UDFGetVolumeBitmap(
     // user volume opens.
     Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
     if(!Ccb) {
-        KdPrint(("  !Ccb\n"));
+        UDFPrintErr(("  !Ccb\n"));
         Irp->IoStatus.Information = 0;
         Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
         return STATUS_INVALID_PARAMETER;
@@ -2176,7 +2176,7 @@ UDFGetVolumeBitmap(
     } _SEH2_EXCEPT(UDFExceptionFilter(IrpContext, _SEH2_GetExceptionInformation())) {
 
         BrutePoint();
-        KdPrint(("UDFGetVolumeBitmap: Exception\n"));
+        UDFPrintErr(("UDFGetVolumeBitmap: Exception\n"));
 //        UDFUnlockCallersBuffer(IrpContext, Irp, OutputBuffer);
         BrutePoint();
 //        RC = UDFExceptionHandler(IrpContext, Irp);
@@ -2234,13 +2234,13 @@ UDFGetRetrievalPointers(
     ULONG LBSh;
     ULONG L2BSh;
 
-    KdPrint(("UDFGetRetrievalPointers\n"));
+    UDFPrint(("UDFGetRetrievalPointers\n"));
 
     // Decode the file object, the only type of opens we accept are
     // user volume opens.
     Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
     if(!Ccb) {
-        KdPrint(("  !Ccb\n"));
+        UDFPrintErr(("  !Ccb\n"));
         Irp->IoStatus.Information = 0;
         Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
         return STATUS_INVALID_PARAMETER;
@@ -2377,7 +2377,7 @@ UDFIsVolumeDirty(
     PtrUDFFCB Fcb;
     PtrUDFCCB Ccb;
 
-    KdPrint(("UDFIsVolumeDirty\n"));
+    UDFPrint(("UDFIsVolumeDirty\n"));
 
     Irp->IoStatus.Information = 0;
 
@@ -2386,13 +2386,13 @@ UDFIsVolumeDirty(
     } else if (Irp->MdlAddress != NULL) {
         VolumeState = (PULONG)MmGetSystemAddressForMdl(Irp->MdlAddress);
     } else {
-        KdPrint(("  STATUS_INVALID_USER_BUFFER\n"));
+        UDFPrintErr(("  STATUS_INVALID_USER_BUFFER\n"));
         Irp->IoStatus.Status = STATUS_INVALID_USER_BUFFER;
         return STATUS_INVALID_USER_BUFFER;
     }
 
     if (IrpSp->Parameters.FileSystemControl.OutputBufferLength < sizeof(ULONG)) {
-        KdPrint(("  STATUS_BUFFER_TOO_SMALL\n"));
+        UDFPrintErr(("  STATUS_BUFFER_TOO_SMALL\n"));
         Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
         return STATUS_BUFFER_TOO_SMALL;
     }
@@ -2403,7 +2403,7 @@ UDFIsVolumeDirty(
     // user volume opens.
     Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
     if(!Ccb) {
-        KdPrint(("  !Ccb\n"));
+        UDFPrintErr(("  !Ccb\n"));
         Irp->IoStatus.Information = 0;
         Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
         return STATUS_INVALID_PARAMETER;
@@ -2412,23 +2412,23 @@ UDFIsVolumeDirty(
     Vcb = Fcb->Vcb;
 
     if(Vcb != (PVCB)Fcb || !(Ccb->CCBFlags & UDF_CCB_VOLUME_OPEN)) {
-        KdPrint(("  !Volume\n"));
+        UDFPrintErr(("  !Volume\n"));
         Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
         return STATUS_INVALID_PARAMETER;
     }
 
     if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
-        KdPrint(("  !Mounted\n"));
+        UDFPrintErr(("  !Mounted\n"));
         Irp->IoStatus.Status = STATUS_VOLUME_DISMOUNTED;
         return STATUS_VOLUME_DISMOUNTED;
     }
 
     if(Vcb->origIntegrityType == INTEGRITY_TYPE_OPEN) {
-        KdPrint(("  Dirty\n"));
+        UDFPrint(("  Dirty\n"));
         (*VolumeState) |= VOLUME_IS_DIRTY;
         Irp->IoStatus.Information = sizeof(ULONG);
     } else {
-        KdPrint(("  Clean\n"));
+        UDFPrint(("  Clean\n"));
     }
     Irp->IoStatus.Status = STATUS_SUCCESS;
 
@@ -2448,7 +2448,7 @@ UDFInvalidateVolumes(
         (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation( Irp );
     PPREVENT_MEDIA_REMOVAL_USER_IN Buf = NULL;
 
-    KdPrint(("UDFInvalidateVolumes\n"));
+    UDFPrint(("UDFInvalidateVolumes\n"));
 
     KIRQL SavedIrql;
 
@@ -2472,13 +2472,13 @@ UDFInvalidateVolumes(
         IrpSp->MinorFunction == IRP_MN_USER_FS_REQUEST &&
         IrpSp->Parameters.FileSystemControl.FsControlCode == FSCTL_INVALIDATE_VOLUMES &&
         !SeSinglePrivilegeCheck( TcbPrivilege, UserMode )) {
-        KdPrint(("UDFInvalidateVolumes: STATUS_PRIVILEGE_NOT_HELD\n"));
+        UDFPrintErr(("UDFInvalidateVolumes: STATUS_PRIVILEGE_NOT_HELD\n"));
         Irp->IoStatus.Status = STATUS_PRIVILEGE_NOT_HELD;
         return STATUS_PRIVILEGE_NOT_HELD;
     }
     //  Try to get a pointer to the device object from the handle passed in.
     if (IrpSp->Parameters.FileSystemControl.InputBufferLength != sizeof( HANDLE )) {
-        KdPrint(("UDFInvalidateVolumes: STATUS_INVALID_PARAMETER\n"));
+        UDFPrintErr(("UDFInvalidateVolumes: STATUS_INVALID_PARAMETER\n"));
         Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
         return STATUS_INVALID_PARAMETER;
     }
@@ -2493,7 +2493,7 @@ UDFInvalidateVolumes(
                                     NULL );
 
     if (!NT_SUCCESS(RC)) {
-        KdPrint(("UDFInvalidateVolumes: can't get handle, RC=%x\n", RC));
+        UDFPrintErr(("UDFInvalidateVolumes: can't get handle, RC=%x\n", RC));
         Irp->IoStatus.Status = RC;
         return RC;
     }
@@ -2508,7 +2508,7 @@ UDFInvalidateVolumes(
     //  a new volume.
     NewVpb = (PVPB)DbgAllocatePoolWithTag( NonPagedPool, sizeof( VPB ), 'bpvU' );
     if(!NewVpb) {
-        KdPrint(("UDFInvalidateVolumes: STATUS_INSUFFICIENT_RESOURCES\n"));
+        UDFPrintErr(("UDFInvalidateVolumes: STATUS_INSUFFICIENT_RESOURCES\n"));
         Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
         return STATUS_INSUFFICIENT_RESOURCES;
     }
@@ -2554,7 +2554,7 @@ UDFInvalidateVolumes(
             if(!Buf) {
                 Buf = (PPREVENT_MEDIA_REMOVAL_USER_IN)MyAllocatePool__(NonPagedPool, sizeof(PREVENT_MEDIA_REMOVAL_USER_IN)*2);
                 if(!Buf) {
-                    KdPrint(("UDFInvalidateVolumes: STATUS_INSUFFICIENT_RESOURCES (2)\n"));
+                    UDFPrintErr(("UDFInvalidateVolumes: STATUS_INSUFFICIENT_RESOURCES (2)\n"));
                     UDFReleaseResource(&(Vcb->VCBResource));
                     MyFreePool__(NewVpb);
                     Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -2563,18 +2563,18 @@ UDFInvalidateVolumes(
             }
 
 #ifdef UDF_DELAYED_CLOSE
-            KdPrint(("    UDFInvalidateVolumes:     set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
+            UDFPrint(("    UDFInvalidateVolumes:     set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
             Vcb->VCBFlags |= UDF_VCB_FLAGS_NO_DELAYED_CLOSE;
             UDFReleaseResource(&(Vcb->VCBResource));
 #endif //UDF_DELAYED_CLOSE
 
             if(Vcb->RootDirFCB && Vcb->RootDirFCB->FileInfo) {
-                KdPrint(("    UDFInvalidateVolumes:     UDFCloseAllSystemDelayedInDir\n"));
+                UDFPrint(("    UDFInvalidateVolumes:     UDFCloseAllSystemDelayedInDir\n"));
                 RC = UDFCloseAllSystemDelayedInDir(Vcb, Vcb->RootDirFCB->FileInfo);
                 ASSERT(OS_SUCCESS(RC));
             }
 #ifdef UDF_DELAYED_CLOSE
-            KdPrint(("    UDFInvalidateVolumes:     UDFCloseAllDelayed\n"));
+            UDFPrint(("    UDFInvalidateVolumes:     UDFCloseAllDelayed\n"));
             UDFCloseAllDelayed(Vcb);
             //ASSERT(OS_SUCCESS(RC));
 #endif //UDF_DELAYED_CLOSE
@@ -2585,10 +2585,10 @@ UDFInvalidateVolumes(
             UDFReleaseResource(&(Vcb->VCBResource));
 
             UDFStopEjectWaiter(Vcb);
-            KdPrint(("UDFInvalidateVolumes: Vcb %x dismounted\n", Vcb));
+            UDFPrint(("UDFInvalidateVolumes: Vcb %x dismounted\n", Vcb));
             break;
         } else {
-            KdPrint(("UDFInvalidateVolumes: skip Vcb %x\n", Vcb));
+            UDFPrint(("UDFInvalidateVolumes: skip Vcb %x\n", Vcb));
             UDFReleaseResource(&(Vcb->VCBResource));
         }
 
@@ -2600,17 +2600,17 @@ UDFInvalidateVolumes(
     Irp->IoStatus.Status = STATUS_SUCCESS;
 
     if(Buf) {
-        KdPrint(("UDFInvalidateVolumes: free buffer\n"));
+        UDFPrint(("UDFInvalidateVolumes: free buffer\n"));
         MyFreePool__(Buf);
     }
 
     // drop volume completly
-    KdPrint(("UDFInvalidateVolumes: drop volume completly\n"));
+    UDFPrint(("UDFInvalidateVolumes: drop volume completly\n"));
     UDFAcquireResourceExclusive(&(UDFGlobalData.GlobalDataResource), TRUE);
     UDFScanForDismountedVcb(IrpContext);
     UDFReleaseResource( &(UDFGlobalData.GlobalDataResource) );
 
-    KdPrint(("UDFInvalidateVolumes: done\n"));
+    UDFPrint(("UDFInvalidateVolumes: done\n"));
     return STATUS_SUCCESS;
 
 } // end UDFInvalidateVolumes()
index 0e2e48f..cbebb0f 100644 (file)
@@ -43,7 +43,7 @@ UDFLockControl(
     PtrUDFIrpContext    PtrIrpContext = NULL;
     BOOLEAN             AreWeTopLevel = FALSE;
 
-    KdPrint(("UDFLockControl\n"));
+    UDFPrint(("UDFLockControl\n"));
 //    BrutePoint();
 
     FsRtlEnterFileSystem();
@@ -118,7 +118,7 @@ UDFCommonLockControl(
     PtrUDFFCB           Fcb = NULL;
     PtrUDFCCB           Ccb = NULL;
 
-    KdPrint(("UDFCommonLockControl\n"));
+    UDFPrint(("UDFCommonLockControl\n"));
 
     _SEH2_TRY {
         // First, get a pointer to the current I/O stack location.
@@ -220,7 +220,7 @@ UDFFastLock (
     PtrUDFFCB           Fcb = NULL;
     PtrUDFCCB           Ccb = NULL;
 
-    KdPrint(("UDFFastLock\n"));
+    UDFPrint(("UDFFastLock\n"));
     //  Decode the type of file object we're being asked to process and make
     //  sure it is only a user file open.
 
@@ -323,7 +323,7 @@ UDFFastUnlockSingle(
     PtrUDFFCB           Fcb = NULL;
     PtrUDFCCB           Ccb = NULL;
 
-    KdPrint(("UDFFastUnlockSingle\n"));
+    UDFPrint(("UDFFastUnlockSingle\n"));
     //  Decode the type of file object we're being asked to process and make
     //  sure it is only a user file open.
 
@@ -415,7 +415,7 @@ UDFFastUnlockAll(
     PtrUDFFCB           Fcb = NULL;
     PtrUDFCCB           Ccb = NULL;
 
-    KdPrint(("UDFFastUnlockAll\n"));
+    UDFPrint(("UDFFastUnlockAll\n"));
 
     IoStatus->Information = 0;
     //  Decode the type of file object we're being asked to process and make
@@ -506,7 +506,7 @@ UDFFastUnlockAllByKey(
     PtrUDFFCB           Fcb = NULL;
     PtrUDFCCB           Ccb = NULL;
 
-    KdPrint(("UDFFastUnlockAllByKey\n"));
+    UDFPrint(("UDFFastUnlockAllByKey\n"));
 
     IoStatus->Information = 0;
     //  Decode the type of file object we're being asked to process and make
index 946873b..b4a8447 100644 (file)
@@ -272,32 +272,32 @@ UDFExceptionFilter(
 #if defined UDF_DBG || defined PRINT_ALWAYS
     ULONG i;
 
-    KdPrint(("UDFExceptionFilter\n"));
-    KdPrint(("    Ex. Code: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionCode));
-    KdPrint(("    Ex. Addr: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionAddress));
-    KdPrint(("    Ex. Flag: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionFlags));
-    KdPrint(("    Ex. Pnum: %x\n",PtrExceptionPointers->ExceptionRecord->NumberParameters));
+    UDFPrint(("UDFExceptionFilter\n"));
+    UDFPrint(("    Ex. Code: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionCode));
+    UDFPrint(("    Ex. Addr: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionAddress));
+    UDFPrint(("    Ex. Flag: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionFlags));
+    UDFPrint(("    Ex. Pnum: %x\n",PtrExceptionPointers->ExceptionRecord->NumberParameters));
     for(i=0;i<PtrExceptionPointers->ExceptionRecord->NumberParameters;i++) {
-        KdPrint(("       %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionInformation[i]));
+        UDFPrint(("       %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionInformation[i]));
     }
 #ifdef _X86_
-    KdPrint(("Exception context:\n"));
+    UDFPrint(("Exception context:\n"));
     if(PtrExceptionPointers->ContextRecord->ContextFlags & CONTEXT_INTEGER) {
-        KdPrint(("EAX=%8.8x   ",PtrExceptionPointers->ContextRecord->Eax));
-        KdPrint(("EBX=%8.8x   ",PtrExceptionPointers->ContextRecord->Ebx));
-        KdPrint(("ECX=%8.8x   ",PtrExceptionPointers->ContextRecord->Ecx));
-        KdPrint(("EDX=%8.8x\n",PtrExceptionPointers->ContextRecord->Edx));
+        UDFPrint(("EAX=%8.8x   ",PtrExceptionPointers->ContextRecord->Eax));
+        UDFPrint(("EBX=%8.8x   ",PtrExceptionPointers->ContextRecord->Ebx));
+        UDFPrint(("ECX=%8.8x   ",PtrExceptionPointers->ContextRecord->Ecx));
+        UDFPrint(("EDX=%8.8x\n",PtrExceptionPointers->ContextRecord->Edx));
 
-        KdPrint(("ESI=%8.8x   ",PtrExceptionPointers->ContextRecord->Esi));
-        KdPrint(("EDI=%8.8x   ",PtrExceptionPointers->ContextRecord->Edi));
+        UDFPrint(("ESI=%8.8x   ",PtrExceptionPointers->ContextRecord->Esi));
+        UDFPrint(("EDI=%8.8x   ",PtrExceptionPointers->ContextRecord->Edi));
     }
     if(PtrExceptionPointers->ContextRecord->ContextFlags & CONTEXT_CONTROL) {
-        KdPrint(("EBP=%8.8x   ",PtrExceptionPointers->ContextRecord->Esp));
-        KdPrint(("ESP=%8.8x\n",PtrExceptionPointers->ContextRecord->Ebp));
+        UDFPrint(("EBP=%8.8x   ",PtrExceptionPointers->ContextRecord->Esp));
+        UDFPrint(("ESP=%8.8x\n",PtrExceptionPointers->ContextRecord->Ebp));
 
-        KdPrint(("EIP=%8.8x\n",PtrExceptionPointers->ContextRecord->Eip));
+        UDFPrint(("EIP=%8.8x\n",PtrExceptionPointers->ContextRecord->Eip));
     }
-//    KdPrint(("Flags: %s %s    ",PtrExceptionPointers->ContextRecord->Eip));
+//    UDFPrint(("Flags: %s %s    ",PtrExceptionPointers->ContextRecord->Eip));
 #endif //_X86_
 
 #endif // UDF_DBG
@@ -319,7 +319,7 @@ UDFExceptionFilter(
 
         // better free up the IrpContext now ...
         if (PtrIrpContext) {
-            KdPrint(("    UDF Driver internal error\n"));
+            UDFPrint(("    UDF Driver internal error\n"));
             BrutePoint();
         } else {
             // we are not ok, propagate this exception.
@@ -366,12 +366,12 @@ UDFExceptionHandler(
     PVPB Vpb;
     PETHREAD Thread;
 
-    KdPrint(("UDFExceptionHandler \n"));
+    UDFPrint(("UDFExceptionHandler \n"));
 
 //    ASSERT(Irp);
 
     if (!Irp) {
-        KdPrint(("  !Irp, return\n"));
+        UDFPrint(("  !Irp, return\n"));
         ASSERT(!PtrIrpContext);
         return ExceptionCode;
     }
@@ -383,7 +383,7 @@ UDFExceptionHandler(
         // Free irp context here
 //        UDFReleaseIrpContext(PtrIrpContext);
     } else {
-        KdPrint(("  complete Irp and return\n"));
+        UDFPrint(("  complete Irp and return\n"));
         // must be insufficient resources ...?
         ExceptionCode = STATUS_INSUFFICIENT_RESOURCES;
         Irp->IoStatus.Status = ExceptionCode;
@@ -408,7 +408,7 @@ UDFExceptionHandler(
 
     if (ExceptionCode == STATUS_VERIFY_REQUIRED) {
         if (KeGetCurrentIrql() >= APC_LEVEL) {
-            KdPrint(("  use UDFPostRequest()\n"));
+            UDFPrint(("  use UDFPostRequest()\n"));
             ExceptionCode = UDFPostRequest( PtrIrpContext, Irp );
         }
     }
@@ -417,7 +417,7 @@ UDFExceptionHandler(
     if ((ExceptionCode == STATUS_PENDING) ||
         (ExceptionCode == STATUS_CANT_WAIT)) {
 
-        KdPrint(("  STATUS_PENDING/STATUS_CANT_WAIT, return\n"));
+        UDFPrint(("  STATUS_PENDING/STATUS_CANT_WAIT, return\n"));
         return ExceptionCode;
     }
 
@@ -448,7 +448,7 @@ UDFExceptionHandler(
                 //  Let's not BugCheck just because the driver screwed up.
                 if (Device == NULL) {
 
-                    KdPrint(("  Device == NULL, return\n"));
+                    UDFPrint(("  Device == NULL, return\n"));
                     ExceptionCode = STATUS_DRIVER_INTERNAL_ERROR;
                     Irp->IoStatus.Status = ExceptionCode;
                     Irp->IoStatus.Information = 0;
@@ -461,7 +461,7 @@ UDFExceptionHandler(
                 }
             }
 
-            KdPrint(("  use UDFPerformVerify()\n"));
+            UDFPrint(("  use UDFPerformVerify()\n"));
             //  UDFPerformVerify() will do the right thing with the Irp.
             //  If we return STATUS_CANT_WAIT then the current thread
             //  can retry the request.
@@ -475,7 +475,7 @@ UDFExceptionHandler(
 
         if (FlagOn( PtrIrpContext->IrpContextFlags, UDF_IRP_CONTEXT_FLAG_DISABLE_POPUPS )) {
   
-            KdPrint(("  DISABLE_POPUPS, complete Irp and return\n"));
+            UDFPrint(("  DISABLE_POPUPS, complete Irp and return\n"));
             Irp->IoStatus.Status = ExceptionCode;
             Irp->IoStatus.Information = 0;
             // complete the IRP
@@ -506,7 +506,7 @@ UDFExceptionHandler(
 
                 //  Let's not BugCheck just because the driver screwed up.
                 if (Device == NULL) {
-                    KdPrint(("  Device == NULL, return(2)\n"));
+                    UDFPrint(("  Device == NULL, return(2)\n"));
                     Irp->IoStatus.Status = ExceptionCode;
                     Irp->IoStatus.Information = 0;
                     // complete the IRP
@@ -528,7 +528,7 @@ UDFExceptionHandler(
             //  We will be handing control back to the caller here, so
             //  reset the saved device object.
 
-            KdPrint(("  use IoSetDeviceToVerify()\n"));
+            UDFPrint(("  use IoSetDeviceToVerify()\n"));
             IoSetDeviceToVerify( Thread, NULL );
             //  The Irp will be completed by Io or resubmitted.  In either
             //  case we must clean up the IrpContext here.
@@ -540,7 +540,7 @@ UDFExceptionHandler(
 
     // If it was a normal request from IOManager then complete it
     if (Irp) {
-        KdPrint(("  complete Irp\n"));
+        UDFPrint(("  complete Irp\n"));
         // set the error code in the IRP
         Irp->IoStatus.Status = ExceptionCode;
         Irp->IoStatus.Information = 0;
@@ -551,7 +551,7 @@ UDFExceptionHandler(
         UDFReleaseIrpContext(PtrIrpContext);
     }
 
-    KdPrint(("  return from exception handler with code %x\n", ExceptionCode));
+    UDFPrint(("  return from exception handler with code %x\n", ExceptionCode));
     return(ExceptionCode);
 } // end UDFExceptionHandler()
 
@@ -725,7 +725,7 @@ UDFAllocateCCB(VOID)
         // if we failed to obtain from the zone, get it directly from the VMM
         Ccb = (PtrUDFCCB)MyAllocatePool__(NonPagedPool, UDFQuadAlign(sizeof(UDFCCB)));
         AllocatedFromZone = FALSE;
-//        KdPrint(("    CCB allocated @%x\n",Ccb));
+//        UDFPrint(("    CCB allocated @%x\n",Ccb));
     }
 
     if (!Ccb) {
@@ -744,7 +744,7 @@ UDFAllocateCCB(VOID)
         UDFSetFlag(Ccb->CCBFlags, UDF_CCB_NOT_FROM_ZONE);
     }
 
-    KdPrint(("UDFAllocateCCB: %x\n", Ccb));
+    UDFPrint(("UDFAllocateCCB: %x\n", Ccb));
     return(Ccb);
 } // end UDFAllocateCCB()
 
@@ -773,7 +773,7 @@ UDFReleaseCCB(
 
     ASSERT(Ccb);
 
-    KdPrint(("UDFReleaseCCB: %x\n", Ccb));
+    UDFPrint(("UDFReleaseCCB: %x\n", Ccb));
     // give back memory either to the zone or to the VMM
     if(!(Ccb->CCBFlags & UDF_CCB_NOT_FROM_ZONE)) {
         // back to the zone
@@ -868,7 +868,7 @@ UDFAllocateFCB(VOID)
     Fcb->NodeIdentifier.NodeType = UDF_NODE_TYPE_FCB;
     Fcb->NodeIdentifier.NodeSize = UDFQuadAlign(sizeof(UDFFCB));
 
-    KdPrint(("UDFAllocateFCB: %x\n", Fcb));
+    UDFPrint(("UDFAllocateFCB: %x\n", Fcb));
     return(Fcb);
 } // end UDFAllocateFCB()
 
@@ -909,7 +909,7 @@ UDFCleanUpFCB(
     PtrUDFFCB Fcb
     )
 {
-    KdPrint(("UDFCleanUpFCB: %x\n", Fcb));
+    UDFPrint(("UDFCleanUpFCB: %x\n", Fcb));
     if(!Fcb) return;
 
     ASSERT(Fcb->NodeIdentifier.NodeType == UDF_NODE_TYPE_FCB);
@@ -927,7 +927,7 @@ UDFCleanUpFCB(
             }
 #ifdef UDF_DBG
             else {
-                KdPrint(("UDF: Fcb has invalid FCBName Buffer\n"));
+                UDFPrint(("UDF: Fcb has invalid FCBName Buffer\n"));
                 BrutePoint();
             }
 #endif
@@ -936,7 +936,7 @@ UDFCleanUpFCB(
         }
 #ifdef UDF_DBG
         else {
-            KdPrint(("UDF: Fcb has invalid FCBName field\n"));
+            UDFPrint(("UDF: Fcb has invalid FCBName field\n"));
             BrutePoint();
         }
 #endif
@@ -1224,7 +1224,7 @@ UDFCommonDispatch(
          (PtrIrpContext->NodeIdentifier.NodeType != UDF_NODE_TYPE_IRP_CONTEXT) ||
          (PtrIrpContext->NodeIdentifier.NodeSize != UDFQuadAlign(sizeof(UDFIrpContext))) /*||
         !(PtrIrpContext->Irp)*/) {
-        KdPrint(("    Invalid Context\n"));
+        UDFPrint(("    Invalid Context\n"));
         BrutePoint();
         return;
     }
@@ -1232,11 +1232,11 @@ UDFCommonDispatch(
     Vcb = (PVCB)(PtrIrpContext->TargetDeviceObject->DeviceExtension);
     ASSERT(Vcb);
 
-    KdPrint(("  *** Thr: %x  ThCnt: %x  QCnt: %x  Started!\n", PsGetCurrentThread(), Vcb->PostedRequestCount, Vcb->OverflowQueueCount));
+    UDFPrint(("  *** Thr: %x  ThCnt: %x  QCnt: %x  Started!\n", PsGetCurrentThread(), Vcb->PostedRequestCount, Vcb->OverflowQueueCount));
 
     while(TRUE) {
 
-        KdPrint(("    Next IRP\n"));
+        UDFPrint(("    Next IRP\n"));
         FsRtlEnterFileSystem();
 
         //  Get a pointer to the IRP structure
@@ -1263,7 +1263,7 @@ UDFCommonDispatch(
             // either in the IrpContext (copied from the IRP), or directly from the
             //  IRP itself (we will need a pointer to the stack location to do that),
             //  Then, switch based on the value on the Major Function code
-            KdPrint(("  *** MJ: %x, Thr: %x\n", PtrIrpContext->MajorFunction, PsGetCurrentThread()));
+            UDFPrint(("  *** MJ: %x, Thr: %x\n", PtrIrpContext->MajorFunction, PsGetCurrentThread()));
             switch (PtrIrpContext->MajorFunction) {
             case IRP_MJ_CREATE:
                 // Invoke the common create routine
@@ -1332,7 +1332,7 @@ UDFCommonDispatch(
 #endif // UDF_ENABLE_SECURITY
             // Continue with the remaining possible dispatch routines below ...
             default:
-                KdPrint(("  unhandled *** MJ: %x, Thr: %x\n", PtrIrpContext->MajorFunction, PsGetCurrentThread()));
+                UDFPrint(("  unhandled *** MJ: %x, Thr: %x\n", PtrIrpContext->MajorFunction, PsGetCurrentThread()));
                 // This is the case where we have an invalid major function
                 Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
                 Irp->IoStatus.Information = 0;
@@ -1344,7 +1344,7 @@ UDFCommonDispatch(
             }
 
             // Note: PtrIrpContext is invalid here
-            KdPrint(("  *** Thr: %x  Done!\n", PsGetCurrentThread()));
+            UDFPrint(("  *** Thr: %x  Done!\n", PsGetCurrentThread()));
 
         } _SEH2_EXCEPT(UDFExceptionFilter(PtrIrpContext, _SEH2_GetExceptionInformation())) {
 
@@ -1386,7 +1386,7 @@ UDFCommonDispatch(
     Vcb->PostedRequestCount--;
     KeReleaseSpinLock(&(Vcb->OverflowQueueSpinLock), SavedIrql);
 
-    KdPrint(("  *** Thr: %x  ThCnt: %x  QCnt: %x  Terminated!\n", PsGetCurrentThread(), Vcb->PostedRequestCount, Vcb->OverflowQueueCount));
+    UDFPrint(("  *** Thr: %x  ThCnt: %x  QCnt: %x  Terminated!\n", PsGetCurrentThread(), Vcb->PostedRequestCount, Vcb->OverflowQueueCount));
 
     return;
 } // end UDFCommonDispatch()
@@ -1637,7 +1637,7 @@ Kill_DevName_buffer:
         }
     }
 
-    KdPrint(("  TargetDevName: %S\n", Vcb->TargetDevName.Buffer));
+    UDFPrint(("  TargetDevName: %S\n", Vcb->TargetDevName.Buffer));
 
     // Initialize caching for the stream file object.
     //CcInitializeCacheMap(Vcb->PtrStreamFileObject, (PCC_FILE_SIZES)(&(Vcb->AllocationSize)),
@@ -2138,18 +2138,18 @@ UDFReleaseVCB(
     )
 {
     LARGE_INTEGER delay;
-    KdPrint(("UDFReleaseVCB\n"));
+    UDFPrint(("UDFReleaseVCB\n"));
 
     delay.QuadPart = -500000; // 0.05 sec
     while(Vcb->PostedRequestCount) {
-        KdPrint(("UDFReleaseVCB: PostedRequestCount = %d\n", Vcb->PostedRequestCount));
+        UDFPrint(("UDFReleaseVCB: PostedRequestCount = %d\n", Vcb->PostedRequestCount));
         // spin until all queues IRPs are processed
         KeDelayExecutionThread(KernelMode, FALSE, &delay);
         delay.QuadPart -= 500000; // grow delay 0.05 sec
     }
 
     _SEH2_TRY {
-        KdPrint(("UDF: Flushing buffers\n"));
+        UDFPrint(("UDF: Flushing buffers\n"));
         UDFVRelease(Vcb);
         WCacheFlushAll__(&(Vcb->FastCache),Vcb);
         WCacheRelease__(&(Vcb->FastCache));
@@ -2161,8 +2161,8 @@ UDFReleaseVCB(
 #ifdef UDF_DBG
     _SEH2_TRY {
         if (!ExIsResourceAcquiredShared(&UDFGlobalData.GlobalDataResource)) {
-            KdPrint(("UDF: attempt to access to not protected data\n"));
-            KdPrint(("UDF: UDFGlobalData\n"));
+            UDFPrint(("UDF: attempt to access to not protected data\n"));
+            UDFPrint(("UDF: UDFGlobalData\n"));
             BrutePoint();
         }
     } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
@@ -2185,7 +2185,7 @@ UDFReleaseVCB(
     }*/
 
     _SEH2_TRY {
-        KdPrint(("UDF: Delete resources\n"));
+        UDFPrint(("UDF: Delete resources\n"));
         UDFDeleteResource(&(Vcb->VCBResource));
         UDFDeleteResource(&(Vcb->BitMapResource1));
         UDFDeleteResource(&(Vcb->FcbListResource));
@@ -2200,7 +2200,7 @@ UDFReleaseVCB(
     } _SEH2_END;
 
     _SEH2_TRY {
-        KdPrint(("UDF: Cleanup VCB\n"));
+        UDFPrint(("UDF: Cleanup VCB\n"));
         ASSERT(IsListEmpty(&(Vcb->NextNotifyIRP)));
         FsRtlNotifyUninitializeSync(&(Vcb->NotifyIRPMutex));
         UDFCleanupVCB(Vcb);
@@ -2209,7 +2209,7 @@ UDFReleaseVCB(
     } _SEH2_END;
 
     _SEH2_TRY {
-        KdPrint(("UDF: Delete DO\n"));
+        UDFPrint(("UDF: Delete DO\n"));
         IoDeleteDevice(Vcb->VCBDeviceObject);
     } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
         BrutePoint();
@@ -2263,12 +2263,12 @@ UDFRegCheckParameterValue(
 
         paramPath.Buffer = (PWCH)MyAllocatePool__(PagedPool, paramPath.MaximumLength);
         if(!paramPath.Buffer) {
-            KdPrint(("UDFCheckRegValue: couldn't allocate paramPath\n"));
+            UDFPrint(("UDFCheckRegValue: couldn't allocate paramPath\n"));
             try_return(val = DefValue);
         }
         paramPathUnknown.Buffer = (PWCH)MyAllocatePool__(PagedPool, paramPathUnknown.MaximumLength);
         if(!paramPathUnknown.Buffer) {
-            KdPrint(("UDFCheckRegValue: couldn't allocate paramPathUnknown\n"));
+            UDFPrint(("UDFCheckRegValue: couldn't allocate paramPathUnknown\n"));
             try_return(val = DefValue);
         }
 
@@ -2281,7 +2281,7 @@ UDFRegCheckParameterValue(
         if(!NT_SUCCESS(status)) {
             try_return(val = DefValue);
         }
-        KdPrint(("UDFCheckRegValue: (1) |%S|\n", paramPath.Buffer));
+        UDFPrint(("UDFCheckRegValue: (1) |%S|\n", paramPath.Buffer));
 
         RtlZeroMemory(paramPathUnknown.Buffer, paramPathUnknown.MaximumLength);
         status = RtlAppendUnicodeToString(&paramPathUnknown, RegistryPath->Buffer);
@@ -2296,7 +2296,7 @@ UDFRegCheckParameterValue(
         if(!NT_SUCCESS(status)) {
             try_return(val = DefValue);
         }
-        KdPrint(("UDFCheckRegValue: (2) |%S|\n", paramPathUnknown.Buffer));
+        UDFPrint(("UDFCheckRegValue: (2) |%S|\n", paramPathUnknown.Buffer));
 
         // First append \Parameters\Default_XXX to the passed in registry path
         if(DefaultPath) {
@@ -2305,7 +2305,7 @@ UDFRegCheckParameterValue(
             defaultParamPath.MaximumLength = paramPath.Length + defaultParamStr.Length + sizeof(WCHAR);
             defaultParamPath.Buffer = (PWCH)MyAllocatePool__(PagedPool, defaultParamPath.MaximumLength);
             if(!defaultParamPath.Buffer) {
-                KdPrint(("UDFCheckRegValue: couldn't allocate defaultParamPath\n"));
+                UDFPrint(("UDFCheckRegValue: couldn't allocate defaultParamPath\n"));
                 try_return(val = DefValue);
             }
 
@@ -2318,7 +2318,7 @@ UDFRegCheckParameterValue(
             if(!NT_SUCCESS(status)) {
                 try_return(val = DefValue);
             }
-            KdPrint(("UDFCheckRegValue: (3) |%S|\n", defaultParamPath.Buffer));
+            UDFPrint(("UDFCheckRegValue: (3) |%S|\n", defaultParamPath.Buffer));
         }
 
         if(PtrVolumePath) {
@@ -2347,7 +2347,7 @@ UDFRegCheckParameterValue(
             }
         }
 
-        KdPrint(( " Parameter = %ws\n", Name));
+        UDFPrint(( " Parameter = %ws\n", Name));
 
         {
             HKEY hk = NULL;
@@ -2393,7 +2393,7 @@ try_exit:   NOTHING;
         }
     } _SEH2_END;
 
-    KdPrint(( "UDFCheckRegValue: %ws for drive %s is %x\n\n", Name, PtrVolumePath, val));
+    UDFPrint(( "UDFCheckRegValue: %ws for drive %s is %x\n\n", Name, PtrVolumePath, val));
     return val;
 } // end UDFRegCheckParameterValue()
 
@@ -2489,7 +2489,7 @@ UDFQuerySetEA(
 //    PtrUDFIrpContext PtrIrpContext = NULL;
     BOOLEAN          AreWeTopLevel = FALSE;
 
-    KdPrint(("UDFQuerySetEA: \n"));
+    UDFPrint(("UDFQuerySetEA: \n"));
 
     FsRtlEnterFileSystem();
     ASSERT(DeviceObject);
@@ -2533,7 +2533,7 @@ UDFAcquireResourceExclusiveWithCheck(
         ExIsResourceAcquiredExclusiveLite(Resource) ? 1 :
         (ExIsResourceAcquiredSharedLite(Resource) ? 2 : 0);
     if(ReAcqRes) {
-        KdPrint(("UDFAcquireResourceExclusiveWithCheck: ReAcqRes, %x\n", ReAcqRes));
+        UDFPrint(("UDFAcquireResourceExclusiveWithCheck: ReAcqRes, %x\n", ReAcqRes));
     } else {
 //        BrutePoint();
     }
@@ -2542,7 +2542,7 @@ UDFAcquireResourceExclusiveWithCheck(
         // OK
     } else
     if(ReAcqRes == 2) {
-        KdPrint(("UDFAcquireResourceExclusiveWithCheck: !!! Shared !!!\n"));
+        UDFPrint(("UDFAcquireResourceExclusiveWithCheck: !!! Shared !!!\n"));
         //BrutePoint();
     } else {
         UDFAcquireResourceExclusive(Resource, TRUE);
@@ -2560,7 +2560,7 @@ UDFAcquireResourceSharedWithCheck(
         ExIsResourceAcquiredExclusiveLite(Resource) ? 1 :
         (ExIsResourceAcquiredSharedLite(Resource) ? 2 : 0);
     if(ReAcqRes) {
-        KdPrint(("UDFAcquireResourceSharedWithCheck: ReAcqRes, %x\n", ReAcqRes));
+        UDFPrint(("UDFAcquireResourceSharedWithCheck: ReAcqRes, %x\n", ReAcqRes));
 /*    } else {
         BrutePoint();*/
     }
@@ -2569,7 +2569,7 @@ UDFAcquireResourceSharedWithCheck(
         // OK
     } else
     if(ReAcqRes == 1) {
-        KdPrint(("UDFAcquireResourceSharedWithCheck: Exclusive\n"));
+        UDFPrint(("UDFAcquireResourceSharedWithCheck: Exclusive\n"));
         //BrutePoint();
     } else {
         UDFAcquireResourceShared(Resource, TRUE);
index 1c44dea..61db744 100644 (file)
@@ -87,7 +87,7 @@ UDFPnp (
     PtrUDFIrpContext PtrIrpContext = NULL;
     BOOLEAN AreWeTopLevel;
 
-    KdPrint(("UDFPnp\n"));
+    UDFPrint(("UDFPnp\n"));
     ASSERT(FALSE);
 
     FsRtlEnterFileSystem();
@@ -150,7 +150,7 @@ UDFCommonPnp (
     NTSTATUS RC;
     PIO_STACK_LOCATION IrpSp;
     PVCB Vcb;
-    KdPrint(("UDFCommonPnp\n"));
+    UDFPrint(("UDFCommonPnp\n"));
 
     _SEH2_TRY {
         // Get the current Irp stack location.
@@ -195,7 +195,7 @@ UDFCommonPnp (
                 break;*/
 
             default:
-                KdPrint(("UDFCommonPnp: pass through\n"));
+                UDFPrint(("UDFCommonPnp: pass through\n"));
                 //  Just pass the IRP on.  As we do not need to be in the
                 //  way on return, ellide ourselves out of the stack.
                 IoSkipCurrentIrpStackLocation( Irp );
index c3079eb..5f60bd5 100644 (file)
@@ -124,7 +124,7 @@ UDFPostStackOverflowRead(
     PKEVENT Event;
     PERESOURCE Resource;
 
-    KdPrint(("Getting too close to stack limit pass request to Fsp\n"));
+    UDFPrint(("Getting too close to stack limit pass request to Fsp\n"));
 
     //  Allocate an event and get shared on the resource we will
     //  be later using the common read.
@@ -190,7 +190,7 @@ UDFStackOverflowRead(
     PtrUDFIrpContext PtrIrpContext = (PtrUDFIrpContext)Context;
     NTSTATUS RC;
 
-    KdPrint(("UDFStackOverflowRead: \n"));
+    UDFPrint(("UDFStackOverflowRead: \n"));
     //  Make it now look like we can wait for I/O to complete
     PtrIrpContext->IrpContextFlags |= UDF_IRP_CONTEXT_CAN_BLOCK;
 
@@ -264,27 +264,27 @@ UDFCommonRead(
         TopIrp = IoGetTopLevelIrp();
         switch((ULONG)TopIrp) {
         case FSRTL_FSP_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_FSP_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_FSP_TOP_LEVEL_IRP\n"));
             break;
         case FSRTL_CACHE_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_CACHE_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_CACHE_TOP_LEVEL_IRP\n"));
             break;
         case FSRTL_MOD_WRITE_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
 //            BrutePoint()
             break;
         case FSRTL_FAST_IO_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
 //            BrutePoint()
             break;
         case NULL:
-            KdPrint(("  NULL TOP_LEVEL_IRP\n"));
+            UDFPrint(("  NULL TOP_LEVEL_IRP\n"));
             break;
         default:
             if(TopIrp == Irp) {
-                KdPrint(("  TOP_LEVEL_IRP\n"));
+                UDFPrint(("  TOP_LEVEL_IRP\n"));
             } else {
-                KdPrint(("  RECURSIVE_IRP, TOP = %x\n", TopIrp));
+                UDFPrint(("  RECURSIVE_IRP, TOP = %x\n", TopIrp));
             }
             break;
         }
@@ -345,7 +345,7 @@ UDFCommonRead(
         PagingIo = (Irp->Flags & IRP_PAGING_IO) ? TRUE : FALSE;
         NonBufferedIo = (Irp->Flags & IRP_NOCACHE) ? TRUE : FALSE;
         SynchronousIo = (FileObject->Flags & FO_SYNCHRONOUS_IO) ? TRUE : FALSE;
-        KdPrint(("    Flags: %s %s %s %s\n",
+        UDFPrint(("    Flags: %s %s %s %s\n",
                       CanWait ? "W" : "w", PagingIo ? "Pg" : "pg",
                       NonBufferedIo ? "NBuf" : "buff", SynchronousIo ? "Snc" : "Asc"));
 
@@ -368,7 +368,7 @@ UDFCommonRead(
             // a 0 byte read can be immediately succeeded
             try_return(RC);
         }
-        KdPrint(("    ByteOffset = %I64x, ReadLength = %x\n", ByteOffset.QuadPart, ReadLength));
+        UDFPrint(("    ByteOffset = %I64x, ReadLength = %x\n", ByteOffset.QuadPart, ReadLength));
 
         // Is this a read of the volume itself ?
         if (Fcb->NodeIdentifier.NodeType == UDF_NODE_TYPE_VCB) {
@@ -382,7 +382,7 @@ UDFCommonRead(
 
             if(PtrIrpContext->IrpContextFlags & UDF_IRP_CONTEXT_FLUSH2_REQUIRED) {
 
-                KdPrint(("  UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
+                UDFPrint(("  UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
                 PtrIrpContext->IrpContextFlags &= ~UDF_IRP_CONTEXT_FLUSH2_REQUIRED;
 
                 if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK)) {
@@ -396,7 +396,7 @@ UDFCommonRead(
 
             if(PtrIrpContext->IrpContextFlags & UDF_IRP_CONTEXT_FLUSH_REQUIRED) {
 
-                KdPrint(("  UDF_IRP_CONTEXT_FLUSH_REQUIRED\n"));
+                UDFPrint(("  UDF_IRP_CONTEXT_FLUSH_REQUIRED\n"));
                 PtrIrpContext->IrpContextFlags &= ~UDF_IRP_CONTEXT_FLUSH_REQUIRED;
 
                 // Acquire the volume resource exclusive
@@ -515,7 +515,7 @@ UDFCommonRead(
             TruncatedLength = (ULONG)(NtReqFcb->CommonFCBHeader.FileSize.QuadPart - ByteOffset.QuadPart);
             // we can't get ZERO here
         }
-        KdPrint(("    TruncatedLength = %x\n", TruncatedLength));
+        UDFPrint(("    TruncatedLength = %x\n", TruncatedLength));
 
         // There are certain complications that arise when the same file stream
         // has been opened for cached and non-cached access. The FSD is then
@@ -685,11 +685,11 @@ UDFCommonRead(
 
 #if 1
             if((ULONG)TopIrp == FSRTL_MOD_WRITE_TOP_LEVEL_IRP) {
-                KdPrint(("FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n"));
+                UDFPrint(("FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n"));
                 CanWait = TRUE;
             } else
             if((ULONG)TopIrp == FSRTL_CACHE_TOP_LEVEL_IRP) {
-                KdPrint(("FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n"));
+                UDFPrint(("FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n"));
                 CanWait = TRUE;
             }
 
@@ -699,7 +699,7 @@ UDFCommonRead(
             } else
             {}
 /*            if((TopIrp != Irp)) {
-                KdPrint(("(TopIrp != Irp) => CanWait\n"));
+                UDFPrint(("(TopIrp != Irp) => CanWait\n"));
                 CanWait = TRUE;
             } else*/
 #endif
@@ -831,7 +831,7 @@ try_exit:   NOTHING;
             if(!_SEH2_AbnormalTermination()) {
                 Irp->IoStatus.Status = RC;
                 Irp->IoStatus.Information = NumberBytesRead;
-                KdPrint(("    NumberBytesRead = %x\n", NumberBytesRead));
+                UDFPrint(("    NumberBytesRead = %x\n", NumberBytesRead));
                 // Free up the Irp Context
                 UDFReleaseIrpContext(PtrIrpContext);
                 // complete the IRP
@@ -875,7 +875,7 @@ UDFGetCallersBuffer(
 {
     VOID            *ReturnedBuffer = NULL;
 
-    KdPrint(("UDFGetCallersBuffer: \n"));
+    UDFPrint(("UDFGetCallersBuffer: \n"));
 
     // If an MDL is supplied, use it.
     if(Irp->MdlAddress) {
@@ -943,7 +943,7 @@ UDFLockCallersBuffer(
     NTSTATUS            RC = STATUS_SUCCESS;
     PMDL                PtrMdl = NULL;
 
-    KdPrint(("UDFLockCallersBuffer: \n"));
+    UDFPrint(("UDFLockCallersBuffer: \n"));
 
     ASSERT(Irp);
     
@@ -1039,7 +1039,7 @@ UDFUnlockCallersBuffer(
 {
     NTSTATUS            RC = STATUS_SUCCESS;
 
-    KdPrint(("UDFUnlockCallersBuffer: \n"));
+    UDFPrint(("UDFUnlockCallersBuffer: \n"));
 
     ASSERT(Irp);
 
@@ -1047,7 +1047,7 @@ UDFUnlockCallersBuffer(
         // Is a nonPaged buffer already present in the IRP
         if (PtrIrpContext->IrpContextFlags & UDF_IRP_CONTEXT_BUFFER_LOCKED) {
 
-            KdPrint(("  UDF_IRP_CONTEXT_BUFFER_LOCKED MDL=%x, Irp MDL=%x\n", PtrIrpContext->PtrMdl, Irp->MdlAddress));
+            UDFPrint(("  UDF_IRP_CONTEXT_BUFFER_LOCKED MDL=%x, Irp MDL=%x\n", PtrIrpContext->PtrMdl, Irp->MdlAddress));
             if(PtrIrpContext->TransitionBuffer) {
                 MmPrint(("    UDFUnlockCallersBuffer: free TransitionBuffer\n"));
                 DbgFreePool(PtrIrpContext->TransitionBuffer);
@@ -1083,7 +1083,7 @@ UDFUnlockCallersBuffer(
         if(Irp->MdlAddress) {
 //            MmPrint(("    Irp->Mdl, MmUnmapLockedPages()\n"));
 //            MmUnmapLockedPages(SystemBuffer, Irp->MdlAddress);
-            KdPrint(("  UDF_IRP_CONTEXT_BUFFER_LOCKED MDL=%x, Irp MDL=%x\n", PtrIrpContext->PtrMdl, Irp->MdlAddress));
+            UDFPrint(("  UDF_IRP_CONTEXT_BUFFER_LOCKED MDL=%x, Irp MDL=%x\n", PtrIrpContext->PtrMdl, Irp->MdlAddress));
             UDFTouch(Irp->MdlAddress);
             KeFlushIoBuffers( Irp->MdlAddress,
                               ((IoGetCurrentIrpStackLocation(Irp))->MajorFunction) == IRP_MJ_READ,
@@ -1123,7 +1123,7 @@ BOOLEAN                     ReadCompletion)
     NTSTATUS                RC = STATUS_SUCCESS;
     PFILE_OBJECT            FileObject = NULL;
 
-    KdPrint(("UDFMdlComplete: \n"));
+    UDFPrint(("UDFMdlComplete: \n"));
 
     FileObject = IrpSp->FileObject;
     ASSERT(FileObject);
index 238b6ab..de5bb15 100644 (file)
@@ -62,7 +62,7 @@ UDFGetSecurity(
     PtrUDFIrpContext    PtrIrpContext = NULL;
     BOOLEAN             AreWeTopLevel = FALSE;
 
-    KdPrint(("UDFGetSecurity\n"));
+    UDFPrint(("UDFGetSecurity\n"));
 //    BrutePoint();
 
     FsRtlEnterFileSystem();
@@ -137,7 +137,7 @@ UDFCommonGetSecurity(
     PVOID               PtrSystemBuffer = NULL;
     ULONG               BufferLength = 0;
 
-    KdPrint(("UDFCommonGetSecurity\n"));
+    UDFPrint(("UDFCommonGetSecurity\n"));
 
     _SEH2_TRY {
 
@@ -241,7 +241,7 @@ UDFSetSecurity(
     PtrUDFIrpContext    PtrIrpContext = NULL;
     BOOLEAN             AreWeTopLevel = FALSE;
 
-    KdPrint(("UDFSetSecurity\n"));
+    UDFPrint(("UDFSetSecurity\n"));
 //    BrutePoint();
 
     FsRtlEnterFileSystem();
@@ -314,7 +314,7 @@ UDFCommonSetSecurity(
     PtrUDFCCB           Ccb = NULL;
     ACCESS_MASK         DesiredAccess = 0;
 
-    KdPrint(("UDFCommonSetSecurity\n"));
+    UDFPrint(("UDFCommonSetSecurity\n"));
 
     _SEH2_TRY {
 
@@ -362,7 +362,7 @@ UDFCommonSetSecurity(
             UDFConvertToSelfRelative(&(NtReqFcb->SecurityDesc));
 
             KdDump(NtReqFcb->SecurityDesc, RtlLengthSecurityDescriptor(NtReqFcb->SecurityDesc));
-            KdPrint(("\n"));
+            UDFPrint(("\n"));
 
             RC = SeSetSecurityDescriptorInfo(/*FileObject*/ NULL,
                                           &(IrpSp->Parameters.SetSecurity.SecurityInformation),
@@ -431,18 +431,18 @@ UDFReadSecurity(
     ULONG NumberBytesRead;
     PERESOURCE Res1 = NULL;
 
-    KdPrint(("UDFReadSecurity\n"));
+    UDFPrint(("UDFReadSecurity\n"));
 
     _SEH2_TRY {
 
         FileInfo = Fcb->FileInfo;
         ASSERT(FileInfo);
         if(!FileInfo) {
-            KdPrint(("  Volume Security\n"));
+            UDFPrint(("  Volume Security\n"));
             try_return(RC = STATUS_NO_SECURITY_ON_OBJECT);
         }
         if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
-            KdPrint(("  No Security on blank volume\n"));
+            UDFPrint(("  No Security on blank volume\n"));
             try_return(RC = STATUS_NO_SECURITY_ON_OBJECT);
         }
 
@@ -532,7 +532,7 @@ UDFConvertToSelfRelative(
     PSECURITY_DESCRIPTOR NewSD;
     ULONG Len;
 
-    KdPrint(("  UDFConvertToSelfRelative\n"));
+    UDFPrint(("  UDFConvertToSelfRelative\n"));
 
     if(!(*SecurityDesc))
         return STATUS_NO_SECURITY_ON_OBJECT;
@@ -569,7 +569,7 @@ UDFInheritAcl(
     SECURITY_INFORMATION SecurityInformation;
     ULONG Len;
 
-    KdPrint(("  UDFInheritAcl\n"));
+    UDFPrint(("  UDFInheritAcl\n"));
 
     if(!(*ParentSecurityDesc)) {
         *SecurityDesc = NULL;
@@ -603,7 +603,7 @@ UDFBuildEmptyAcl(
     NTSTATUS RC;
     ULONG Len = 2 * (sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE) + sizeof(ULONG)*4 /*RtlLengthSid(SeExports->SeWorldSid)*/);
 
-    KdPrint(("  UDFBuildEmptyAcl\n"));
+    UDFPrint(("  UDFBuildEmptyAcl\n"));
     // Create Security Descriptor
     (*SecurityDesc) = (PSECURITY_DESCRIPTOR)DbgAllocatePool(NonPagedPool,
            sizeof(SECURITY_DESCRIPTOR) + Len);
@@ -629,7 +629,7 @@ UDFBuildFullControlAcl(
     PACL Acl;
     ULONG Len = sizeof(ACL) + 2*(sizeof(ACCESS_ALLOWED_ACE) + sizeof(ULONG)*4 /*- sizeof(ULONG)*/ /*+ RtlLengthSid(SeExports->SeWorldSid)*/);
 
-    KdPrint(("  UDFBuildFullControlAcl\n"));
+    UDFPrint(("  UDFBuildFullControlAcl\n"));
     // Create Security Descriptor
     RC = UDFBuildEmptyAcl(Vcb, SecurityDesc);
     if(!NT_SUCCESS(RC))
@@ -714,7 +714,7 @@ UDFAssignAcl(
 #ifdef UDF_ENABLE_SECURITY
 //    SECURITY_INFORMATION SecurityInformation;
 
-//    KdPrint(("  UDFAssignAcl\n"));
+//    UDFPrint(("  UDFAssignAcl\n"));
     if(!NtReqFcb->SecurityDesc) {
 
         PSECURITY_DESCRIPTOR ExplicitSecurity = NULL;
@@ -777,7 +777,7 @@ UDFDeassignAcl(
 #ifdef UDF_ENABLE_SECURITY
 //    NTSTATUS RC = STATUS_SUCCESS;
 
-//    KdPrint(("  UDFDeassignAcl\n"));
+//    UDFPrint(("  UDFDeassignAcl\n"));
     if(!NtReqFcb->SecurityDesc)
         return;
 
@@ -807,7 +807,7 @@ UDFWriteSecurity(
     NTSTATUS RC;
     ULONG NumberBytesRead;
 
-//    KdPrint(("UDFWriteSecurity\n"));
+//    UDFPrint(("UDFWriteSecurity\n"));
 
 #if !defined(UDF_READ_ONLY_BUILD)
 
@@ -826,7 +826,7 @@ UDFWriteSecurity(
         FileInfo = Fcb->FileInfo;
         ASSERT(FileInfo);
         if(!FileInfo) {
-            KdPrint(("  Volume Security\n"));
+            UDFPrint(("  Volume Security\n"));
             try_return(RC = STATUS_SUCCESS);
         }
 
index 4d63b73..10216f0 100644 (file)
@@ -53,7 +53,7 @@ UDFShutdown(
     PtrUDFIrpContext PtrIrpContext = NULL;
     BOOLEAN          AreWeTopLevel = FALSE;
 
-    KdPrint(("UDFShutDown\n"));
+    UDFPrint(("UDFShutDown\n"));
 //    BrutePoint();
 
     FsRtlEnterFileSystem();
@@ -124,7 +124,7 @@ UDFCommonShutdown(
     PPREVENT_MEDIA_REMOVAL_USER_IN Buf = NULL;
     LARGE_INTEGER delay;
 
-    KdPrint(("UDFCommonShutdown\n"));
+    UDFPrint(("UDFCommonShutdown\n"));
 
     _SEH2_TRY {
         // First, get a pointer to the current I/O stack location
@@ -168,7 +168,7 @@ UDFCommonShutdown(
 
 #ifdef UDF_DELAYED_CLOSE
                 UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
-                KdPrint(("    UDFCommonShutdown:     set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
+                UDFPrint(("    UDFCommonShutdown:     set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_NO_DELAYED_CLOSE;
                 UDFReleaseResource(&(Vcb->VCBResource));
 #endif //UDF_DELAYED_CLOSE
@@ -178,7 +178,7 @@ UDFCommonShutdown(
                 // release GlobalDataResource and re-acquire it later.
                 UDFReleaseResource( &(UDFGlobalData.GlobalDataResource) );
                 if(Vcb->RootDirFCB && Vcb->RootDirFCB->FileInfo) {
-                    KdPrint(("    UDFCommonShutdown:     UDFCloseAllSystemDelayedInDir\n"));
+                    UDFPrint(("    UDFCommonShutdown:     UDFCloseAllSystemDelayedInDir\n"));
                     RC = UDFCloseAllSystemDelayedInDir(Vcb, Vcb->RootDirFCB->FileInfo);
                     ASSERT(OS_SUCCESS(RC));
                 }
index d253d92..9e47401 100644 (file)
@@ -22,7 +22,7 @@ UDFDebugAcquireResourceSharedLite(
 ) {
     ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,PsGetCurrentThread()));
 #endif
 
@@ -45,14 +45,14 @@ UDFDebugAcquireResourceSharedLite(
 
     if(Success) {
 #ifdef TRACK_RESOURCES
-        KdPrint(("Res:Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+        UDFPrint(("Res:Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
             BugCheckId,Line,PsGetCurrentThread()));
 #endif
         AcqCounter++;
         return Success;
     }
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Sha:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Sha:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,PsGetCurrentThread()));
 #endif
     return FALSE;
@@ -67,7 +67,7 @@ UDFDebugAcquireSharedStarveExclusive(
 ) {
     ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Sha*:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Sha*:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,PsGetCurrentThread()));
 #endif
 
@@ -90,14 +90,14 @@ UDFDebugAcquireSharedStarveExclusive(
 
     if(Success) {
 #ifdef TRACK_RESOURCES
-        KdPrint(("Res:Sha*:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+        UDFPrint(("Res:Sha*:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
             BugCheckId,Line,PsGetCurrentThread()));
 #endif
         AcqCounter++;
         return Success;
     }
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,PsGetCurrentThread()));
 #endif
     return FALSE;
@@ -112,7 +112,7 @@ UDFDebugAcquireResourceExclusiveLite(
 ) {
     ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Exc:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Exc:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,PsGetCurrentThread()));
 #endif
 
@@ -138,14 +138,14 @@ UDFDebugAcquireResourceExclusiveLite(
     
     if(Success) {
 #ifdef TRACK_RESOURCES
-        KdPrint(("Res:Exc:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+        UDFPrint(("Res:Exc:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
             BugCheckId,Line,PsGetCurrentThread()));
 #endif
         AcqCounter++;
         return Success;
     }
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Exc:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Exc:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,PsGetCurrentThread()));
 #endif
 //    BrutePoint();
@@ -163,12 +163,12 @@ UDFDebugReleaseResourceForThreadLite(
 {
     ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Free:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Free:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,PsGetCurrentThread()));
 #endif
     ExReleaseResourceForThreadLite(Resource, ResourceThreadId);
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Free:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Free:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,ResourceThreadId));
 #endif
     AcqCounter--;
@@ -184,7 +184,7 @@ UDFDebugDeleteResource(
 {
     ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Del:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Del:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,ResourceThreadId));
 #endif
     _SEH2_TRY {
@@ -196,7 +196,7 @@ UDFDebugDeleteResource(
         BrutePoint();
     } _SEH2_END;
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Del:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Del:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,ResourceThreadId));
 #endif
     ResCounter--;
@@ -213,14 +213,14 @@ UDFDebugInitializeResourceLite(
     ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
     NTSTATUS RC;
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Ini:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Ini:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,ResourceThreadId));
 #endif
     ASSERT(!(*((PULONG)Resource)));
     ASSERT(!(*(((PULONG)Resource)+1)));
     RC = ExInitializeResourceLite(Resource);
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Ini:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Ini:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,ResourceThreadId));
 #endif
     if(NT_SUCCESS(RC)) {
@@ -239,12 +239,12 @@ UDFDebugConvertExclusiveToSharedLite(
 {
     ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:2Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:2Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,ResourceThreadId));
 #endif
     ExConvertExclusiveToSharedLite(Resource);
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:2Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:2Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,ResourceThreadId));
 #endif
 }
@@ -258,7 +258,7 @@ UDFDebugAcquireSharedWaitForExclusive(
 ) {
     ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Sha*:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Sha*:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,PsGetCurrentThread()));
 #endif
 
@@ -282,13 +282,13 @@ UDFDebugAcquireSharedWaitForExclusive(
 
     if(Success) {
 #ifdef TRACK_RESOURCES
-        KdPrint(("Res:Sha*:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+        UDFPrint(("Res:Sha*:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
             BugCheckId,Line,PsGetCurrentThread()));
 #endif
         return Success;
     }
 #ifdef TRACK_RESOURCES
-    KdPrint(("Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+    UDFPrint(("Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
         BugCheckId,Line,PsGetCurrentThread()));
 #endif
 //    BrutePoint();
@@ -306,7 +306,7 @@ UDFDebugInterlockedIncrement(
 #ifdef TRACK_REF_COUNTERS
     LONG a;
     a = InterlockedIncrement(addr);
-    KdPrint(("ThId:%x:Ilck:Inc:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
+    UDFPrint(("ThId:%x:Ilck:Inc:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
         PsGetCurrentThread(),BugCheckId,Line,addr,a-1,a));
     return a;
 #else
@@ -323,7 +323,7 @@ UDFDebugInterlockedDecrement(
 #ifdef TRACK_REF_COUNTERS
     LONG a;
     a = InterlockedDecrement(addr);
-    KdPrint(("ThId:%x:Ilck:Dec:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
+    UDFPrint(("ThId:%x:Ilck:Dec:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
         PsGetCurrentThread(),BugCheckId,Line,addr,a+1,a));
     return a;
 #else
@@ -341,7 +341,7 @@ UDFDebugInterlockedExchangeAdd(
 #ifdef TRACK_REF_COUNTERS
     LONG a;
     a = InterlockedExchangeAdd(addr,i);
-    KdPrint(("ThId:%x:Ilck:Add:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
+    UDFPrint(("ThId:%x:Ilck:Add:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
         PsGetCurrentThread(),BugCheckId,Line,addr,a,a+i));
     return a;
 #else
@@ -378,7 +378,7 @@ DebugAllocatePool(
 #endif //TRACK_SYS_ALLOC_CALLERS
 ) {
     ULONG i;
-//    KdPrint(("SysAllocated: %x\n",AllocCount));
+//    UDFPrint(("SysAllocated: %x\n",AllocCount));
     if(!MemDescInited) {
         RtlZeroMemory(&MemDesc, sizeof(MemDesc));
         MemDescInited = 1;
@@ -407,7 +407,7 @@ DebugAllocatePool(
         }
     }
     if(cur_max == MAX_MEM_DEBUG_DESCRIPTORS) {
-        KdPrint(("Debug memory descriptor list full\n"));
+        UDFPrint(("Debug memory descriptor list full\n"));
         return ExAllocatePoolWithTag(Type, (size) , 'Fnwd');
     }
 
@@ -456,11 +456,11 @@ VOID DebugFreePool(PVOID addr) {
         }
     }
     if (i==cur_max && cur_max != MAX_MEM_DEBUG_DESCRIPTORS) {
-        KdPrint(("Buug! - Deallocating nonallocated block\n"));
+        UDFPrint(("Buug! - Deallocating nonallocated block\n"));
         return;
     }
 not_bug:
-//    KdPrint(("SysAllocated: %x\n",AllocCount));
+//    UDFPrint(("SysAllocated: %x\n",AllocCount));
     ExFreePool(addr);
 }
 
@@ -470,7 +470,7 @@ UDFWaitForSingleObject(
     IN PLARGE_INTEGER Timeout OPTIONAL
     )
 {
-    KdPrint(("UDFWaitForSingleObject\n"));
+    UDFPrint(("UDFWaitForSingleObject\n"));
     LARGE_INTEGER LocalTimeout;
     LARGE_INTEGER delay;
     delay.QuadPart = -(WAIT_FOR_XXX_EMU_DELAY);
@@ -478,11 +478,11 @@ UDFWaitForSingleObject(
     if(Timeout && (Timeout->QuadPart)) LocalTimeout = *Timeout;
     else LocalTimeout.QuadPart = 0x7FFFFFFFFFFFFFFFLL;
 
-    KdPrint(("SignalState %x\n", *Object));
+    UDFPrint(("SignalState %x\n", *Object));
     if(!Object) return STATUS_INVALID_PARAMETER;
     if((*Object)) return STATUS_SUCCESS;
     while(LocalTimeout.QuadPart>0 && !(*Object) ) {
-        KdPrint(("SignalState %x\n", *Object));
+        UDFPrint(("SignalState %x\n", *Object));
         // Stall for a while.
         KeDelayExecutionThread(KernelMode, FALSE, &delay);
         LocalTimeout.QuadPart -= WAIT_FOR_XXX_EMU_DELAY;
@@ -518,7 +518,7 @@ DbgWaitForSingleObject_(
         RC = KeWaitForSingleObject(Object, Executive, KernelMode, FALSE, to);
         if(RC == STATUS_SUCCESS)
             break;
-        KdPrint(("No response ?\n"));
+        UDFPrint(("No response ?\n"));
         if(c<2)
             BrutePoint();
     }
index c4b845c..0d55dcf 100644 (file)
@@ -1186,7 +1186,7 @@ UDFIsBlockAllocated(
     if(bm = (uint32*)(((PVCB)_Vcb)->BSBM_Bitmap)) {
         ret_val |= (UDFGetBadBit(bm, Lba) ? WCACHE_BLOCK_BAD : 0);
         if(ret_val & WCACHE_BLOCK_BAD) {
-            KdPrint(("Marked BB @ %#x\n", Lba));
+            UDFPrint(("Marked BB @ %#x\n", Lba));
         }
     }
 */
index e941e24..fdb0e52 100644 (file)
@@ -31,7 +31,7 @@
 
 #define UDF_DUMP_DIRTREE
 #ifdef UDF_DUMP_DIRTREE
-#define DirPrint(x)  KdPrint(x)
+#define DirPrint(x)  UDFPrint(x)
 #else
 #define DirPrint(x)  {;}
 #endif
@@ -490,7 +490,7 @@ UDFFindNextFI(
         if(FileId->fileCharacteristics & (~0x1f))
             continue;
         if(prevOffset + ((FileId->lengthFileIdent + FileId->lengthOfImpUse + sizeof(FILE_IDENT_DESC) + 3) & (~((uint32)3))) <= Length) {
-            KdPrint(("UDFFindNextFI OK: %x\n", prevOffset));
+            UDFPrint(("UDFFindNextFI OK: %x\n", prevOffset));
             return prevOffset;
         }
     }
@@ -527,7 +527,7 @@ UDFIndexDirectory(
 
     ExtInfo = &(FileInfo->Dloc->DataLoc);
     FileInfo->Dloc->DirIndex = NULL;
-    KdPrint(("UDF: scaning directory\n"));
+    UDFPrint(("UDF: scaning directory\n"));
     // allocate buffer for the whole directory
     ASSERT((uint32)(ExtInfo->Length));
     if(!ExtInfo->Length)
@@ -578,7 +578,7 @@ UDFIndexDirectory(
         Count++;
         if(Offset+sizeof(FILE_IDENT_DESC) > ExtInfo->Length) {
             if(Offset != ExtInfo->Length) {
-                KdPrint(("  Trash at the end of Dir\n"));
+                UDFPrint(("  Trash at the end of Dir\n"));
             }
 //            BrutePoint();
             break;
@@ -587,7 +587,7 @@ UDFIndexDirectory(
     DirPrint(("  final Offset %x\n", Offset));
     if(Offset > ExtInfo->Length) {
         BrutePoint();
-        KdPrint(("  Unexpected end of Dir\n"));
+        UDFPrint(("  Unexpected end of Dir\n"));
         DbgFreePool(buff);
         return STATUS_FILE_CORRUPT_ERROR;
     }
@@ -631,7 +631,7 @@ UDFIndexDirectory(
     while((Offset<ExtInfo->Length) && FileId->descTag.tagIdent) {
         // add new entry to index list
         if(FileId->descTag.tagIdent != TID_FILE_IDENT_DESC) {
-            KdPrint(("  Invalid tagIdent %x (expected %x) offst %x\n", FileId->descTag.tagIdent, TID_FILE_IDENT_DESC, Offset));
+            UDFPrint(("  Invalid tagIdent %x (expected %x) offst %x\n", FileId->descTag.tagIdent, TID_FILE_IDENT_DESC, Offset));
             DirPrint(("    FileId: filen %x, iulen %x, charact %x\n",
                 FileId->lengthFileIdent, FileId->lengthOfImpUse, FileId->fileCharacteristics));
             DirPrint(("    loc: @%x\n", UDFExtentOffsetToLba(Vcb, ExtInfo->Mapping, Offset, NULL, NULL, NULL, NULL)));
@@ -686,7 +686,7 @@ UDFIndexDirectory(
             DirNdx->FI_Flags |= UDF_FI_FLAG_FI_INTERNAL;
         }
 #if 0
-        KdPrint(("%ws\n", DirNdx->FName.Buffer));
+        UDFPrint(("%ws\n", DirNdx->FName.Buffer));
 #endif
         DirPrint(("%ws\n", DirNdx->FName.Buffer));
         // remember FileEntry location...
@@ -715,7 +715,7 @@ UDFIndexDirectory(
         Count++;
         if(Offset+sizeof(FILE_IDENT_DESC) > ExtInfo->Length) {
             if(Offset != ExtInfo->Length) {
-                KdPrint(("  Trash at the end of Dir (2)\n"));
+                UDFPrint(("  Trash at the end of Dir (2)\n"));
             }
 //            BrutePoint();
             break;
@@ -725,7 +725,7 @@ UDFIndexDirectory(
     DbgFreePool(buff);
     if(Count < 2) {
         UDFDirIndexFree(hDirNdx);
-        KdPrint(("  Directory too short\n"));
+        UDFPrint(("  Directory too short\n"));
         return STATUS_FILE_CORRUPT_ERROR;
     }
     // store index
index 2ffa31d..4d55137 100644 (file)
@@ -342,7 +342,7 @@ UDFShortAllocDescToMapping(
             AllocExt.extLength = len;
             AllocExt.extLocation = UDFPartLbaToPhys(Vcb, &locAddr);
             if(AllocExt.extLocation == LBA_OUT_OF_EXTENT) {
-                KdPrint(("bad address\n"));
+                UDFPrint(("bad address\n"));
                 MyFreePool__(NextAllocDesc);
                 MyFreePool__(Extent);
                 return NULL;
@@ -370,10 +370,10 @@ UDFShortAllocDescToMapping(
             // check integrity
             if((NextAllocDesc->descTag.tagIdent != TID_ALLOC_EXTENT_DESC) ||
                (NextAllocDesc->lengthAllocDescs > (len - sizeof(ALLOC_EXT_DESC))) ) {
-                KdPrint(("Integrity check failed\n"));
-                KdPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
-                KdPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
-                KdPrint(("len = %x\n", len));
+                UDFPrint(("Integrity check failed\n"));
+                UDFPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
+                UDFPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
+                UDFPrint(("len = %x\n", len));
                 MyFreePool__(NextAllocDesc);
                 MyFreePool__(Extent);
                 return NULL;
@@ -415,7 +415,7 @@ UDFShortAllocDescToMapping(
         if(type != EXTENT_NOT_RECORDED_NOT_ALLOCATED && len) {
             Extent[i].extLocation = UDFPartLbaToPhys(Vcb, &locAddr);
             if(Extent[i].extLocation == LBA_OUT_OF_EXTENT) {
-                KdPrint(("bad address (2)\n"));
+                UDFPrint(("bad address (2)\n"));
                 MyFreePool__(Extent);
                 return NULL;
             }
@@ -502,7 +502,7 @@ UDFLongAllocDescToMapping(
             AllocExt.extLength = len;
             AllocExt.extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
             if(AllocExt.extLocation == LBA_OUT_OF_EXTENT) {
-                KdPrint(("bad address\n"));
+                UDFPrint(("bad address\n"));
                 MyFreePool__(NextAllocDesc);
                 MyFreePool__(Extent);
                 return NULL;
@@ -530,10 +530,10 @@ UDFLongAllocDescToMapping(
             // check integrity
             if((NextAllocDesc->descTag.tagIdent != TID_ALLOC_EXTENT_DESC) ||
                (NextAllocDesc->lengthAllocDescs > (len - sizeof(ALLOC_EXT_DESC))) ) {
-                KdPrint(("Integrity check failed\n"));
-                KdPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
-                KdPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
-                KdPrint(("len = %x\n", len));
+                UDFPrint(("Integrity check failed\n"));
+                UDFPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
+                UDFPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
+                UDFPrint(("len = %x\n", len));
                 MyFreePool__(NextAllocDesc);
                 MyFreePool__(Extent);
                 return NULL;
@@ -564,7 +564,7 @@ UDFLongAllocDescToMapping(
         if(type != EXTENT_NOT_RECORDED_NOT_ALLOCATED && len) {
             Extent[i].extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
             if(Extent[i].extLocation == LBA_OUT_OF_EXTENT) {
-                KdPrint(("bad address (2)\n"));
+                UDFPrint(("bad address (2)\n"));
                 MyFreePool__(Extent);
                 return NULL;
             }
@@ -638,7 +638,7 @@ UDFExtAllocDescToMapping(
             AllocExt.extLength = len;
             AllocExt.extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
             if(AllocExt.extLocation == LBA_OUT_OF_EXTENT) {
-                KdPrint(("bad address\n"));
+                UDFPrint(("bad address\n"));
                 MyFreePool__(NextAllocDesc);
                 MyFreePool__(Extent);
                 return NULL;
@@ -666,7 +666,7 @@ UDFExtAllocDescToMapping(
             // check integrity
             if((NextAllocDesc->descTag.tagIdent != TID_ALLOC_EXTENT_DESC) ||
                (NextAllocDesc->lengthAllocDescs > (len - sizeof(ALLOC_EXT_DESC))) ) {
-                KdPrint(("Integrity check failed\n"));
+                UDFPrint(("Integrity check failed\n"));
                 MyFreePool__(NextAllocDesc);
                 MyFreePool__(Extent);
                 return NULL;
@@ -700,7 +700,7 @@ UDFExtAllocDescToMapping(
         if(type != EXTENT_NOT_RECORDED_NOT_ALLOCATED && len) {
             Extent[i].extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
             if(Extent[i].extLocation == LBA_OUT_OF_EXTENT) {
-                KdPrint(("bad address (2)\n"));
+                UDFPrint(("bad address (2)\n"));
                 MyFreePool__(Extent);
                 return NULL;
             }
@@ -751,7 +751,7 @@ UDFReadMappingFromXEntry(
 
 
     if(XEntry->tagIdent == TID_FILE_ENTRY) {
-//        KdPrint(("Standard FileEntry\n"));
+//        UDFPrint(("Standard FileEntry\n"));
         PFILE_ENTRY FileEntry = (PFILE_ENTRY)XEntry;
         ExtPrint(("Standard FileEntry\n"));
 
@@ -763,7 +763,7 @@ UDFReadMappingFromXEntry(
         AllocMode = FileEntry->icbTag.flags & ICB_FLAG_ALLOC_MASK;
 
     } else if(XEntry->tagIdent == TID_EXTENDED_FILE_ENTRY) {
-//        KdPrint(("Extended FileEntry\n"));
+//        UDFPrint(("Extended FileEntry\n"));
         ExtPrint(("Extended FileEntry\n"));
         PEXTENDED_FILE_ENTRY ExFileEntry = (PEXTENDED_FILE_ENTRY)XEntry;
 
@@ -925,14 +925,14 @@ UDFBuildShortAllocDescs(
         (*Buff) = (int8*)MyAllocatePoolTag__(NonPagedPool, NewLen, MEM_SHAD_TAG);
         if(!(*Buff)) {
             status = STATUS_INSUFFICIENT_RESOURCES;
-            KdPrint(("UDFResizeExtent() failed (%x)\n",status));
+            UDFPrint(("UDFResizeExtent() failed (%x)\n",status));
             BrutePoint();
             goto sh_alloc_err;
         }
         if(UDFGetExtentLength(AllocExtent->Mapping) < NewLen) {
             status = UDFResizeExtent(Vcb, PartNum, NewLen, TRUE, AllocExtent);
             if(!OS_SUCCESS(status)) {
-                KdPrint(("UDFResizeExtent(2) failed (%x)\n",status));
+                UDFPrint(("UDFResizeExtent(2) failed (%x)\n",status));
                 BrutePoint();
 sh_alloc_err:
                 MyFreePool__(Alloc);
@@ -1336,16 +1336,16 @@ UDFDiscardFESpace(
     PEXTENT_MAP Mapping2;
     uint32 i;
 
-    KdPrint(("  DiscardFESpace\n"));
+    UDFPrint(("  DiscardFESpace\n"));
     Mapping2 = Mapping;
     for(i=0;i<lim;i++, Mapping++) {
         // we should not discard allocated FEs
         if( (Mapping->extLength >> 30) == EXTENT_RECORDED_ALLOCATED) {
-            KdPrint(("  used @ %x\n", Mapping->extLocation));
+            UDFPrint(("  used @ %x\n", Mapping->extLocation));
             Mapping->extLength = Vcb->LBlockSize | (EXTENT_NOT_RECORDED_NOT_ALLOCATED << 30);
             Mapping->extLocation = 0;
         } else {
-            KdPrint(("  free @ %x\n", Mapping->extLocation));
+            UDFPrint(("  free @ %x\n", Mapping->extLocation));
         }
     }
     UDFMarkSpaceAsXXX(Vcb, 0, Mapping2, AS_DISCARDED);
@@ -1373,13 +1373,13 @@ UDFInitAllocationCache(
 
     switch(AllocClass) {
     case UDF_PREALLOC_CLASS_FE:
-        KdPrint(("AllocationCache FE:\n"));
+        UDFPrint(("AllocationCache FE:\n"));
         pAllocCache = &(Vcb->FEChargeCache);
         plim = &(Vcb->FEChargeCacheMaxSize);
         lim = 32;
         break;
     case UDF_PREALLOC_CLASS_DIR:
-        KdPrint(("AllocationCache DIR:\n"));
+        UDFPrint(("AllocationCache DIR:\n"));
         pAllocCache = &(Vcb->PreallocCache);
         plim = &(Vcb->PreallocCacheMaxSize);
         lim = 32;
@@ -1433,7 +1433,7 @@ UDFGetCachedAllocation(
         UDFReleaseResource(&(Vcb->PreallocResource));
         return status;
     }
-    KdPrint(("Get AllocationCache for %x\n", ParentLocation));
+    UDFPrint(("Get AllocationCache for %x\n", ParentLocation));
 
     for(i=0; i<lim; i++) {
         if(AllocCache[i].ParentLocation == ParentLocation) {
@@ -1473,7 +1473,7 @@ UDFStoreCachedAllocation(
         UDFReleaseResource(&(Vcb->PreallocResource));
         return status;
     }
-    KdPrint(("Store AllocationCache for %x, map %x\n", ParentLocation, Ext->Mapping));
+    UDFPrint(("Store AllocationCache for %x, map %x\n", ParentLocation, Ext->Mapping));
 
     for(i=0; i<lim; i++) {
         if(AllocCache[i].ParentLocation == LBA_NOT_ALLOCATED) {
@@ -1514,7 +1514,7 @@ UDFFlushAllCachedAllocations(
     uint32 i, lim;
     OSSTATUS status;
 
-    KdPrint(("Flush AllocationCache\n"));
+    UDFPrint(("Flush AllocationCache\n"));
     UDFAcquireResourceExclusive(&(Vcb->PreallocResource),TRUE);
 
     status = UDFInitAllocationCache(Vcb, AllocClass, &AllocCache, &lim, FALSE);
@@ -1621,7 +1621,7 @@ UDFAllocateFESpace(
             if(Vcb->LowFreeSpace) {
                 status = UDFAllocFreeExtent(Vcb, Len << Vcb->LBlockSizeBits,p_start, p_end, FEExtInfo, EXTENT_FLAG_VERIFY);
                 if(OS_SUCCESS(status)) {
-                    KdPrint(("FE @ %x (1)\n", FEExtInfo->Mapping[0].extLocation ));
+                    UDFPrint(("FE @ %x (1)\n", FEExtInfo->Mapping[0].extLocation ));
                 }
                 return status;
             } else {
@@ -1647,11 +1647,11 @@ UDFAllocateFESpace(
                 }
                 if(!OS_SUCCESS(status = UDFAllocFreeExtent(Vcb, lim << Vcb->LBlockSizeBits, p_start, p_end, Ext, EXTENT_FLAG_VERIFY) )) {
                     // can't pre-allocate space for multiple FEs. Try single FE
-                    KdPrint(("allocate single FE entry\n"));
+                    UDFPrint(("allocate single FE entry\n"));
                     status = UDFAllocFreeExtent(Vcb, Len,
                            p_start, p_end, FEExtInfo, EXTENT_FLAG_VERIFY);
                     if(OS_SUCCESS(status)) {
-                        KdPrint(("FE @ %x (2)\n", FEExtInfo->Mapping[0].extLocation ));
+                        UDFPrint(("FE @ %x (2)\n", FEExtInfo->Mapping[0].extLocation ));
                     }
                     return status;
                 }
@@ -1674,7 +1674,7 @@ UDFAllocateFESpace(
                 if(Vcb->BSBM_Bitmap) {
                     uint32 lba = Ext->Mapping[i].extLocation;
                     if(UDFGetBadBit((uint32*)(Vcb->BSBM_Bitmap), lba)) {
-                        KdPrint(("Remove BB @ %x from FE charge\n", lba));
+                        UDFPrint(("Remove BB @ %x from FE charge\n", lba));
                         Ext->Mapping[i].extLength |= (EXTENT_NOT_RECORDED_NOT_ALLOCATED << 30);
                         Ext->Mapping[i].extLocation = 0;
                         continue;
@@ -1687,7 +1687,7 @@ UDFAllocateFESpace(
                     Ext->Mapping[i].extLength |= (EXTENT_NOT_RECORDED_ALLOCATED << 30);
                     return STATUS_INSUFFICIENT_RESOURCES;
                 }
-                KdPrint(("FE @ %x (3)\n", FEExtInfo->Mapping[0].extLocation ));
+                UDFPrint(("FE @ %x (3)\n", FEExtInfo->Mapping[0].extLocation ));
                 FEExtInfo->Length = Len;
                 FEExtInfo->Offset = 0;
                 FEExtInfo->Modified = TRUE;
@@ -1699,7 +1699,7 @@ UDFAllocateFESpace(
             status = UDFAllocFreeExtent(Vcb, Len,
                    UDFPartStart(Vcb, PartNum), UDFPartEnd(Vcb, PartNum), FEExtInfo, EXTENT_FLAG_VERIFY);
             if(OS_SUCCESS(status)) {
-                KdPrint(("FE @ %x (4)\n", FEExtInfo->Mapping[0].extLocation ));
+                UDFPrint(("FE @ %x (4)\n", FEExtInfo->Mapping[0].extLocation ));
             }
             return status;
         }
@@ -2297,7 +2297,7 @@ UDFResizeExtent(
                 int64 l2 = ((l-1)/MaxGrow + 1)*MaxGrow;
                 status = UDFResizeExtent(Vcb, PartNum, l2, AlwaysInIcb, ExtInfo);
                 if(!OS_SUCCESS(status)) {
-                    KdPrint(("Sub-call to UDFResizeExtent() failed (%x)\n", status));
+                    UDFPrint(("Sub-call to UDFResizeExtent() failed (%x)\n", status));
                     return status;
                 }
                 l = ExtInfo->Length;
@@ -2306,7 +2306,7 @@ UDFResizeExtent(
             while((Length - l) > MaxGrow) {
                 status = UDFResizeExtent(Vcb, PartNum, l+MaxGrow, AlwaysInIcb, ExtInfo);
                 if(!OS_SUCCESS(status)) {
-                    KdPrint(("Sub-call (2) to UDFResizeExtent() failed (%x)\n", status));
+                    UDFPrint(("Sub-call (2) to UDFResizeExtent() failed (%x)\n", status));
                     return status;
                 }
                 l = ExtInfo->Length;
@@ -2413,7 +2413,7 @@ UDFResizeExtent(
                         TmpExtInf.Mapping = (PEXTENT_MAP)MyAllocatePoolTag__(NonPagedPool , (i+1)*sizeof(EXTENT_MAP),
                                                                            MEM_EXTMAP_TAG);
                         if(!TmpExtInf.Mapping) {
-                            KdPrint(("UDFResizeExtent: !TmpExtInf.Mapping\n"));
+                            UDFPrint(("UDFResizeExtent: !TmpExtInf.Mapping\n"));
                             UDFReleaseResource(&(Vcb->BitMapResource1));
                             return STATUS_INSUFFICIENT_RESOURCES;
                         }
@@ -2506,7 +2506,7 @@ UDFResizeExtent(
                                                    &TmpExtInf,
                                                    ExtInfo->Flags /*& EXTENT_FLAG_ALLOC_MASK*/);
                 if(!OS_SUCCESS(status)) {
-                    KdPrint(("UDFResizeExtent: UDFAllocFreeExtent() failed (%x)\n", status));
+                    UDFPrint(("UDFResizeExtent: UDFAllocFreeExtent() failed (%x)\n", status));
                     return status;
                 }
                 ExtInfo->Mapping = UDFMergeMappings(ExtInfo->Mapping, TmpExtInf.Mapping);
index 2132ed3..7ad9d6a 100644 (file)
@@ -105,7 +105,7 @@ UDFPrepareXSpaceBitmap(
                UDFPartStart(Vcb, PartNum), UDFPartEnd(Vcb, PartNum), XSBMExtInfo, EXTENT_FLAG_ALLOC_SEQUENTIAL) ))
             return status;
         if(XSBMExtInfo->Mapping[1].extLength) {
-            KdPrint(("Can't allocate space for Freed Space bitmap\n"));
+            UDFPrint(("Can't allocate space for Freed Space bitmap\n"));
             *XSl = 0;
         } else {
             *XSl = (uint32)(XSBMExtInfo->Length);
@@ -230,7 +230,7 @@ UDFUpdateXSpaceBitmaps(
             status  = UDFWriteExtent(Vcb, &USBMExtInfo, sizeof(SPACE_BITMAP_DESC), USl, FALSE, new_bm, &WrittenBytes);
 #ifdef UDF_DBG
         } else {
-            KdPrint(("Can't update USBM\n"));
+            UDFPrint(("Can't update USBM\n"));
 #endif // UDF_DBG
         }
         if(USBMExtInfo.Mapping) MyFreePool__(USBMExtInfo.Mapping);
@@ -240,7 +240,7 @@ UDFUpdateXSpaceBitmaps(
             status2 = UDFWriteExtent(Vcb, &FSBMExtInfo, sizeof(SPACE_BITMAP_DESC), FSl, FALSE, new_bm, &WrittenBytes);
         } else {
             status2 = status;
-            KdPrint(("Can't update FSBM\n"));
+            UDFPrint(("Can't update FSBM\n"));
         }
         if(FSBMExtInfo.Mapping) MyFreePool__(FSBMExtInfo.Mapping);
     } else {
@@ -318,11 +318,11 @@ UDFUpdatePartDesc(
 #ifdef UDF_DBG
             if(phd->unallocatedSpaceTable.extLength) {
                 // rebuild unallocatedSpaceTable
-                KdPrint(("unallocatedSpaceTable (part %d)\n", i));
+                UDFPrint(("unallocatedSpaceTable (part %d)\n", i));
             }
             if(phd->freedSpaceTable.extLength) {
                 // rebuild freedSpaceTable
-                KdPrint(("freedSpaceTable (part %d)\n", i));
+                UDFPrint(("freedSpaceTable (part %d)\n", i));
             }
 #endif // UDF_DBG
             UDFUpdateXSpaceBitmaps(Vcb, p->partitionNumber, phd);
@@ -381,7 +381,7 @@ UDFUpdateLogicalVolInt(
         return STATUS_UNSUCCESSFUL;
     }
 
-    KdPrint(("UDF: Updating LVID @%x (%x)\n", Vcb->LVid_loc.extLocation, Vcb->LVid_loc.extLength));
+    UDFPrint(("UDF: Updating LVID @%x (%x)\n", Vcb->LVid_loc.extLocation, Vcb->LVid_loc.extLength));
     len = max(Vcb->LVid_loc.extLength, Vcb->BlockSize);
     lvid = Vcb->LVid;
     if(lvid->descTag.tagSerialNum > UDF_LVID_TTL) {
@@ -409,10 +409,10 @@ UDFUpdateLogicalVolInt(
 #endif
 
     if(Close){
-        KdPrint(("UDF: Opening LVID\n"));
+        UDFPrint(("UDF: Opening LVID\n"));
         lvid->integrityType = INTEGRITY_TYPE_CLOSE;
     } else {
-        KdPrint(("UDF: Closing LVID\n"));
+        UDFPrint(("UDF: Closing LVID\n"));
         lvid->integrityType = INTEGRITY_TYPE_OPEN;
     }
 
@@ -432,7 +432,7 @@ UDFUpdateLogicalVolInt(
     LVID_hd->uniqueID = Vcb->NextUniqueId;
 
     if(equal) {
-        KdPrint(("UDF: equal Ids\n"));
+        UDFPrint(("UDF: equal Ids\n"));
         return STATUS_SUCCESS;
     }
 
@@ -474,7 +474,7 @@ UDFUpdateSparingTable(
 //    BOOLEAN merged;
     BOOLEAN sorted;
 
-    KdPrint(("UDF: Updating Sparable Part Map:\n"));
+    UDFPrint(("UDF: Updating Sparable Part Map:\n"));
     if(!Vcb->SparingTableModified) return STATUS_SUCCESS;
     if(!Vcb->SparingTable) return STATUS_SUCCESS;
 
@@ -505,13 +505,13 @@ swp_loc:
     } while(sorted);
 
     for(i=0;i<Vcb->SparingCount;i++) {
-        KdPrint(("  @%x -> %x \n", 
+        UDFPrint(("  @%x -> %x \n", 
             RelocMap[i].origLocation, RelocMap[i].mappedLocation));
     }
 
     Vcb->SparingTableModified = FALSE;
 //    if(!merged) {
-//        KdPrint(("  sparing table unchanged\n"));
+//        UDFPrint(("  sparing table unchanged\n"));
 //        MyFreePool__(SparTable);
 //        return STATUS_SUCCESS;
 //    }
@@ -519,7 +519,7 @@ swp_loc:
     // walk through all available Sparing Tables
     for(i=0;i<Vcb->SparingTableCount;i++) {
         // read (next) table
-        KdPrint(("  sparing table @%x\n", Vcb->SparingTableLoc[i]));
+        UDFPrint(("  sparing table @%x\n", Vcb->SparingTableLoc[i]));
         status = UDFReadSectors(Vcb, FALSE, Vcb->SparingTableLoc[i], 1, FALSE, (int8*)SparTable, &ReadBytes);
         // tag should be set to TID_UNUSED_DESC
         if(OS_SUCCESS(status) && (SparTable->descTag.tagIdent == TID_UNUSED_DESC)) {
@@ -529,7 +529,7 @@ swp_loc:
                     Vcb->BlockSize-1) 
                                       >> Vcb->BlockSizeBits);
             if(BC2 > BC) {
-                KdPrint((" sizeSparingTable @%x too long: %x > %x\n", 
+                UDFPrint((" sizeSparingTable @%x too long: %x > %x\n", 
                     Vcb->SparingTableLoc[i], BC2, BC
                     ));
                 continue;
@@ -538,7 +538,7 @@ swp_loc:
                 BC2, FALSE, (int8*)SparTable, &ReadBytes);
         
             if(!OS_SUCCESS(status)) {
-                KdPrint((" Error reading sizeSparingTable @%x (%x)\n", 
+                UDFPrint((" Error reading sizeSparingTable @%x (%x)\n", 
                     Vcb->SparingTableLoc[i], BC2
                     ));
                 continue;
@@ -549,7 +549,7 @@ swp_loc:
                     Vcb->BlockSize-1) 
                                       >> Vcb->BlockSizeBits);
             if(BC2 > BC) {
-                KdPrint((" new sizeSparingTable @%x too long: %x > %x\n", 
+                UDFPrint((" new sizeSparingTable @%x too long: %x > %x\n", 
                     Vcb->SparingTableLoc[i], BC2, BC
                     ));
                 continue;
@@ -564,7 +564,7 @@ swp_loc:
                 for(m=0; m<Vcb->SparingCount; m++) {
                     if(RelocMap[m].mappedLocation == NewRelocMap[n].mappedLocation) {
                         if(RelocMap[m].origLocation != NewRelocMap[n].origLocation) {
-                            KdPrint(("  update @%x (%x) -> @%x (%x)\n", 
+                            UDFPrint(("  update @%x (%x) -> @%x (%x)\n", 
                                 NewRelocMap[m].origLocation, NewRelocMap[m].mappedLocation,
                                 RelocMap[m].origLocation, RelocMap[m].mappedLocation));
                             merged = TRUE;
@@ -574,7 +574,7 @@ swp_loc:
             }
 */
 //            if(merged) {
-            KdPrint(("UDF: record updated\n"));
+            UDFPrint(("UDF: record updated\n"));
             status = UDFWriteSectors(Vcb, FALSE, Vcb->SparingTableLoc[i], BC2, FALSE, (int8*)SparTable, &ReadBytes);
             if(!OS_SUCCESS(status)) {
                 if(!OS_SUCCESS(status2)) {
@@ -622,7 +622,7 @@ UDFUpdateLogicalVol(
         goto Err_SetVI;
     }
 
-    KdPrint(("UDF: Updating LVD @%x (%x)\n", Lba.block, Vcb->BlockSize));
+    UDFPrint(("UDF: Updating LVD @%x (%x)\n", Lba.block, Vcb->BlockSize));
 
     status = UDFSetDstring(&(Vcb->VolIdent), (dstring*)&CS0, CUR_IDENT_SZ);
     if(!OS_SUCCESS(status)) {
@@ -645,7 +645,7 @@ UDFUpdateLogicalVol(
 
     if(RtlCompareMemory(lvd->logicalVolIdent, CS0, CUR_IDENT_SZ) == CUR_IDENT_SZ) {
         // no changes
-        KdPrint(("UDF: equal VolIds\n"));
+        UDFPrint(("UDF: equal VolIds\n"));
         status = STATUS_SUCCESS;
         goto Err_SetVI;
     }
@@ -813,7 +813,7 @@ UDFUpdateVolIdent(
 
     if(!pvoldesc) return STATUS_INSUFFICIENT_RESOURCES;
 
-    KdPrint(("UDF: Updating PVD @%x (%x)\n", Lba.block, Vcb->BlockSize));
+    UDFPrint(("UDF: Updating PVD @%x (%x)\n", Lba.block, Vcb->BlockSize));
 
     status = UDFSetDstring(&(Vcb->VolIdent), (dstring*)&CS0, CUR_IDENT_SZ);
     if(!OS_SUCCESS(status)) {
@@ -866,7 +866,7 @@ UDFUpdateNonAllocated(
     PEXTENT_MAP Map = NULL;
     PEXTENT_INFO DataLoc;
 
-    KdPrint(("UDFUpdateNonAllocated:\n"));
+    UDFPrint(("UDFUpdateNonAllocated:\n"));
     if(!Vcb->NonAllocFileInfo) {
         return STATUS_SUCCESS;
     }
@@ -877,7 +877,7 @@ UDFUpdateNonAllocated(
     DataLoc = &(Vcb->NonAllocFileInfo->Dloc->DataLoc);
     ASSERT(!DataLoc->Offset);
     if(Vcb->NonAllocFileInfo->Dloc->DataLoc.Offset) {
-        KdPrint(("NonAllocFileInfo in IN_ICB mode !!!\n"));
+        UDFPrint(("NonAllocFileInfo in IN_ICB mode !!!\n"));
         return STATUS_SUCCESS;
     }
     PartNum = UDFGetPartNumByPhysLba(Vcb, Vcb->NonAllocFileInfo->Dloc->FELoc.Mapping[0].extLocation);
@@ -892,10 +892,10 @@ UDFUpdateNonAllocated(
         // add BAD blocks to unallocatable space
         // if the block is already in NonAllocatable, ignore it
         if(UDFLocateLbaInExtent(Vcb, DataLoc->Mapping, i) != LBA_OUT_OF_EXTENT) {
-            KdPrint(("lba %#x is already in NonAllocFileInfo\n", i));
+            UDFPrint(("lba %#x is already in NonAllocFileInfo\n", i));
             continue;
         }
-        KdPrint(("add lba %#x to NonAllocFileInfo\n", i));
+        UDFPrint(("add lba %#x to NonAllocFileInfo\n", i));
         DataLoc->Modified = TRUE;
         Ext.extLength = Vcb->LBlockSize;
         // align lba on LogicalBlock boundary
@@ -910,7 +910,7 @@ UDFUpdateNonAllocated(
     // ensure that BAD space is marked as USED
     UDFMarkSpaceAsXXX(Vcb, 0, &(DataLoc->Mapping[0]), AS_USED); // mark as used
 
-    KdPrint(("UDFUpdateNonAllocated: done\n"));
+    UDFPrint(("UDFUpdateNonAllocated: done\n"));
     return STATUS_SUCCESS;
 } // end UDFUpdateNonAllocated()
 
@@ -942,7 +942,7 @@ UDFUmount__(
     UDFFlushAllCachedAllocations(Vcb, UDF_PREALLOC_CLASS_DIR);
 
     if(Vcb->VerifyOnWrite) {
-        KdPrint(("UDF: Flushing cache for verify\n"));
+        UDFPrint(("UDF: Flushing cache for verify\n"));
         //WCacheFlushAll__(&(Vcb->FastCache), Vcb);
         WCacheFlushBlocks__(&(Vcb->FastCache), Vcb, 0, Vcb->LastLBA);
         UDFVFlush(Vcb);
@@ -956,9 +956,9 @@ UDFUmount__(
     // RAM mode
 #ifdef UDF_DBG
     if(!OS_SUCCESS(UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr, &(Vcb->VolIdent))))
-        KdPrint(("Error updating VolIdent (1)\n"));
+        UDFPrint(("Error updating VolIdent (1)\n"));
     if(!OS_SUCCESS(UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr2, &(Vcb->VolIdent))))
-        KdPrint(("Error updating VolIdent (2)\n"));
+        UDFPrint(("Error updating VolIdent (2)\n"));
 #else
     UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr, &(Vcb->VolIdent));
     UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr2, &(Vcb->VolIdent));
@@ -974,9 +974,9 @@ UDFUmount__(
 
 #ifdef UDF_DBG
     if(!OS_SUCCESS(UDFUpdateVDS(Vcb, Vcb->VDS1, Vcb->VDS1 + Vcb->VDS1_Len, flags)))
-        KdPrint(("Error updating Main VDS\n"));
+        UDFPrint(("Error updating Main VDS\n"));
     if(!OS_SUCCESS(UDFUpdateVDS(Vcb, Vcb->VDS2, Vcb->VDS2 + Vcb->VDS2_Len, flags)))
-        KdPrint(("Error updating Reserve VDS\n"));
+        UDFPrint(("Error updating Reserve VDS\n"));
 #else
     UDFUpdateVDS(Vcb, Vcb->VDS1, Vcb->VDS1 + Vcb->VDS1_Len, flags);
     UDFUpdateVDS(Vcb, Vcb->VDS2, Vcb->VDS2 + Vcb->VDS2_Len, flags);
@@ -1024,7 +1024,7 @@ UDFFindAnchor(
     if(!Buf)
         return 0;
 
-    KdPrint(("UDFFindAnchor\n"));
+    UDFPrint(("UDFFindAnchor\n"));
     // init probable locations...
     RtlZeroMemory(&(Vcb->Anchor), sizeof(Vcb->Anchor));
     Vcb->Anchor[0] = 256 + Vcb->FirstLBALastSes;
@@ -1049,7 +1049,7 @@ UDFFindAnchor(
             Vcb->Anchor[i] = 0;
         MRW_candidate = FALSE;
         if(Vcb->Anchor[i]) {
-            KdPrint(("check Anchor %x\n", Vcb->Anchor[i]));
+            UDFPrint(("check Anchor %x\n", Vcb->Anchor[i]));
             if(!OS_SUCCESS(status = UDFReadTagged(Vcb,Buf,
                 Vcb->Anchor[i], Vcb->Anchor[i], &ident))) {
 
@@ -1059,7 +1059,7 @@ UDFFindAnchor(
                     if(OS_SUCCESS(status = UDFReadTagged(Vcb,Buf,
                         Vcb->Anchor[i]+MRW_DMA_OFFSET, Vcb->Anchor[i], &ident))) {
                         // do MRW workaround.....
-                        KdPrint(("UDF: looks like we have MRW....\n"));
+                        UDFPrint(("UDF: looks like we have MRW....\n"));
                         MRW_candidate = TRUE;
                         goto MRW_workaround;
                     }
@@ -1067,7 +1067,7 @@ UDFFindAnchor(
 
                 Vcb->Anchor[i] = 0;
                 if(status == STATUS_NONEXISTENT_SECTOR) {
-                    KdPrint(("UDF: disk seems to be incomplete\n"));
+                    UDFPrint(("UDF: disk seems to be incomplete\n"));
                     break;
                 }
             } else {
@@ -1076,16 +1076,16 @@ MRW_workaround:
                     (ident != TID_FILE_ENTRY && ident != TID_EXTENDED_FILE_ENTRY))) {
                     Vcb->Anchor[i] = 0;
                 } else {
-                    KdPrint(("UDF: Found AVD at %x (point %d)\n",Vcb->Anchor[i], i));
+                    UDFPrint(("UDF: Found AVD at %x (point %d)\n",Vcb->Anchor[i], i));
                     if(!LastBlock)
                         LastBlock = Vcb->LastLBA;
                     if(MRW_candidate) {
-                        KdPrint(("UDF: looks like we _*really*_ have MRW....\n"));
+                        UDFPrint(("UDF: looks like we _*really*_ have MRW....\n"));
                         IsMRW = TRUE;
                         ASSERT(Vcb->LastReadTrack == 1);
                         Vcb->TrackMap[Vcb->LastReadTrack].Flags |= TrackMap_FixMRWAddressing;
                         WCachePurgeAll__(&(Vcb->FastCache), Vcb);
-                        KdPrint(("UDF: MRW on non-MRW drive => ReadOnly"));
+                        UDFPrint(("UDF: MRW on non-MRW drive => ReadOnly"));
                         Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
 
                         UDFRegisterFsStructure(Vcb, Vcb->Anchor[i], Vcb->BlockSize);
@@ -1096,7 +1096,7 @@ MRW_workaround:
         }
     }
 
-    KdPrint(("UDF: -----------------\nUDF: Last block %x\n",LastBlock));
+    UDFPrint(("UDF: -----------------\nUDF: Last block %x\n",LastBlock));
     MyFreePool__(Buf);
     return LastBlock;
 } // end UDFFindAnchor()
@@ -1121,7 +1121,7 @@ UDFFindVRS(
     // Relative to First LBA in Last Session
     offset = Vcb->FirstLBA + 0x10;
 
-    KdPrint(("UDFFindVRS:\n"));
+    UDFPrint(("UDFFindVRS:\n"));
 
     // Process the sequence (if applicable)
     for (;(offset-BeginOffset <=0x20); offset ++) {
@@ -1139,44 +1139,44 @@ UDFFindVRS(
                 switch (vsd->structType)
                 {
                     case 0:
-                        KdPrint(("UDF: ISO9660 Boot Record found\n"));
+                        UDFPrint(("UDF: ISO9660 Boot Record found\n"));
                         break;
                     case 1:
-                        KdPrint(("UDF: ISO9660 Primary Volume Descriptor found\n"));
+                        UDFPrint(("UDF: ISO9660 Primary Volume Descriptor found\n"));
                         break;
                     case 2:
-                        KdPrint(("UDF: ISO9660 Supplementary Volume Descriptor found\n"));
+                        UDFPrint(("UDF: ISO9660 Supplementary Volume Descriptor found\n"));
                         break;
                     case 3:
-                        KdPrint(("UDF: ISO9660 Volume Partition Descriptor found\n"));
+                        UDFPrint(("UDF: ISO9660 Volume Partition Descriptor found\n"));
                         break;
                     case 255:
-                        KdPrint(("UDF: ISO9660 Volume Descriptor Set Terminator found\n"));
+                        UDFPrint(("UDF: ISO9660 Volume Descriptor Set Terminator found\n"));
                         break;
                     default:
-                        KdPrint(("UDF: ISO9660 VRS (%u) found\n", vsd->structType));
+                        UDFPrint(("UDF: ISO9660 VRS (%u) found\n", vsd->structType));
                         break;
                 }
             }
             else if(!strncmp((int8*)(&vsd->stdIdent), STD_ID_BEA01, STD_ID_LEN))
             {
-                KdPrint(("UDF: BEA01 Found\n"));
+                UDFPrint(("UDF: BEA01 Found\n"));
             }
             else if(!strncmp((int8*)(&vsd->stdIdent), STD_ID_TEA01, STD_ID_LEN))
             {
-                KdPrint(("UDF: TEA01 Found\n"));
+                UDFPrint(("UDF: TEA01 Found\n"));
                 break;
             }
             else if(!strncmp((int8*)(&vsd->stdIdent), STD_ID_NSR02, STD_ID_LEN))
             {
                 retStat |= VRS_NSR02_FOUND;
-                KdPrint(("UDF: NSR02 Found\n"));
+                UDFPrint(("UDF: NSR02 Found\n"));
                 break;
             }
             else if(!strncmp((int8*)(&vsd->stdIdent), STD_ID_NSR03, STD_ID_LEN))
             {
                 retStat |= VRS_NSR03_FOUND;
-                KdPrint(("UDF: NSR03 Found\n"));
+                UDFPrint(("UDF: NSR03 Found\n"));
                 break;
             }
         }
@@ -1200,9 +1200,9 @@ UDFLoadPVolDesc(
 //    OSSTATUS    RC = STATUS_SUCCESS;
 
     pvoldesc = (PrimaryVolDesc *)Buf;
-    KdPrint(("UDF: PrimaryVolDesc:\n"));
-    KdPrint(("volDescSeqNum     = %d\n", pvoldesc->volDescSeqNum));
-    KdPrint(("primaryVolDescNum = %d\n", pvoldesc->primaryVolDescNum));
+    UDFPrint(("UDF: PrimaryVolDesc:\n"));
+    UDFPrint(("volDescSeqNum     = %d\n", pvoldesc->volDescSeqNum));
+    UDFPrint(("primaryVolDescNum = %d\n", pvoldesc->primaryVolDescNum));
     // remember recording time...
     Vcb->VolCreationTime = UDFTimeToNT(&(pvoldesc->recordingDateAndTime));
     // ...VolIdent...
@@ -1212,22 +1212,22 @@ UDFLoadPVolDesc(
     }
     UDFGetDstring(&(Vcb->VolIdent), (dstring*)&(pvoldesc->volIdent), CUR_IDENT_SZ);
 #undef CUR_IDENT_SZ
-    KdPrint(("volIdent[] = '%ws'\n", Vcb->VolIdent.Buffer));
+    UDFPrint(("volIdent[] = '%ws'\n", Vcb->VolIdent.Buffer));
 #ifdef UDF_DBG
-    KdPrint(("volSeqNum         = %d\n", pvoldesc->volSeqNum));
-    KdPrint(("maxVolSeqNum      = %d\n", pvoldesc->maxVolSeqNum));
-    KdPrint(("interchangeLvl    = %d\n", pvoldesc->interchangeLvl));
-    KdPrint(("maxInterchangeLvl = %d\n", pvoldesc->maxInterchangeLvl));
-    KdPrint(("charSetList       = %d\n", pvoldesc->charSetList));
-    KdPrint(("maxCharSetList    = %d\n", pvoldesc->maxCharSetList));
+    UDFPrint(("volSeqNum         = %d\n", pvoldesc->volSeqNum));
+    UDFPrint(("maxVolSeqNum      = %d\n", pvoldesc->maxVolSeqNum));
+    UDFPrint(("interchangeLvl    = %d\n", pvoldesc->interchangeLvl));
+    UDFPrint(("maxInterchangeLvl = %d\n", pvoldesc->maxInterchangeLvl));
+    UDFPrint(("charSetList       = %d\n", pvoldesc->charSetList));
+    UDFPrint(("maxCharSetList    = %d\n", pvoldesc->maxCharSetList));
     // ...& just print VolSetIdent
     UNICODE_STRING      instr;
 #define CUR_IDENT_SZ (sizeof(pvoldesc->volSetIdent))
     UDFGetDstring(&instr, (dstring*)&(pvoldesc->volSetIdent), CUR_IDENT_SZ);
 #undef CUR_IDENT_SZ
-    KdPrint(("volSetIdent[] = '%ws'\n", instr.Buffer));
-//    KdPrint(("maxInterchangeLvl = %d\n", pvoldesc->maxInterchangeLvl));
-    KdPrint(("flags             = %x\n", pvoldesc->flags));
+    UDFPrint(("volSetIdent[] = '%ws'\n", instr.Buffer));
+//    UDFPrint(("maxInterchangeLvl = %d\n", pvoldesc->maxInterchangeLvl));
+    UDFPrint(("flags             = %x\n", pvoldesc->flags));
     if(instr.Buffer) MyFreePool__(instr.Buffer);
 #endif // UDF_DBG
 } // end UDFLoadPVolDesc()
@@ -1260,7 +1260,7 @@ UDFLoadLogicalVolInt(
     }
     // walk through all sectors inside LogicalVolumeIntegrityDesc
     while(loc.extLength) {
-        KdPrint(("UDF: Reading LVID @%x (%x)\n", loc.extLocation, loc.extLength));
+        UDFPrint(("UDF: Reading LVID @%x (%x)\n", loc.extLocation, loc.extLength));
         len = max(loc.extLength, Vcb->BlockSize);
         Buf = (int8*)MyAllocatePool__(NonPagedPool,len);
         if(!Buf)
@@ -1268,22 +1268,22 @@ UDFLoadLogicalVolInt(
         RC = UDFReadTagged(Vcb,Buf, loc.extLocation, loc.extLocation, &ident);
         if(!OS_SUCCESS(RC)) {
 exit_with_err:
-            KdPrint(("UDF: Reading LVID @%x (%x) failed.\n", loc.extLocation, loc.extLength));
+            UDFPrint(("UDF: Reading LVID @%x (%x) failed.\n", loc.extLocation, loc.extLength));
             switch(Vcb->PartitialDamagedVolumeAction) {
             case UDF_PART_DAMAGED_RO:
-                KdPrint(("UDF: Switch to r/o mode.\n"));
+                UDFPrint(("UDF: Switch to r/o mode.\n"));
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
                 Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_MEDIA_DEFECT_RO;
                 RC = STATUS_SUCCESS;
                 break;
             case UDF_PART_DAMAGED_NO:
-                KdPrint(("UDF: Switch to raw mount mode, return UNRECOGNIZED_VOLUME.\n"));
+                UDFPrint(("UDF: Switch to raw mount mode, return UNRECOGNIZED_VOLUME.\n"));
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_RAW_DISK;
                 //RC = STATUS_WRONG_VOLUME;
                 break;
             case UDF_PART_DAMAGED_RW:
             default:
-                KdPrint(("UDF: Keep r/w mode for your own risk.\n"));
+                UDFPrint(("UDF: Keep r/w mode for your own risk.\n"));
                 RC = STATUS_SUCCESS;
                 // asume we have INTEGRITY_TYPE_CLOSE
                 Vcb->IntegrityType = INTEGRITY_TYPE_CLOSE;
@@ -1331,11 +1331,11 @@ exit_with_err:
 
         LVID_iUse = UDFGetLVIDiUse(Vcb);
 
-        KdPrint(("UDF: Last LVID:\n"));
-        KdPrint(("     minR: %x\n",LVID_iUse->minUDFReadRev ));
-        KdPrint(("     minW: %x\n",LVID_iUse->minUDFWriteRev));
-        KdPrint(("     maxW: %x\n",LVID_iUse->maxUDFWriteRev));
-        KdPrint(("     Type: %s\n",!Vcb->IntegrityType ? "Open" : "Close"));
+        UDFPrint(("UDF: Last LVID:\n"));
+        UDFPrint(("     minR: %x\n",LVID_iUse->minUDFReadRev ));
+        UDFPrint(("     minW: %x\n",LVID_iUse->minUDFWriteRev));
+        UDFPrint(("     maxW: %x\n",LVID_iUse->maxUDFWriteRev));
+        UDFPrint(("     Type: %s\n",!Vcb->IntegrityType ? "Open" : "Close"));
 
         Vcb->minUDFReadRev  = LVID_iUse->minUDFReadRev;
         Vcb->minUDFWriteRev = LVID_iUse->minUDFWriteRev;
@@ -1343,22 +1343,22 @@ exit_with_err:
 
         Vcb->numFiles = LVID_iUse->numFiles;
         Vcb->numDirs  = LVID_iUse->numDirs;
-        KdPrint(("     nFiles: %x\n",Vcb->numFiles ));
-        KdPrint(("     nDirs: %x\n",Vcb->numDirs ));
+        UDFPrint(("     nFiles: %x\n",Vcb->numFiles ));
+        UDFPrint(("     nDirs: %x\n",Vcb->numDirs ));
 
         // Check if we can understand this format
         if(Vcb->minUDFReadRev > UDF_MAX_READ_REVISION)
             RC = STATUS_UNRECOGNIZED_VOLUME;
         // Check if we know how to write here
         if(Vcb->minUDFWriteRev > UDF_MAX_WRITE_REVISION) {
-            KdPrint(("     Target FS requires: %x Revision => ReadOnly\n",Vcb->minUDFWriteRev));
+            UDFPrint(("     Target FS requires: %x Revision => ReadOnly\n",Vcb->minUDFWriteRev));
             Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
             Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_NEW_FS_RO;
         }
 
         LVID_hd = (LogicalVolHeaderDesc*)&(Vcb->LVid->logicalVolContentsUse);
         Vcb->NextUniqueId = LVID_hd->uniqueID;
-        KdPrint(("     Next FID: %x\n",Vcb->NextUniqueId));
+        UDFPrint(("     Next FID: %x\n",Vcb->NextUniqueId));
 
         break;
     }
@@ -1382,7 +1382,7 @@ UDFLoadLogicalVol(
     uint16 i, offset;
     uint8 type;
     OSSTATUS status = STATUS_SUCCESS;
-    KdPrint(("UDF: LogicalVolDesc\n"));
+    UDFPrint(("UDF: LogicalVolDesc\n"));
     // Validate partition map counter
     if(!(Vcb->Partitions)) {
         Vcb->PartitionMaps = lvd->numPartitionMaps;
@@ -1393,7 +1393,7 @@ UDFLoadLogicalVol(
         if(Vcb->PartitionMaps != lvd->numPartitionMaps)
             return STATUS_DISK_CORRUPT_ERROR;
     }
-    KdPrint(("UDF: volDescSeqNum = %x\n", lvd->volDescSeqNum));
+    UDFPrint(("UDF: volDescSeqNum = %x\n", lvd->volDescSeqNum));
     // Get logical block size (may be different from physical)
     Vcb->LBlockSize = lvd->logicalBlockSize;
     // Get current UDF revision
@@ -1412,13 +1412,13 @@ UDFLoadLogicalVol(
     case 32768: Vcb->LBlockSizeBits = 15; break;
     case 65536: Vcb->LBlockSizeBits = 16; break;
     default:
-        KdPrint(("UDF: Bad block size (%ld)\n", Vcb->LBlockSize));
+        UDFPrint(("UDF: Bad block size (%ld)\n", Vcb->LBlockSize));
         return STATUS_DISK_CORRUPT_ERROR;
     }
-    KdPrint(("UDF: logical block size (%ld)\n", Vcb->LBlockSize));
+    UDFPrint(("UDF: logical block size (%ld)\n", Vcb->LBlockSize));
     Vcb->LB2B_Bits = Vcb->LBlockSizeBits - Vcb->BlockSizeBits;
-    KdPrint(("UDF: mapTableLength = %x\n", lvd->mapTableLength));
-    KdPrint(("UDF: numPartitionMaps = %x\n", lvd->numPartitionMaps));
+    UDFPrint(("UDF: mapTableLength = %x\n", lvd->mapTableLength));
+    UDFPrint(("UDF: numPartitionMaps = %x\n", lvd->numPartitionMaps));
     // walk through all available part maps
     for (i=0,offset=0;
          i<Vcb->PartitionMaps && offset<lvd->mapTableLength;
@@ -1426,7 +1426,7 @@ UDFLoadLogicalVol(
     {
         GenericPartitionMap* gpm = (GenericPartitionMap *)(((uint8*)(lvd+1))+offset);
         type = gpm->partitionMapType;
-        KdPrint(("Partition (%d) type %x, len %x\n", i, type, gpm->partitionMapLength));
+        UDFPrint(("Partition (%d) type %x, len %x\n", i, type, gpm->partitionMapLength));
         if(type == PARTITION_MAP_TYPE_1)
         {
             GenericPartitionMap1 *gpm1 = (GenericPartitionMap1 *)(((uint8*)(lvd+1))+offset);
@@ -1446,35 +1446,35 @@ UDFLoadLogicalVol(
 
                 if( (udfis->currentRev == 0x0150)/* ||
                     (Vcb->CurrentUDFRev == 0x0150)*/ ) {
-                    KdPrint(("Found VAT 1.50\n"));
+                    UDFPrint(("Found VAT 1.50\n"));
                     Vcb->Partitions[i].PartitionType = UDF_VIRTUAL_MAP15;
                 } else
                 if( (udfis->currentRev == 0x0200) ||
                     (udfis->currentRev == 0x0201) /*||
                     (Vcb->CurrentUDFRev == 0x0200) ||
                     (Vcb->CurrentUDFRev == 0x0201)*/ ) {
-                    KdPrint(("Found VAT 2.00\n"));
+                    UDFPrint(("Found VAT 2.00\n"));
                     Vcb->Partitions[i].PartitionType = UDF_VIRTUAL_MAP20;
                 }
                 status = STATUS_SUCCESS;
             }
             else if(!strncmp((int8*)&(upm2->partIdent.ident), UDF_ID_SPARABLE, strlen(UDF_ID_SPARABLE)))
             {
-                KdPrint(("Load sparing table\n"));
+                UDFPrint(("Load sparing table\n"));
                 PSPARABLE_PARTITION_MAP spm = (PSPARABLE_PARTITION_MAP)(((uint8*)(lvd+1))+offset);
                 Vcb->Partitions[i].PartitionType = UDF_SPARABLE_MAP15;
                 status = UDFLoadSparingTable(Vcb, spm);
             }
             else if(!strncmp((int8*)&(upm2->partIdent.ident), UDF_ID_METADATA, strlen(UDF_ID_METADATA)))
             {
-                KdPrint(("Found metadata partition\n"));
+                UDFPrint(("Found metadata partition\n"));
 //                PMETADATA_PARTITION_MAP mpm = (PMETADATA_PARTITION_MAP)(((uint8*)(lvd+1))+offset);
                 Vcb->Partitions[i].PartitionType = UDF_METADATA_MAP25;
                 //status = UDFLoadSparingTable(Vcb, spm);
             }
             else
             {
-                KdPrint(("Unknown ident: %s\n", upm2->partIdent.ident));
+                UDFPrint(("Unknown ident: %s\n", upm2->partIdent.ident));
                 continue;
             }
             Vcb->Partitions[i].VolumeSeqNum = upm2->volSeqNum;
@@ -1486,7 +1486,7 @@ UDFLoadLogicalVol(
         // remember FileSet location
         long_ad *la = (long_ad *)&(lvd->logicalVolContentsUse[0]);
         *fileset = (la->extLocation);
-        KdPrint(("FileSet found in LogicalVolDesc at block=%x, partition=%d\n",
+        UDFPrint(("FileSet found in LogicalVolDesc at block=%x, partition=%d\n",
             fileset->logicalBlockNum,
             fileset->partitionReferenceNum));
     }
@@ -1507,7 +1507,7 @@ UDFLoadBogusLogicalVol(
     )
 {
 //    LogicalVolDesc *lvd = (LogicalVolDesc *)Buf;
-    KdPrint(("UDF: Bogus LogicalVolDesc\n"));
+    UDFPrint(("UDF: Bogus LogicalVolDesc\n"));
     // Validate partition map counter
     if(!(Vcb->Partitions)) {
         Vcb->PartitionMaps = 1;
@@ -1518,7 +1518,7 @@ UDFLoadBogusLogicalVol(
         if(Vcb->PartitionMaps != 1)
             return STATUS_DISK_CORRUPT_ERROR;
     }
-    KdPrint(("UDF: volDescSeqNum = %x\n", 0));
+    UDFPrint(("UDF: volDescSeqNum = %x\n", 0));
     // Get logical block size (may be different from physical)
     Vcb->LBlockSize = 2048;
     // Get current UDF revision
@@ -1528,10 +1528,10 @@ UDFLoadBogusLogicalVol(
     if(Vcb->LBlockSize < Vcb->BlockSize)
         return STATUS_DISK_CORRUPT_ERROR;
     Vcb->LBlockSizeBits = 11;
-    KdPrint(("UDF: logical block size (%ld)\n", Vcb->LBlockSize));
+    UDFPrint(("UDF: logical block size (%ld)\n", Vcb->LBlockSize));
     Vcb->LB2B_Bits = Vcb->LBlockSizeBits - Vcb->BlockSizeBits;
-    KdPrint(("UDF: mapTableLength = %x\n", 0));
-    KdPrint(("UDF: numPartitionMaps = %x\n", 0));
+    UDFPrint(("UDF: mapTableLength = %x\n", 0));
+    UDFPrint(("UDF: numPartitionMaps = %x\n", 0));
 
 // if(CDRW) {
 
@@ -1541,10 +1541,10 @@ UDFLoadBogusLogicalVol(
 
 /* } else if(CDR)
                 if()
-                    KdPrint(("Found VAT 1.50\n"));
+                    UDFPrint(("Found VAT 1.50\n"));
                     Vcb->Partitions[i].PartitionType = UDF_VIRTUAL_MAP15;
                 } else
-                    KdPrint(("Found VAT 2.00\n"));
+                    UDFPrint(("Found VAT 2.00\n"));
                     Vcb->Partitions[i].PartitionType = UDF_VIRTUAL_MAP20;
                 }
             }
@@ -1555,7 +1555,7 @@ UDFLoadBogusLogicalVol(
 //        long_ad *la = (long_ad *)&(lvd->logicalVolContentsUse[0]);
         fileset->logicalBlockNum = 0;
         fileset->partitionReferenceNum = 0;
-        KdPrint(("FileSet found in LogicalVolDesc at block=%x, partition=%d\n",
+        UDFPrint(("FileSet found in LogicalVolDesc at block=%x, partition=%d\n",
             fileset->logicalBlockNum,
             fileset->partitionReferenceNum));
     }
@@ -1585,7 +1585,7 @@ UDFAddXSpaceBitmap(
     BOOLEAN bit_set;
 
     UDF_CHECK_BITMAP_RESOURCE(Vcb);
-    KdPrint(("UDFAddXSpaceBitmap: at block=%x, partition=%d\n",
+    UDFPrint(("UDFAddXSpaceBitmap: at block=%x, partition=%d\n",
         bm->extPosition,
         PartNum));
 
@@ -1685,7 +1685,7 @@ UDFVerifyXSpaceBitmap(
 
     UDF_CHECK_BITMAP_RESOURCE(Vcb);
 
-    KdPrint((" UDFVerifyXSpaceBitmap: part %x\n", PartNum));
+    UDFPrint((" UDFVerifyXSpaceBitmap: part %x\n", PartNum));
 
     if(!(Length = (bm->extLength & UDF_EXTENT_LENGTH_MASK))) return STATUS_SUCCESS;
 //    i=UDFPartStart(Vcb, PartNum);
@@ -1702,7 +1702,7 @@ err_vfyxsbm_1:
             DbgFreePool(tmp);
             return status;
         }
-        KdPrint((" BM Lba %x\n", lba));
+        UDFPrint((" BM Lba %x\n", lba));
         if(Ident != TID_SPACE_BITMAP_DESC) {
             status = STATUS_DISK_CORRUPT_ERROR;
             goto err_vfyxsbm_1;
@@ -1835,7 +1835,7 @@ UDFVerifyFreeSpaceBitmap(
 
     PartNum = UDFGetPartNumByPartNdx(Vcb, PartNdx);
 
-    KdPrint(("UDFVerifyFreeSpaceBitmap:\n"));
+    UDFPrint(("UDFVerifyFreeSpaceBitmap:\n"));
     // read info for partition header (if any)
     if(phd) {
         // read unallocated Bitmap
@@ -1847,7 +1847,7 @@ UDFVerifyFreeSpaceBitmap(
     }
     // read UnallocatedSpaceDesc & convert to Bitmap
     if(Lba) {
-        KdPrint((" Lba @%x\n", Lba));
+        UDFPrint((" Lba @%x\n", Lba));
         if(!(AllocDesc = (int8*)MyAllocatePool__(NonPagedPool, Vcb->LBlockSize + sizeof(EXTENT_AD) )))
             return STATUS_INSUFFICIENT_RESOURCES;
         RtlZeroMemory(((int8*)AllocDesc) + Vcb->LBlockSize, sizeof(EXTENT_AD));
@@ -1889,7 +1889,7 @@ UDFVerifyFreeSpaceBitmap(
                     Extent = UDFMergeMappings(Extent, (PEXTENT_MAP)(AllocDesc+sizeof(UNALLOC_SPACE_DESC)) );
 #ifdef UDF_DBG
                 } else {
-                    KdPrint(("Broken unallocated space descriptor sequence\n"));
+                    UDFPrint(("Broken unallocated space descriptor sequence\n"));
 #endif // UDF_DBG
                 }
             }
@@ -2004,7 +2004,7 @@ free_fsbm:
                     Extent = UDFMergeMappings(Extent, (PEXTENT_MAP)(AllocDesc+sizeof(UNALLOC_SPACE_DESC)) );
 #ifdef UDF_DBG
                 } else {
-                    KdPrint(("Broken unallocated space descriptor sequence\n"));
+                    UDFPrint(("Broken unallocated space descriptor sequence\n"));
 #endif // UDF_DBG
                 }
             }
@@ -2029,17 +2029,17 @@ UDFLoadPartDesc(
     uint32 i;
     OSSTATUS RC;
     BOOLEAN Found = FALSE;
-    KdPrint(("UDF: Pard Descr:\n"));
-    KdPrint((" volDescSeqNum   = %x\n", p->volDescSeqNum));
-    KdPrint((" partitionFlags  = %x\n", p->partitionFlags));
-    KdPrint((" partitionNumber = %x\n", p->partitionNumber));
-    KdPrint((" accessType      = %x\n", p->accessType));
-    KdPrint((" partitionStartingLocation = %x\n", p->partitionStartingLocation));
-    KdPrint((" partitionLength = %x\n", p->partitionLength));
+    UDFPrint(("UDF: Pard Descr:\n"));
+    UDFPrint((" volDescSeqNum   = %x\n", p->volDescSeqNum));
+    UDFPrint((" partitionFlags  = %x\n", p->partitionFlags));
+    UDFPrint((" partitionNumber = %x\n", p->partitionNumber));
+    UDFPrint((" accessType      = %x\n", p->accessType));
+    UDFPrint((" partitionStartingLocation = %x\n", p->partitionStartingLocation));
+    UDFPrint((" partitionLength = %x\n", p->partitionLength));
     // There is nothing interesting to comment here
     // Just look at Names & Messages....
     for (i=0; i<Vcb->PartitionMaps; i++) {
-        KdPrint(("Searching map: (%d == %d)\n",
+        UDFPrint(("Searching map: (%d == %d)\n",
             Vcb->Partitions[i].PartitionNum, (p->partitionNumber) ));
         if(Vcb->Partitions[i].PartitionNum == (p->partitionNumber)) {
             Found = TRUE;
@@ -2050,13 +2050,13 @@ UDFLoadPartDesc(
             Vcb->Partitions[i].UspaceBitmap = 0xFFFFFFFF;
             Vcb->Partitions[i].FspaceBitmap = 0xFFFFFFFF;
             Vcb->Partitions[i].AccessType = p->accessType;
-            KdPrint(("Access mode %x\n", p->accessType));
+            UDFPrint(("Access mode %x\n", p->accessType));
             if(p->accessType == PARTITION_ACCESS_WO) {
                 Vcb->CDR_Mode = TRUE;
 //                Vcb->Partitions[i].PartitionLen = Vcb->LastPossibleLBA - p->partitionStartingLocation;
             } else if(p->accessType < PARTITION_ACCESS_WO) {
                 // Soft-read-only volume
-                KdPrint(("Soft Read-only volume\n"));
+                UDFPrint(("Soft Read-only volume\n"));
                 Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
                 Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_PART_RO;
             } else if(p->accessType > PARTITION_ACCESS_MAX_KNOWN) {
@@ -2071,24 +2071,24 @@ UDFLoadPartDesc(
                 phd = (PPARTITION_HEADER_DESC)(p->partitionContentsUse);
 #ifdef UDF_DBG
                 if(phd->unallocatedSpaceTable.extLength)
-                    KdPrint(("unallocatedSpaceTable (part %d)\n", i));
+                    UDFPrint(("unallocatedSpaceTable (part %d)\n", i));
 #endif // UDF_DBG
                 if(phd->unallocatedSpaceBitmap.extLength) {
                     Vcb->Partitions[i].UspaceBitmap =
                         phd->unallocatedSpaceBitmap.extPosition;
-                    KdPrint(("unallocatedSpaceBitmap (part %d) @ %x\n",
+                    UDFPrint(("unallocatedSpaceBitmap (part %d) @ %x\n",
                         i, Vcb->Partitions[i].UspaceBitmap ));
                 }
 #ifdef UDF_DBG
                 if(phd->partitionIntegrityTable.extLength)
-                    KdPrint(("partitionIntegrityTable (part %d)\n", i));
+                    UDFPrint(("partitionIntegrityTable (part %d)\n", i));
                 if(phd->freedSpaceTable.extLength)
-                    KdPrint(("freedSpaceTable (part %d)\n", i));
+                    UDFPrint(("freedSpaceTable (part %d)\n", i));
 #endif // UDF_DBG
                 if(phd->freedSpaceBitmap.extLength) {
                     Vcb->Partitions[i].FspaceBitmap =
                         phd->freedSpaceBitmap.extPosition;
-                    KdPrint(("freedSpaceBitmap (part %d)\n", i));
+                    UDFPrint(("freedSpaceBitmap (part %d)\n", i));
                 }
                 RC = UDFBuildFreeSpaceBitmap(Vcb, i, phd, 0);
                 //Vcb->Modified = FALSE;
@@ -2111,9 +2111,9 @@ UDFLoadPartDesc(
     }
 #ifdef UDF_DBG
     if(!Found) {
-        KdPrint(("Partition (%d) not found in partition map\n", (p->partitionNumber) ));
+        UDFPrint(("Partition (%d) not found in partition map\n", (p->partitionNumber) ));
     } else {
-        KdPrint(("Partition (%d:%d type %x) starts at physical %x, length %x\n",
+        UDFPrint(("Partition (%d:%d type %x) starts at physical %x, length %x\n",
             p->partitionNumber, i-1, Vcb->Partitions[i-1].PartitionType,
             Vcb->Partitions[i-1].PartitionRoot, Vcb->Partitions[i-1].PartitionLen));
     }
@@ -2134,17 +2134,17 @@ UDFVerifyPartDesc(
     uint32 i;
     OSSTATUS RC;
     BOOLEAN Found = FALSE;
-    KdPrint(("UDF: Verify Part Descr:\n"));
-    KdPrint((" volDescSeqNum   = %x\n", p->volDescSeqNum));
-    KdPrint((" partitionFlags  = %x\n", p->partitionFlags));
-    KdPrint((" partitionNumber = %x\n", p->partitionNumber));
-    KdPrint((" accessType      = %x\n", p->accessType));
-    KdPrint((" partitionStartingLocation = %x\n", p->partitionStartingLocation));
-    KdPrint((" partitionLength = %x\n", p->partitionLength));
+    UDFPrint(("UDF: Verify Part Descr:\n"));
+    UDFPrint((" volDescSeqNum   = %x\n", p->volDescSeqNum));
+    UDFPrint((" partitionFlags  = %x\n", p->partitionFlags));
+    UDFPrint((" partitionNumber = %x\n", p->partitionNumber));
+    UDFPrint((" accessType      = %x\n", p->accessType));
+    UDFPrint((" partitionStartingLocation = %x\n", p->partitionStartingLocation));
+    UDFPrint((" partitionLength = %x\n", p->partitionLength));
     // There is nothing interesting to comment here
     // Just look at Names & Messages....
     for (i=0; i<Vcb->PartitionMaps; i++) {
-        KdPrint(("Searching map: (%d == %d)\n",
+        UDFPrint(("Searching map: (%d == %d)\n",
             Vcb->Partitions[i].PartitionNum, (p->partitionNumber) ));
         if(Vcb->Partitions[i].PartitionNum == (p->partitionNumber)) {
             Found = TRUE;
@@ -2158,14 +2158,14 @@ UDFVerifyPartDesc(
 //            Vcb->Partitions[i].FspaceBitmap = 0xFFFFFFFF;
             if(Vcb->Partitions[i].AccessType != p->accessType)
                 return STATUS_DISK_CORRUPT_ERROR;
-            KdPrint(("Access mode %x\n", p->accessType));
+            UDFPrint(("Access mode %x\n", p->accessType));
             if(p->accessType == PARTITION_ACCESS_WO) {
                 if(Vcb->CDR_Mode != TRUE)
                     return STATUS_DISK_CORRUPT_ERROR;
 //                Vcb->Partitions[i].PartitionLen = Vcb->LastPossibleLBA - p->partitionStartingLocation;
             } else if(p->accessType < PARTITION_ACCESS_WO) {
                 // Soft-read-only volume
-                KdPrint(("Soft Read-only volume\n"));
+                UDFPrint(("Soft Read-only volume\n"));
                 if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY))
                     return STATUS_DISK_CORRUPT_ERROR;
             } else if(p->accessType > PARTITION_ACCESS_MAX_KNOWN) {
@@ -2180,28 +2180,28 @@ UDFVerifyPartDesc(
                 phd = (PPARTITION_HEADER_DESC)(p->partitionContentsUse);
 #ifdef UDF_DBG
                 if(phd->unallocatedSpaceTable.extLength)
-                    KdPrint(("unallocatedSpaceTable (part %d)\n", i));
+                    UDFPrint(("unallocatedSpaceTable (part %d)\n", i));
 #endif // UDF_DBG
                 if(phd->unallocatedSpaceBitmap.extLength) {
                     if(Vcb->Partitions[i].UspaceBitmap ==
                         phd->unallocatedSpaceBitmap.extPosition) {
-                        KdPrint(("Warning: both USpaceBitmaps have same location\n"));
+                        UDFPrint(("Warning: both USpaceBitmaps have same location\n"));
                     }
-                    KdPrint(("unallocatedSpaceBitmap (part %d) @ %x\n",
+                    UDFPrint(("unallocatedSpaceBitmap (part %d) @ %x\n",
                         i, Vcb->Partitions[i].UspaceBitmap ));
                 }
 #ifdef UDF_DBG
                 if(phd->partitionIntegrityTable.extLength)
-                    KdPrint(("partitionIntegrityTable (part %d)\n", i));
+                    UDFPrint(("partitionIntegrityTable (part %d)\n", i));
                 if(phd->freedSpaceTable.extLength)
-                    KdPrint(("freedSpaceTable (part %d)\n", i));
+                    UDFPrint(("freedSpaceTable (part %d)\n", i));
 #endif // UDF_DBG
                 if(phd->freedSpaceBitmap.extLength) {
                     if(Vcb->Partitions[i].FspaceBitmap ==
                         phd->freedSpaceBitmap.extPosition) {
-                        KdPrint(("Warning: both FSpaceBitmaps have same location\n"));
+                        UDFPrint(("Warning: both FSpaceBitmaps have same location\n"));
                     }
-                    KdPrint(("freedSpaceBitmap (part %d)\n", i));
+                    UDFPrint(("freedSpaceBitmap (part %d)\n", i));
                 }
                 RC = UDFVerifyFreeSpaceBitmap(Vcb, i, phd, 0);
                 //Vcb->Modified = FALSE;
@@ -2224,9 +2224,9 @@ UDFVerifyPartDesc(
     }
 #ifdef UDF_DBG
     if(!Found) {
-        KdPrint(("Partition (%d) not found in partition map\n", (p->partitionNumber) ));
+        UDFPrint(("Partition (%d) not found in partition map\n", (p->partitionNumber) ));
     } else {
-        KdPrint(("Partition (%d:%d type %x) starts at physical %x, length %x\n",
+        UDFPrint(("Partition (%d:%d type %x) starts at physical %x, length %x\n",
             p->partitionNumber, i-1, Vcb->Partitions[i-1].PartitionType,
             Vcb->Partitions[i-1].PartitionRoot, Vcb->Partitions[i-1].PartitionLen));
     }
@@ -2252,7 +2252,7 @@ UDFReadVDS(
     uint32 vdsn;
     uint16 ident;
 
-    KdPrint(("UDF: Read VDS (%x - %x)\n", block, lastblock ));
+    UDFPrint(("UDF: Read VDS (%x - %x)\n", block, lastblock ));
     // Read the main descriptor sequence
     for (;(!done && block <= lastblock); block++)
     {
@@ -2264,7 +2264,7 @@ UDFReadVDS(
         // Process each descriptor (ISO 13346 3/8.3-8.4)
         gd = (struct GenericDesc *)Buf;
         vdsn = gd->volDescSeqNum;
-        KdPrint(("LBA %x, Ident = %x, vdsn = %x\n", block, ident, vdsn ));
+        UDFPrint(("LBA %x, Ident = %x, vdsn = %x\n", block, ident, vdsn ));
         switch (ident)
         {
             case TID_PRIMARY_VOL_DESC: // ISO 13346 3/10.1
@@ -2282,11 +2282,11 @@ UDFReadVDS(
                     vds[VDS_POS_VOL_DESC_PTR].block = block;
                     vds[VDS_POS_RECURSION_COUNTER].volDescSeqNum++;
                     if(vds[VDS_POS_RECURSION_COUNTER].volDescSeqNum > MAX_VDS_PARTS) {
-                       KdPrint(("too long multipart VDS -> abort\n"));
+                       UDFPrint(("too long multipart VDS -> abort\n"));
                         return STATUS_DISK_CORRUPT_ERROR;
                     }
                     pVDP = (struct VolDescPtr*)Buf;
-                    KdPrint(("multipart VDS...\n"));
+                    UDFPrint(("multipart VDS...\n"));
                     return UDFReadVDS(Vcb, pVDP->nextVolDescSeqExt.extLocation,
                                          pVDP->nextVolDescSeqExt.extLocation + (pVDP->nextVolDescSeqExt.extLocation >> Vcb->BlockSizeBits),
                                          vds, Buf);
@@ -2335,9 +2335,9 @@ UDFLoadImpUseVolDesc(
 {
     ImpUseVolDesc* iuvd = (ImpUseVolDesc*)Buf;
     ImpUseVolDescImpUse* iuvdiu = (ImpUseVolDescImpUse*)&(iuvd->impUse);
-    KdPrint(("UDF: Imp Use Vol Desc:\n"));
-    KdPrint((" volDescSeqNum = %x\n", iuvd->volDescSeqNum));
-    KdPrint(("UDF: Imp Use Vol Desc Imp Use:\n"));
+    UDFPrint(("UDF: Imp Use Vol Desc:\n"));
+    UDFPrint((" volDescSeqNum = %x\n", iuvd->volDescSeqNum));
+    UDFPrint(("UDF: Imp Use Vol Desc Imp Use:\n"));
     KdDump(iuvdiu, sizeof(ImpUseVolDescImpUse));
     return STATUS_SUCCESS;
 } // UDFLoadImpUseVolDesc()
@@ -2348,7 +2348,7 @@ UDFLoadUnallocatedSpaceDesc(
     int8*     Buf
     )
 {
-    KdPrint(("UDF: Unallocated Space Desc:\n"));
+    UDFPrint(("UDF: Unallocated Space Desc:\n"));
 //    UnallocatedSpaceDesc* usd = (UnallocatedSpaceDesc*)Buf;
     return STATUS_SUCCESS;
 } // UDFLoadImpUseVolDesc()
@@ -2545,11 +2545,11 @@ UDFLoadFileset(
 {
     *root = fset->rootDirectoryICB.extLocation;
     Vcb->SerialNumber = fset->descTag.tagSerialNum;
-    KdPrint(("Rootdir at block=%x, partition=%d\n",
+    UDFPrint(("Rootdir at block=%x, partition=%d\n",
         root->logicalBlockNum, root->partitionReferenceNum));
     if(sysstream) {
         *sysstream = fset->streamDirectoryICB.extLocation;
-        KdPrint(("SysStream at block=%x, partition=%d\n",
+        UDFPrint(("SysStream at block=%x, partition=%d\n",
             sysstream->logicalBlockNum, sysstream->partitionReferenceNum));
     }
     // Get current UDF revision
@@ -2638,8 +2638,8 @@ UDFLoadPartition(
             if(OS_SUCCESS(RC)) {
                 // Process the main & reserve sequences
                 // responsible for finding the PartitionDesc(s)
-                KdPrint(("-----------------------------------\n"));
-                KdPrint(("UDF: Main sequence:\n"));
+                UDFPrint(("-----------------------------------\n"));
+                UDFPrint(("UDF: Main sequence:\n"));
                 RC = UDFProcessSequence(DeviceObject, Vcb, main_s, main_e, fileset);
             }
 
@@ -2647,9 +2647,9 @@ UDFLoadPartition(
                 // Remenber bad sequence
                 UDFRememberBadSequence(Vcb, main_s, RC);
 
-                KdPrint(("-----------------------------------\n"));
-                KdPrint(("UDF: Main sequence failed.\n"));
-                KdPrint(("UDF: Reserve sequence\n"));
+                UDFPrint(("-----------------------------------\n"));
+                UDFPrint(("UDF: Main sequence failed.\n"));
+                UDFPrint(("UDF: Reserve sequence\n"));
                 if(Vcb->LVid) MyFreePool__(Vcb->LVid);
                 Vcb->LVid = NULL;
 
@@ -2659,7 +2659,7 @@ UDFLoadPartition(
                 }
 
                 if(OS_SUCCESS(RC2)) {
-                    KdPrint(("-----------------------------------\n"));
+                    UDFPrint(("-----------------------------------\n"));
                     Vcb->VDS2_Len = reserve_e - reserve_s;
                     Vcb->VDS2 = reserve_s;
                     RC = STATUS_SUCCESS;
@@ -2679,25 +2679,25 @@ UDFLoadPartition(
                 Vcb->LVid = NULL;*/
                 if(OS_SUCCESS(UDFVerifySequence(DeviceObject, Vcb, reserve_s, reserve_e, fileset)))
                 {
-                    KdPrint(("-----------------------------------\n"));
+                    UDFPrint(("-----------------------------------\n"));
                     Vcb->VDS2_Len = reserve_e - reserve_s;
                     Vcb->VDS2 = reserve_s;
                     break;
                 } else {
-                    KdPrint(("UDF: Reserve sequence verification failed.\n"));
+                    UDFPrint(("UDF: Reserve sequence verification failed.\n"));
                     switch(Vcb->PartitialDamagedVolumeAction) {
                     case UDF_PART_DAMAGED_RO:
-                        KdPrint(("UDF: Switch to r/o mode.\n"));
+                        UDFPrint(("UDF: Switch to r/o mode.\n"));
                         Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
                         break;
                     case UDF_PART_DAMAGED_NO:
-                        KdPrint(("UDF: Switch to raw mount mode, return UNRECOGNIZED_VOLUME.\n"));
+                        UDFPrint(("UDF: Switch to raw mount mode, return UNRECOGNIZED_VOLUME.\n"));
                         Vcb->VCBFlags |= UDF_VCB_FLAGS_RAW_DISK;
                         RC = STATUS_WRONG_VOLUME;
                         break;
                     case UDF_PART_DAMAGED_RW:
                     default:
-                        KdPrint(("UDF: Keep r/w mode for your own risk.\n"));
+                        UDFPrint(("UDF: Keep r/w mode for your own risk.\n"));
                         break;
                     }
                 }
@@ -2708,16 +2708,16 @@ UDFLoadPartition(
 
     if(Vcb->SparingCount &&
        (Vcb->NoFreeRelocationSpaceVolumeAction != UDF_PART_DAMAGED_RW)) {
-        KdPrint(("UDF: No free Sparing Entries -> Switch to r/o mode.\n"));
+        UDFPrint(("UDF: No free Sparing Entries -> Switch to r/o mode.\n"));
         Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
     }
 
     if(i == sizeof(Vcb->Anchor)/sizeof(int)) {
-        KdPrint(("No Anchor block found\n"));
+        UDFPrint(("No Anchor block found\n"));
         RC = STATUS_UNRECOGNIZED_VOLUME;
 #ifdef UDF_DBG
     } else {
-        KdPrint(("Using anchor in block %x\n", Vcb->Anchor[i]));
+        UDFPrint(("Using anchor in block %x\n", Vcb->Anchor[i]));
 #endif // UDF_DBG
     }
     MyFreePool__(Buf);
@@ -2794,16 +2794,16 @@ UDFLoadSparingTable(
 
     Vcb->SparingCountFree = -1;
 
-    KdPrint(("UDF: Sparable Part Map:\n"));
+    UDFPrint(("UDF: Sparable Part Map:\n"));
     Vcb->SparingTableLength = PartMap->sizeSparingTable;
     BC = (PartMap->sizeSparingTable >> Vcb->BlockSizeBits) + 1;
-    KdPrint((" partitionMapType   = %x\n", PartMap->partitionMapType));
-    KdPrint((" partitionMapLength = %x\n", PartMap->partitionMapLength));
-    KdPrint((" volSeqNum          = %x\n", PartMap->volSeqNum));
-    KdPrint((" partitionNum       = %x\n", PartMap->partitionNum));
-    KdPrint((" packetLength       = %x\n", PartMap->packetLength));
-    KdPrint((" numSparingTables   = %x\n", PartMap->numSparingTables));
-    KdPrint((" sizeSparingTable   = %x\n", PartMap->sizeSparingTable));
+    UDFPrint((" partitionMapType   = %x\n", PartMap->partitionMapType));
+    UDFPrint((" partitionMapLength = %x\n", PartMap->partitionMapLength));
+    UDFPrint((" volSeqNum          = %x\n", PartMap->volSeqNum));
+    UDFPrint((" partitionNum       = %x\n", PartMap->partitionNum));
+    UDFPrint((" packetLength       = %x\n", PartMap->packetLength));
+    UDFPrint((" numSparingTables   = %x\n", PartMap->numSparingTables));
+    UDFPrint((" sizeSparingTable   = %x\n", PartMap->sizeSparingTable));
     SparTable = (PSPARING_TABLE)MyAllocatePool__(NonPagedPool, BC*Vcb->BlockSize);
     if(!SparTable) return STATUS_INSUFFICIENT_RESOURCES;
     if(Vcb->SparingTable) {
@@ -2827,7 +2827,7 @@ UDFLoadSparingTable(
         SparTableLoc = ((uint32*)(PartMap+1))[i];
         for(n=0; n<Vcb->SparingTableCount; n++) {
             if(Vcb->SparingTableLoc[i] == SparTableLoc) {
-                KdPrint((" already processed @%x\n", 
+                UDFPrint((" already processed @%x\n", 
                     SparTableLoc
                     ));
                 continue;
@@ -2843,7 +2843,7 @@ UDFLoadSparingTable(
                     Vcb->BlockSize-1) 
                                       >> Vcb->BlockSizeBits);
             if(BC2 > BC) {
-                KdPrint((" sizeSparingTable @%x too long: %x > %x\n", 
+                UDFPrint((" sizeSparingTable @%x too long: %x > %x\n", 
                     SparTableLoc, BC2, BC
                     ));
                 continue;
@@ -2853,7 +2853,7 @@ UDFLoadSparingTable(
             UDFRegisterFsStructure(Vcb,  SparTableLoc, BC2<<Vcb->BlockSizeBits);
         
             if(!OS_SUCCESS(status)) {
-                KdPrint((" Error reading sizeSparingTable @%x (%x)\n", 
+                UDFPrint((" Error reading sizeSparingTable @%x (%x)\n", 
                     SparTableLoc, BC2
                     ));
                 continue;
@@ -2880,7 +2880,7 @@ UDFLoadSparingTable(
                 merged = TRUE;
                 for(m=0; m<Vcb->SparingCount; m++) {
                     if(RelocMap[m].mappedLocation == NewRelocMap[n].mappedLocation) {
-                        KdPrint(("  dup @%x (%x) vs @%x (%x)\n", 
+                        UDFPrint(("  dup @%x (%x) vs @%x (%x)\n", 
                             RelocMap[m].origLocation, RelocMap[m].mappedLocation,
                             NewRelocMap[m].origLocation, NewRelocMap[m].mappedLocation));
                         merged = FALSE;
@@ -2889,7 +2889,7 @@ UDFLoadSparingTable(
                        (RelocMap[m].mappedLocation != NewRelocMap[n].mappedLocation) &&
                        (RelocMap[m].origLocation != SPARING_LOC_AVAILABLE) &&
                        (RelocMap[m].origLocation != SPARING_LOC_CORRUPTED)) {
-                        KdPrint(("  conflict @%x (%x) vs @%x (%x)\n", 
+                        UDFPrint(("  conflict @%x (%x) vs @%x (%x)\n", 
                             RelocMap[m].origLocation, RelocMap[m].mappedLocation,
                             NewRelocMap[n].origLocation, NewRelocMap[n].mappedLocation));
                         merged = FALSE;
@@ -2897,7 +2897,7 @@ UDFLoadSparingTable(
                 }
                 if(merged) {
                     RelocMap[Vcb->SparingCount] = NewRelocMap[n];
-                    KdPrint(("  reloc %x -> %x\n", 
+                    UDFPrint(("  reloc %x -> %x\n", 
                         RelocMap[Vcb->SparingCount].origLocation, RelocMap[Vcb->SparingCount].mappedLocation));
                     Vcb->SparingCount++;
                     if(RelocMap[Vcb->SparingCount].origLocation == SPARING_LOC_AVAILABLE) {
@@ -2912,7 +2912,7 @@ UDFLoadSparingTable(
             Vcb->SparingCount += NewSize/sizeof(SPARING_ENTRY);
 */
             if(Vcb->SparingTableCount >= MAX_SPARING_TABLE_LOCATIONS) {
-                KdPrint(("    too many Sparing Tables\n"));
+                UDFPrint(("    too many Sparing Tables\n"));
                 break;
             }
         }
@@ -2986,22 +2986,22 @@ UDFGetDiskInfoAndVerify(
     int8*           Buf = NULL;
     uint32          ReadBytes;
 
-    KdPrint(("UDFGetDiskInfoAndVerify\n"));
+    UDFPrint(("UDFGetDiskInfoAndVerify\n"));
     _SEH2_TRY {
 
         if(!UDFFindAnchor(Vcb)) {
             if(Vcb->FsDeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM) {
                 // check if this disc is mountable for CDFS
-                KdPrint(("   FILE_DEVICE_CD_ROM_FILE_SYSTEM\n"));
+                UDFPrint(("   FILE_DEVICE_CD_ROM_FILE_SYSTEM\n"));
 check_NSR:
                 NSRDesc = UDFFindVRS(Vcb);
                 if(!(NSRDesc & VRS_ISO9660_FOUND)) {
                     // no CDFS VRS found
-                    KdPrint(("UDFGetDiskInfoAndVerify: no CDFS VRS found\n"));
+                    UDFPrint(("UDFGetDiskInfoAndVerify: no CDFS VRS found\n"));
                     if(!Vcb->TrackMap[Vcb->LastTrackNum].LastLba &&
                        !Vcb->TrackMap[Vcb->FirstTrackNum].LastLba) {
                         // such a stupid method of Audio-CD detection...
-                        KdPrint(("UDFGetDiskInfoAndVerify: set UDF_VCB_FLAGS_RAW_DISK\n"));
+                        UDFPrint(("UDFGetDiskInfoAndVerify: set UDF_VCB_FLAGS_RAW_DISK\n"));
                         Vcb->VCBFlags |= UDF_VCB_FLAGS_RAW_DISK;
                     }
                 }
@@ -3014,7 +3014,7 @@ check_NSR:
                     try_return(RC = STATUS_UNRECOGNIZED_VOLUME);
                 RC = STATUS_UNRECOGNIZED_VOLUME;
                 if(!UDFCheckZeroBuf(Buf,0x10000)) {
-                    KdPrint(("UDFGetDiskInfoAndVerify: possible FS detected, remove UDF_VCB_FLAGS_RAW_DISK\n"));
+                    UDFPrint(("UDFGetDiskInfoAndVerify: possible FS detected, remove UDF_VCB_FLAGS_RAW_DISK\n"));
                     Vcb->VCBFlags &= ~UDF_VCB_FLAGS_RAW_DISK;
                 }
                 MyFreePool__(Buf);
@@ -3026,7 +3026,7 @@ check_NSR:
         RC = UDFLoadPartition(DeviceObject,Vcb,&fileset);
         if(!OS_SUCCESS(RC)) {
             if(RC == STATUS_UNRECOGNIZED_VOLUME) {
-                KdPrint(("UDFGetDiskInfoAndVerify: check NSR presence\n"));
+                UDFPrint(("UDFGetDiskInfoAndVerify: check NSR presence\n"));
                 goto check_NSR;
             }
             try_return(RC);
index 1bab962..4280633 100644 (file)
@@ -57,7 +57,7 @@ UDFEjectReqWaiter(
 
 //    BOOLEAN FlushAndEject = FALSE;
 
-    KdPrint(("    UDFEjectReqWaiter: start\n"));
+    UDFPrint(("    UDFEjectReqWaiter: start\n"));
     uint8 supported_evt_classes = 0;
     uint32 i, j;
     uint8 evt_type;
@@ -72,10 +72,10 @@ UDFEjectReqWaiter(
     if(UseEvent) {
         supported_evt_classes = EventStat_Class_Media;
     } else {
-        KdPrint(("    Eject Button ignored\n"));
+        UDFPrint(("    Eject Button ignored\n"));
     }
     for(j=0; j<4; j++) {
-        KdPrint(("    Reading events... (0)\n"));
+        UDFPrint(("    Reading events... (0)\n"));
         if(supported_evt_classes) {
             for(i=1; i<=EventRetStat_Class_Mask;i++) {
                 evt_type = (((UCHAR)1) << i);
@@ -129,7 +129,7 @@ stop_waiter:
                 KeSetEvent(WC->WaiterStopped, 0, FALSE);
                 MyFreePool__(WC);
                 WC = NULL;
-                KdPrint(("    UDFEjectReqWaiter: exit 3\n"));
+                UDFPrint(("    UDFEjectReqWaiter: exit 3\n"));
                 return;
             }
             BM_FlushPriod = Vcb->BM_FlushPriod;
@@ -213,7 +213,7 @@ wait_eject:
                                 Error,sizeof(GET_LAST_ERROR_USER_OUT),
                                 TRUE,NULL);
                 UDFReleaseResource(&(Vcb->IoResource));
-                KdPrint(("SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
+                UDFPrint(("SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
                          Error->SenseKey, Error->AdditionalSenseCode, Error->AdditionalSenseCodeQualifier, Error->LastError));
                 // check for Long Write In Progress
                 if( ((Error->SenseKey == SCSI_SENSE_NOT_READY) &&
@@ -225,9 +225,9 @@ wait_eject:
                                 ||
                        (Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL)) {
                           // we should forget about this disk...
-                        KdPrint(("    LAST_WRITE %x\n", !!(Vcb->VCBFlags & UDF_VCB_LAST_WRITE)));
-                        KdPrint(("    UDF_VCB_FLAGS_UNSAFE_IOCTL %x\n", !!(Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL)));
-                        KdPrint(("    UDFEjectReqWaiter: Unexpected write-in-progress on !Modified volume\n"));
+                        UDFPrint(("    LAST_WRITE %x\n", !!(Vcb->VCBFlags & UDF_VCB_LAST_WRITE)));
+                        UDFPrint(("    UDF_VCB_FLAGS_UNSAFE_IOCTL %x\n", !!(Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL)));
+                        UDFPrint(("    UDFEjectReqWaiter: Unexpected write-in-progress on !Modified volume\n"));
                         //ASSERT(FALSE);
                         Vcb->ForgetVolume = TRUE;
                         Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY | UDF_VCB_FLAGS_MEDIA_READ_ONLY;
@@ -240,7 +240,7 @@ wait_eject:
                    !(WC->DevCap.Capabilities2 & DevCap_lock_state)) {
                     // probably bus reset or power failure occured
                     // re-lock tray
-                    KdPrint(("    UDFEjectReqWaiter: Unexpected tray unlock encountered. Try to re-lock\n"));
+                    UDFPrint(("    UDFEjectReqWaiter: Unexpected tray unlock encountered. Try to re-lock\n"));
 
                     UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
                     VcbAcquired = TRUE;
@@ -278,14 +278,14 @@ wait_eject:
 
                     AllFlushed = FALSE;
 
-                    KdPrint(("    SkipCount=%x, SkipCountLimit=%x\n",
+                    UDFPrint(("    SkipCount=%x, SkipCountLimit=%x\n",
                         SkipCount,
                         Vcb->SkipCountLimit));
 
                     if( Tree_FlushPriod &&
                        (Tree_FlushPriod < Vcb->Tree_FlushTime)) {
 
-                        KdPrint(("    Tree_FlushPriod %I64x, Vcb->Tree_FlushTime %I64x\n",
+                        UDFPrint(("    Tree_FlushPriod %I64x, Vcb->Tree_FlushTime %I64x\n",
                             Tree_FlushPriod,
                             Vcb->Tree_FlushTime));
 
@@ -307,13 +307,13 @@ wait_eject:
                             VcbAcquired = TRUE;
                         }
 
-                        KdPrint(("UDF: Flushing Directory Tree....\n"));
+                        UDFPrint(("UDF: Flushing Directory Tree....\n"));
                         if( BM_FlushPriod &&
                            (BM_FlushPriod < Vcb->BM_FlushTime)) {
-                            KdPrint(("  full flush\n"));
+                            UDFPrint(("  full flush\n"));
                             flush_stat = UDFFlushADirectory(Vcb, Vcb->RootDirFCB->FileInfo, &IoStatus, UDF_FLUSH_FLAGS_BREAKABLE);
                         } else {
-                            KdPrint(("  light flush\n"));
+                            UDFPrint(("  light flush\n"));
                             flush_stat = UDFFlushADirectory(Vcb, Vcb->RootDirFCB->FileInfo, &IoStatus, UDF_FLUSH_FLAGS_BREAKABLE | UDF_FLUSH_FLAGS_LITE);
                         }
                         if(flush_stat & UDF_FLUSH_FLAGS_INTERRUPTED)
@@ -327,7 +327,7 @@ skip_BM_flush:
                     if( BM_FlushPriod &&
                        (BM_FlushPriod < Vcb->BM_FlushTime)) {
 
-                        KdPrint(("    BM_FlushPriod %I64x, Vcb->BM_FlushTime %I64x\n",
+                        UDFPrint(("    BM_FlushPriod %I64x, Vcb->BM_FlushTime %I64x\n",
                             BM_FlushPriod,
                             Vcb->BM_FlushTime));
 
@@ -369,20 +369,20 @@ skip_BM_flush:
                         UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr2, &(Vcb->VolIdent));
 
                         if(Vcb->VerifyOnWrite) {
-                            KdPrint(("UDF: Flushing cache for verify\n"));
+                            UDFPrint(("UDF: Flushing cache for verify\n"));
                             //WCacheFlushAll__(&(Vcb->FastCache), Vcb);
                             WCacheFlushBlocks__(&(Vcb->FastCache), Vcb, 0, Vcb->LastLBA);
                             UDFVFlush(Vcb);
                         }
 #ifdef UDF_DBG
-                        KdPrint(("UDF: Flushing Free Space Bitmap....\n"));
+                        UDFPrint(("UDF: Flushing Free Space Bitmap....\n"));
 
 //                        if(!OS_SUCCESS(UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr, &(Vcb->VolIdent))))
-//                            KdPrint(("Error updating VolIdent\n"));
+//                            UDFPrint(("Error updating VolIdent\n"));
                         if(!OS_SUCCESS(UDFUpdateVDS(Vcb, Vcb->VDS1, Vcb->VDS1 + Vcb->VDS1_Len, flags)))
-                            KdPrint(("Error updating Main VDS\n"));
+                            UDFPrint(("Error updating Main VDS\n"));
                         if(!OS_SUCCESS(UDFUpdateVDS(Vcb, Vcb->VDS2, Vcb->VDS2 + Vcb->VDS2_Len, flags)))
-                            KdPrint(("Error updating Reserve VDS\n"));
+                            UDFPrint(("Error updating Reserve VDS\n"));
 #else
                         UDFUpdateVDS(Vcb, Vcb->VDS1, Vcb->VDS1 + Vcb->VDS1_Len, flags);
                         UDFUpdateVDS(Vcb, Vcb->VDS2, Vcb->VDS2 + Vcb->VDS2_Len, flags);
@@ -425,7 +425,7 @@ skip_BM_flush2:
             if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA))
                 try_return(RC);
 
-            KdPrint(("    UDFEjectReqWaiter: check removable media\n"));
+            UDFPrint(("    UDFEjectReqWaiter: check removable media\n"));
             if(!WC->SoftEjectReq && SkipEject) {
                 try_return(RC);
             }
@@ -433,7 +433,7 @@ skip_BM_flush2:
             if(!WC->SoftEjectReq) {
 
                 if(!UseEvent) {
-                    KdPrint(("    Eject Button ignored\n"));
+                    UDFPrint(("    Eject Button ignored\n"));
                     try_return(RC);
                 }
 
@@ -443,7 +443,7 @@ skip_BM_flush2:
             //        KeDelayExecutionThread(KernelMode, FALSE, &delay);
                     OSSTATUS RC;
 
-                    KdPrint(("    Sync cache before GET_EVENT\n"));
+                    UDFPrint(("    Sync cache before GET_EVENT\n"));
                     RC = UDFSyncCache(Vcb);
                     if(RC == STATUS_INVALID_DEVICE_REQUEST) {
                         Vcb->VCBFlags |= UDF_VCB_FLAGS_NO_SYNC_CACHE;
@@ -465,15 +465,15 @@ skip_BM_flush2:
                 if(RC != STATUS_SUCCESS &&
                    RC != STATUS_DATA_OVERRUN) {
                     if(RC == STATUS_NO_SUCH_DEVICE) {
-                        KdPrint(("    Device loss\n"));
+                        UDFPrint(("    Device loss\n"));
                         goto device_failure;
                     }
                     if(RC == STATUS_NO_MEDIA_IN_DEVICE) {
-                        KdPrint(("    Media loss\n"));
+                        UDFPrint(("    Media loss\n"));
                         goto media_loss;
                     }
                 }
-                KdPrint(("    Reading events...\n"));
+                UDFPrint(("    Reading events...\n"));
                 if(supported_evt_classes) {
                     for(i=1; i<=EventRetStat_Class_Mask;i++) {
                         evt_type = (((UCHAR)1) << i);
@@ -499,7 +499,7 @@ skip_BM_flush2:
                             continue;
                         }
                         if(RC == STATUS_NO_SUCH_DEVICE) {
-                            KdPrint(("    Device loss (2)\n"));
+                            UDFPrint(("    Device loss (2)\n"));
                             goto device_failure;
                         }
                         if(!OS_SUCCESS(RC)) {
@@ -510,7 +510,7 @@ skip_BM_flush2:
                             continue;
                         }
                         if( evt_type == EventStat_Class_Media ) {
-                            KdPrint(("    EventStat_Class_Media:\n"));
+                            UDFPrint(("    EventStat_Class_Media:\n"));
                             if((WC->EjectReqBuffer.MediaChange.Header.Flags.Flags & EventRetStat_Class_Mask) !=
                                 EventRetStat_Class_Media) {
                                 continue;
@@ -527,14 +527,14 @@ retry_media_presence_check:
 
                                 if(RC == STATUS_SUCCESS ||
                                    RC == STATUS_DATA_OVERRUN) {
-                                    KdPrint(("    Buggy GET_EVENT media presence flag %x\n",
+                                    UDFPrint(("    Buggy GET_EVENT media presence flag %x\n",
                                         WC->EjectReqBuffer.MediaChange.Byte1));
                                     WC->EjectReqBuffer.MediaChange.Byte1.Flags |= EventStat_MediaStat_Present;
                                     WC->EjectReqBuffer.MediaChange.Byte1.Flags &= ~EventStat_MediaStat_DoorOpen;
                                     goto retry_media_presence_check;
                                 }
 media_loss:
-                                KdPrint(("    Unexpected media loss. Check device status\n"));
+                                UDFPrint(("    Unexpected media loss. Check device status\n"));
                                 UseEject = FALSE;
                                 MediaLoss = TRUE;
                             } else
@@ -543,12 +543,12 @@ media_loss:
                                            EventStat_MediaEvent_EjectReq ) {
                                 continue;
                             }
-                            KdPrint(("    eject requested\n"));
+                            UDFPrint(("    eject requested\n"));
                             WC->SoftEjectReq = TRUE;
                             break;
                         }
                         if( evt_type == EventStat_Class_ExternalReq ) {
-                            KdPrint(("    EventStat_Class_ExternalReq:\n"));
+                            UDFPrint(("    EventStat_Class_ExternalReq:\n"));
                             if((WC->EjectReqBuffer.ExternalReq.Header.Flags.Flags & EventRetStat_Class_Mask) !=
                                 EventRetStat_Class_ExternReq)
                                 continue;
@@ -556,7 +556,7 @@ media_loss:
                             case EventStat_ExtrnReqEvent_KeyDown:
                             case EventStat_ExtrnReqEvent_KeyUp:
                             case EventStat_ExtrnReqEvent_ExtrnReq:
-                                KdPrint(("    eject requested (%x)\n", WC->EjectReqBuffer.ExternalReq.Byte0.Flags));
+                                UDFPrint(("    eject requested (%x)\n", WC->EjectReqBuffer.ExternalReq.Byte0.Flags));
                                 WC->SoftEjectReq = TRUE;
                                 break;
                             }
@@ -571,7 +571,7 @@ media_loss:
                     }
                 } else {
 
-                    KdPrint(("    Reading Media Event...\n"));
+                    UDFPrint(("    Reading Media Event...\n"));
                     ((PGET_EVENT_USER_IN)(&(WC->EjectReqBuffer)))->Immed = TRUE;
                     ((PGET_EVENT_USER_IN)(&(WC->EjectReqBuffer)))->EventClass = EventStat_Class_Media;
                 
@@ -610,26 +610,26 @@ device_failure:
             // Acquire Vcb resource
             Vcb->SoftEjectReq = TRUE;
 
-            KdPrint(("    UDFEjectReqWaiter: ejecting...\n"));
+            UDFPrint(("    UDFEjectReqWaiter: ejecting...\n"));
 #ifdef UDF_DELAYED_CLOSE
             UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
-            KdPrint(("    UDFEjectReqWaiter:     set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
+            UDFPrint(("    UDFEjectReqWaiter:     set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
             Vcb->VCBFlags |= UDF_VCB_FLAGS_NO_DELAYED_CLOSE;
             UDFReleaseResource(&(Vcb->VCBResource));
 #endif //UDF_DELAYED_CLOSE
 
-            KdPrint(("    UDFEjectReqWaiter:     UDFCloseAllSystemDelayedInDir\n"));
+            UDFPrint(("    UDFEjectReqWaiter:     UDFCloseAllSystemDelayedInDir\n"));
             RC = UDFCloseAllSystemDelayedInDir(Vcb, Vcb->RootDirFCB->FileInfo);
             ASSERT(OS_SUCCESS(RC));
 #ifdef UDF_DELAYED_CLOSE
-            KdPrint(("    UDFEjectReqWaiter:     UDFCloseAllDelayed\n"));
+            UDFPrint(("    UDFEjectReqWaiter:     UDFCloseAllDelayed\n"));
             UDFCloseAllDelayed(Vcb);
             //ASSERT(OS_SUCCESS(RC));
 #endif //UDF_DELAYED_CLOSE
 
             UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
 
-            KdPrint(("    UDFEjectReqWaiter:     UDFDoDismountSequence\n"));
+            UDFPrint(("    UDFEjectReqWaiter:     UDFDoDismountSequence\n"));
             UDFDoDismountSequence(Vcb, (PPREVENT_MEDIA_REMOVAL_USER_IN)&(WC->EjectReqBuffer), UseEject);
             if (MediaLoss) {
                 Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
@@ -639,12 +639,12 @@ device_failure:
             Vcb->SoftEjectReq = FALSE;
             UDFReleaseResource(&(Vcb->VCBResource));
 
-            KdPrint(("    UDFEjectReqWaiter:     set WaiterStopped\n"));
+            UDFPrint(("    UDFEjectReqWaiter:     set WaiterStopped\n"));
             KeSetEvent(WC->WaiterStopped, 0, FALSE);
             MyFreePool__(WC);
             WC = NULL;
 
-            KdPrint(("    UDFEjectReqWaiter: exit 1\n"));
+            UDFPrint(("    UDFEjectReqWaiter: exit 1\n"));
             return;
     
 try_exit:   NOTHING;
@@ -671,11 +671,11 @@ try_exit:   NOTHING;
 void
 UDFStopEjectWaiter(PVCB Vcb) {
 
-    KdPrint(("    UDFStopEjectWaiter: try\n"));
+    UDFPrint(("    UDFStopEjectWaiter: try\n"));
     UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
     _SEH2_TRY {
         if(Vcb->EjectWaiter) {
-            KdPrint(("    UDFStopEjectWaiter: set flag\n"));
+            UDFPrint(("    UDFStopEjectWaiter: set flag\n"));
             KeSetEvent( &(Vcb->EjectWaiter->StopReq), 0, FALSE );
         } else {
 //            return;
@@ -687,7 +687,7 @@ UDFStopEjectWaiter(PVCB Vcb) {
 
     _SEH2_TRY {
         if(Vcb->VCBFlags & UDF_VCB_FLAGS_STOP_WAITER_EVENT) {
-            KdPrint(("    UDFStopEjectWaiter: wait\n"));
+            UDFPrint(("    UDFStopEjectWaiter: wait\n"));
             KeWaitForSingleObject(&(Vcb->WaiterStopped), Executive, KernelMode, FALSE, NULL);
         }
         Vcb->VCBFlags &= ~UDF_VCB_FLAGS_STOP_WAITER_EVENT;
@@ -695,7 +695,7 @@ UDFStopEjectWaiter(PVCB Vcb) {
         BrutePoint();
     } _SEH2_END;
     ASSERT(!Vcb->EjectWaiter);
-    KdPrint(("    UDFStopEjectWaiter: exit\n"));
+    UDFPrint(("    UDFStopEjectWaiter: exit\n"));
 
 } // end UDFStopEjectWaiter()
 
@@ -712,7 +712,7 @@ UDFDoDismountSequence(
 
     // flush system cache
     UDFFlushLogicalVolume(NULL, NULL, Vcb, 0);
-    KdPrint(("UDFDoDismountSequence:\n"));
+    UDFPrint(("UDFDoDismountSequence:\n"));
 
     delay.QuadPart = -1000000; // 0.1 sec
     KeDelayExecutionThread(KernelMode, FALSE, &delay);
@@ -728,7 +728,7 @@ UDFDoDismountSequence(
 
     // unlock media, drop our own Locks
     if(Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA) {
-        KdPrint(("  cleanup tray-lock (%d+2):\n", Vcb->MediaLockCount));
+        UDFPrint(("  cleanup tray-lock (%d+2):\n", Vcb->MediaLockCount));
         for(i=0; i<Vcb->MediaLockCount+2; i++) {
             Buf->PreventMediaRemoval = FALSE;
             UDFPhSendIOCTL(IOCTL_STORAGE_MEDIA_REMOVAL,
@@ -745,7 +745,7 @@ UDFDoDismountSequence(
 
         if(!UDFIsDvdMedia(Vcb)) {
             // send speed limits to drive
-            KdPrint(("    Restore drive speed on dismount\n"));
+            UDFPrint(("    Restore drive speed on dismount\n"));
             Vcb->SpeedBuf.ReadSpeed  = Vcb->MaxReadSpeed;
             Vcb->SpeedBuf.WriteSpeed = Vcb->MaxWriteSpeed;
             UDFPhSendIOCTL(IOCTL_CDRW_SET_SPEED,
@@ -765,7 +765,7 @@ UDFDoDismountSequence(
             memset(&CBuff,0,sizeof(CLOSE_TRK_SES_USER_IN));
             // stop BG format
             if(Vcb->MRWStatus) {
-                KdPrint(("    Stop background formatting\n"));
+                UDFPrint(("    Stop background formatting\n"));
 
                 CBuff.Byte1.Flags = 0;//CloseTrkSes_Immed;
                 CBuff.Byte2.Flags = CloseTrkSes_Ses;
@@ -778,7 +778,7 @@ UDFDoDismountSequence(
                                FALSE, NULL );
     /*        } else
             if(Vcb->MediaClassEx == CdMediaClass_DVDRW) {
-                KdPrint(("    Close BG-formatted track\n"));
+                UDFPrint(("    Close BG-formatted track\n"));
 
                 CBuff.Byte1.Flags = 0;//CloseTrkSes_Immed;
                 CBuff.Byte2.Flags = CloseTrkSes_Trk;
@@ -835,7 +835,7 @@ UDFDoDismountSequence(
         ExFreePool(Vcb->CDBurnerVolume.Buffer);
     }
 */
-    KdPrint(("  set UnsafeIoctl\n"));
+    UDFPrint(("  set UnsafeIoctl\n"));
     Vcb->VCBFlags |= UDF_VCB_FLAGS_UNSAFE_IOCTL;
 
     return STATUS_SUCCESS;
index 2f9c3f8..2ca76b2 100644 (file)
@@ -61,18 +61,18 @@ UDFVInit(
     BOOLEAN res_inited = FALSE;
 
     if(VerifyCtx->VInited) {
-        KdPrint(("Already inited\n"));
+        UDFPrint(("Already inited\n"));
         return STATUS_SUCCESS;
     }
     
     _SEH2_TRY {
         RtlZeroMemory(VerifyCtx, sizeof(UDF_VERIFY_CTX));
         if(!Vcb->VerifyOnWrite) {
-            KdPrint(("Verify is disabled\n"));
+            UDFPrint(("Verify is disabled\n"));
             return STATUS_SUCCESS;
         }
         if(Vcb->CDR_Mode) {
-            KdPrint(("Verify is not intended for CD/DVD-R\n"));
+            UDFPrint(("Verify is not intended for CD/DVD-R\n"));
             return STATUS_SUCCESS;
         }
         if(!OS_SUCCESS(status = ExInitializeResourceLite(&(VerifyCtx->VerifyLock)))) {
@@ -84,7 +84,7 @@ UDFVInit(
         if(VerifyCtx->StoredBitMap) {
             RtlZeroMemory(VerifyCtx->StoredBitMap, i);
         } else {
-            KdPrint(("Can't alloc verify bitmap for %x blocks\n", Vcb->LastPossibleLBA));
+            UDFPrint(("Can't alloc verify bitmap for %x blocks\n", Vcb->LastPossibleLBA));
             try_return(status = STATUS_INSUFFICIENT_RESOURCES);
         }
         InitializeListHead(&(VerifyCtx->vrfList));
@@ -113,14 +113,14 @@ UDFVWaitQueued(
     ULONG w;
 
     while(VerifyCtx->QueuedCount) {
-        KdPrint(("UDFVWaitQueued: wait for completion (%d)\n", VerifyCtx->QueuedCount));
+        UDFPrint(("UDFVWaitQueued: wait for completion (%d)\n", VerifyCtx->QueuedCount));
         w = InterlockedIncrement((PLONG)&(VerifyCtx->WaiterCount));
-        KdPrint(("  %d waiters\n", w));
+        UDFPrint(("  %d waiters\n", w));
         DbgWaitForSingleObject(&(VerifyCtx->vrfEvent), NULL);
         if((w = InterlockedDecrement((PLONG)&(VerifyCtx->WaiterCount)))) {
-            KdPrint(("  still %d waiters, q %d\n", w, VerifyCtx->QueuedCount));
+            UDFPrint(("  still %d waiters, q %d\n", w, VerifyCtx->QueuedCount));
             if(!VerifyCtx->QueuedCount) {
-                KdPrint(("  pulse event\n", w));
+                UDFPrint(("  pulse event\n", w));
                 KeSetEvent(&(VerifyCtx->vrfEvent), 0, FALSE);
             }
         }
@@ -141,7 +141,7 @@ UDFVRelease(
         return;
     }
 
-    KdPrint(("UDFVRelease: wait for completion\n"));
+    UDFPrint(("UDFVRelease: wait for completion\n"));
     UDFVWaitQueued(VerifyCtx);
 
     UDFAcquireResourceExclusive(&(VerifyCtx->VerifyLock), TRUE);
@@ -177,7 +177,7 @@ UDFVStoreBlock(
     PUDF_VERIFY_CTX VerifyCtx = &Vcb->VerifyCtx;
     PUDF_VERIFY_ITEM vItem;
 
-    KdPrint(("v-add %x\n", LBA));
+    UDFPrint(("v-add %x\n", LBA));
 
     vItem = (PUDF_VERIFY_ITEM)DbgAllocatePoolWithTag(PagedPool, sizeof(UDF_VERIFY_ITEM)+Vcb->BlockSize, 'bvWD');
     if(!vItem)
@@ -201,7 +201,7 @@ UDFVUpdateBlock(
     PUDF_VERIFY_ITEM vItem
     )
 {
-    KdPrint(("v-upd %x\n", vItem->lba));
+    UDFPrint(("v-upd %x\n", vItem->lba));
     RtlCopyMemory(vItem+1, Buffer, Vcb->BlockSize);
     vItem->crc = crc32((PUCHAR)Buffer, Vcb->BlockSize);
     return;
@@ -213,7 +213,7 @@ UDFVRemoveBlock(
     PUDF_VERIFY_ITEM vItem
     )
 {
-    KdPrint(("v-del %x\n", vItem->lba));
+    UDFPrint(("v-del %x\n", vItem->lba));
     UDFClrBit(VerifyCtx->StoredBitMap, vItem->lba);
     RemoveEntryList(&(vItem->vrfList));
     VerifyCtx->ItemCount--;
@@ -421,7 +421,7 @@ UDFVRead(
             if(!(Flags & PH_READ_VERIFY_CACHE)) {
                 crc = crc32((PUCHAR)Buffer+(vItem->lba - LBA)*Vcb->BlockSize, Vcb->BlockSize);
                 if(vItem->crc != crc) {
-                    KdPrint(("UDFVRead: stored %x != %x\n", vItem->crc, crc));
+                    UDFPrint(("UDFVRead: stored %x != %x\n", vItem->crc, crc));
                     RtlCopyMemory((PUCHAR)Buffer+(vItem->lba - LBA)*Vcb->BlockSize, vItem->Buffer, Vcb->BlockSize);
                     status = STATUS_FT_WRITE_RECOVERY;
 
@@ -431,25 +431,25 @@ UDFVRead(
                         if(bm) {
                             RtlZeroMemory(bm, crc);
                         } else {
-                            KdPrint(("Can't alloc BSBM for %x blocks\n", Vcb->LastPossibleLBA));
+                            UDFPrint(("Can't alloc BSBM for %x blocks\n", Vcb->LastPossibleLBA));
                         }
                     }
                     if(bm) {
                         UDFSetBit(bm, vItem->lba);
-                        KdPrint(("Set BB @ %#x\n", vItem->lba));
+                        UDFPrint(("Set BB @ %#x\n", vItem->lba));
                     }
 #ifdef _BROWSE_UDF_
                     bm = (uint32*)(Vcb->FSBM_Bitmap);
                     if(bm) {
                         UDFSetUsedBit(bm, vItem->lba);
-                        KdPrint(("Set BB @ %#x as used\n", vItem->lba));
+                        UDFPrint(("Set BB @ %#x as used\n", vItem->lba));
                     }
 #endif //_BROWSE_UDF_
                 } else {
                     // ok
                 }
             } else {
-                KdPrint(("UDFVRead: get cached @ %x\n", vItem->lba));
+                UDFPrint(("UDFVRead: get cached @ %x\n", vItem->lba));
                 RtlCopyMemory((PUCHAR)Buffer+(vItem->lba - LBA)*Vcb->BlockSize, vItem->Buffer, Vcb->BlockSize);
             }
             if(i >= n) {
@@ -561,8 +561,8 @@ UDFVWorkItem(
         WCacheEODirect__(&(Vcb->FastCache), Vcb);
     } else {
         for(i=0; i<VerifyReq->nReq; i++) {
-            KdPrint(("!!! No more space for remap !!!\n"));
-            KdPrint(("  try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
+            UDFPrint(("!!! No more space for remap !!!\n"));
+            UDFPrint(("  try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
             UDFVRead(Vcb, VerifyReq->Buffer, VerifyReq->vr[i].BCount, VerifyReq->vr[i].lba,
                      PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER);
         }
@@ -579,8 +579,8 @@ UDFVWorkItem(
                            PH_TMP_BUFFER | PH_VCB_IN_RETLEN /*| PH_LOCK_CACHE*/);
             WCacheEODirect__(&(Vcb->FastCache), Vcb);
         } else {
-            KdPrint(("!!! No more space for remap !!!\n"));
-            KdPrint(("  try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
+            UDFPrint(("!!! No more space for remap !!!\n"));
+            UDFPrint(("  try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
             RC = UDFVRead(Vcb, VerifyReq->Buffer, VerifyReq->vr[i].BCount, VerifyReq->vr[i].lba,
                           PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER);
         }
@@ -589,8 +589,8 @@ UDFVWorkItem(
     DbgFreePool(VerifyReq->Buffer);
     DbgFreePool(VerifyReq);
     InterlockedDecrement((PLONG)&(Vcb->VerifyCtx.QueuedCount));
-    KdPrint(("  QueuedCount = %d\n", Vcb->VerifyCtx.QueuedCount));
-    KdPrint(("  Setting event...\n"));
+    UDFPrint(("  QueuedCount = %d\n", Vcb->VerifyCtx.QueuedCount));
+    UDFPrint(("  Setting event...\n"));
     KeSetEvent(&(Vcb->VerifyCtx.vrfEvent), 0, FALSE);
     return;
 } // end UDFVWorkItem()
@@ -616,10 +616,10 @@ UDFVVerify(
     }
     if(VerifyCtx->QueuedCount) {
         if(Flags & UFD_VERIFY_FLAG_WAIT) {
-            KdPrint(("  wait for verify flush\n"));
+            UDFPrint(("  wait for verify flush\n"));
             goto wait;
         }
-        KdPrint(("  verify flush already queued\n"));
+        UDFPrint(("  verify flush already queued\n"));
         return;
     }
 
@@ -729,7 +729,7 @@ UDFVVerify(
     }
     if(Flags & UFD_VERIFY_FLAG_WAIT) {
 wait:
-        KdPrint(("UDFVVerify: wait for completion\n"));
+        UDFPrint(("UDFVVerify: wait for completion\n"));
         UDFVWaitQueued(VerifyCtx);
     }
 
@@ -747,12 +747,12 @@ UDFVFlush(
         return;
     }
 
-    KdPrint(("UDFVFlush: wait for completion\n"));
+    UDFPrint(("UDFVFlush: wait for completion\n"));
     UDFVWaitQueued(VerifyCtx);
 
     UDFVVerify(Vcb, UFD_VERIFY_FLAG_FORCE);
 
-    KdPrint(("UDFVFlush: wait for completion (2)\n"));
+    UDFPrint(("UDFVFlush: wait for completion (2)\n"));
     UDFVWaitQueued(VerifyCtx);
 } // end UDFVFlush()
 
@@ -822,9 +822,9 @@ UDFRemapPacket(
 
         // use sparing table for relocation
         if(Vcb->SparingCountFree == (ULONG)-1) {
-            KdPrint(("calculate free spare areas\n"));
+            UDFPrint(("calculate free spare areas\n"));
 re_check:
-            KdPrint(("verify spare area\n"));
+            UDFPrint(("verify spare area\n"));
             Vcb->SparingCountFree = 0;
             Map = Vcb->SparingTable;
             for(i=0;i<max;i++,Map++) {
@@ -832,7 +832,7 @@ re_check:
                     if(UDFCheckArea(Vcb, Map->mappedLocation, BS)) {
                         Vcb->SparingCountFree++;
                     } else {
-                        KdPrint(("initial check: bad spare block @ %x\n", Map->mappedLocation));
+                        UDFPrint(("initial check: bad spare block @ %x\n", Map->mappedLocation));
                         Map->origLocation = SPARING_LOC_CORRUPTED;
                         Vcb->SparingTableModified = TRUE;
                     }
@@ -840,7 +840,7 @@ re_check:
             }
         }
         if(!Vcb->SparingCountFree) {
-            KdPrint(("sparing table full\n"));
+            UDFPrint(("sparing table full\n"));
             return STATUS_DISK_FULL;
         }
 
@@ -851,7 +851,7 @@ re_check:
             if(Lba == (orig & ~(BS-1)) ) {
                 // already remapped
 
-                KdPrint(("remap remapped: bad spare block @ %x\n", Map->mappedLocation));
+                UDFPrint(("remap remapped: bad spare block @ %x\n", Map->mappedLocation));
                 if(!verified) {
                     verified = TRUE;
                     goto re_check;
@@ -871,14 +871,14 @@ re_check:
         Map = Vcb->SparingTable;
         for(i=0;i<max;i++,Map++) {
             if(Map->origLocation == SPARING_LOC_AVAILABLE) {
-                KdPrint(("remap %x -> %x\n", Lba, Map->mappedLocation));
+                UDFPrint(("remap %x -> %x\n", Lba, Map->mappedLocation));
                 Map->origLocation = Lba;
                 Vcb->SparingTableModified = TRUE;
                 Vcb->SparingCountFree--;
                 return STATUS_SUCCESS;
             }
         }
-        KdPrint(("sparing table full\n"));
+        UDFPrint(("sparing table full\n"));
         return STATUS_DISK_FULL;
     }
     return STATUS_UNSUCCESSFUL;
@@ -914,7 +914,7 @@ UDFUnmapRange(
             if(orig >= Lba &&
               (orig+BS) <= (Lba+BCount)) {
                 // unmap
-                KdPrint(("unmap %x -> %x\n", orig, Map->mappedLocation));
+                UDFPrint(("unmap %x -> %x\n", orig, Map->mappedLocation));
                 Map->origLocation = SPARING_LOC_AVAILABLE;
                 Vcb->SparingTableModified = TRUE;
                 Vcb->SparingCountFree++;
index d7f9771..0d9e5c1 100644 (file)
@@ -318,7 +318,7 @@ UDFReadFileEntry(
                          Ident))) return status;
     if((FileEntry->descTag.tagIdent != TID_FILE_ENTRY) &&
        (FileEntry->descTag.tagIdent != TID_EXTENDED_FILE_ENTRY)) {
-        KdPrint(("  Not a FileEntry (lbn=%x, tag=%x)\n", Icb->extLocation.logicalBlockNum, FileEntry->descTag.tagIdent));
+        UDFPrint(("  Not a FileEntry (lbn=%x, tag=%x)\n", Icb->extLocation.logicalBlockNum, FileEntry->descTag.tagIdent));
         return STATUS_FILE_CORRUPT_ERROR;
     }
     return STATUS_SUCCESS;
@@ -1069,7 +1069,7 @@ UDFLoadExtInfo(
 {
     EXTENT_AD TmpExt;
 
-    KdPrint(("  UDFLoadExtInfo:\n"));
+    UDFPrint(("  UDFLoadExtInfo:\n"));
     FExtInfo->Mapping = UDFReadMappingFromXEntry(Vcb, fe_loc->extLocation.partitionReferenceNum,
                                        (tag*)fe, &(FExtInfo->Offset), AExtInfo);
     if(!(FExtInfo->Mapping)) {
@@ -1082,12 +1082,12 @@ UDFLoadExtInfo(
         FExtInfo->Mapping = UDFExtentToMapping(&TmpExt);
     }
     if(fe->descTag.tagIdent == TID_FILE_ENTRY) {
-//        KdPrint(("Standard FileEntry\n"));
+//        UDFPrint(("Standard FileEntry\n"));
         FExtInfo->Length = fe->informationLength;
     } else /*if(fe->descTag.tagIdent == TID_EXTENDED_FILE_ENTRY) */ {
         FExtInfo->Length = ((PEXTENDED_FILE_ENTRY)fe)->informationLength;
     }
-    KdPrint(("  FExtInfo->Length %x\n", FExtInfo->Length));
+    UDFPrint(("  FExtInfo->Length %x\n", FExtInfo->Length));
     ASSERT(FExtInfo->Length <= UDFGetExtentLength(FExtInfo->Mapping));
     FExtInfo->Modified = FALSE;
 
@@ -1565,30 +1565,30 @@ UDFReadEntityID_Domain(
 
     dis = (domainIdentSuffix*)&(eID->identSuffix);
 
-    KdPrint(("UDF: Entity Id:\n"));
-    KdPrint(("flags: %x\n", eID->flags));
-    KdPrint(("ident[0]: %x\n", eID->ident[0]));
-    KdPrint(("ident[1]: %x\n", eID->ident[1]));
-    KdPrint(("ident[2]: %x\n", eID->ident[2]));
-    KdPrint(("ident[3]: %x\n", eID->ident[3]));
-    KdPrint(("UDF: Entity Id Domain:\n"));
+    UDFPrint(("UDF: Entity Id:\n"));
+    UDFPrint(("flags: %x\n", eID->flags));
+    UDFPrint(("ident[0]: %x\n", eID->ident[0]));
+    UDFPrint(("ident[1]: %x\n", eID->ident[1]));
+    UDFPrint(("ident[2]: %x\n", eID->ident[2]));
+    UDFPrint(("ident[3]: %x\n", eID->ident[3]));
+    UDFPrint(("UDF: Entity Id Domain:\n"));
     // Get current UDF revision
     Vcb->CurrentUDFRev = max(dis->currentRev, Vcb->CurrentUDFRev);
-    KdPrint(("Effective Revision: %x\n", Vcb->CurrentUDFRev));
+    UDFPrint(("Effective Revision: %x\n", Vcb->CurrentUDFRev));
     // Get Read-Only flags
     flags = dis->flags;
-    KdPrint(("Flags: %x\n", flags));
+    UDFPrint(("Flags: %x\n", flags));
     if((flags & ENTITYID_FLAGS_SOFT_RO) &&
         (Vcb->CompatFlags & UDF_VCB_IC_SOFT_RO)) {
         Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
         Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_SOFT_RO;
-        KdPrint(("       Soft-RO\n"));
+        UDFPrint(("       Soft-RO\n"));
     }
     if((flags & ENTITYID_FLAGS_HARD_RO) &&
        (Vcb->CompatFlags & UDF_VCB_IC_HW_RO)) {
         Vcb->VCBFlags |= UDF_VCB_FLAGS_MEDIA_READ_ONLY;
         Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_HW_RO;
-        KdPrint(("       Hard-RO\n"));
+        UDFPrint(("       Hard-RO\n"));
     }
 
 } // end UDFReadEntityID_Domain()
@@ -1820,7 +1820,7 @@ UDFUnlinkFile__(
     }
     SDirInfo = Dloc->SDirInfo;
 /*    if(FreeSpace && SDirInfo) {
-        KdPrint(("Unlink: SDirInfo should be NULL !!!\n"));
+        UDFPrint(("Unlink: SDirInfo should be NULL !!!\n"));
         BrutePoint();
         return STATUS_CANNOT_DELETE;
     }*/
@@ -2296,15 +2296,15 @@ UDFCleanUpFile__(
     ValidateFileInfo(FileInfo);
 
     if(FileInfo->OpenCount || FileInfo->RefCount) {
-        KdPrint(("UDF: not all references are closed\n"));
-        KdPrint(("     Skipping cleanup\n"));
-        KdPrint(("UDF: OpenCount = %x, RefCount = %x, LinkRefCount = %x\n",
+        UDFPrint(("UDF: not all references are closed\n"));
+        UDFPrint(("     Skipping cleanup\n"));
+        UDFPrint(("UDF: OpenCount = %x, RefCount = %x, LinkRefCount = %x\n",
                               FileInfo->OpenCount,FileInfo->RefCount,FileInfo->Dloc->LinkRefCount));
         return UDF_FREE_NOTHING;
     }
     if(FileInfo->Fcb) {
-        KdPrint(("Operating System still has references to this file\n"));
-        KdPrint(("     Skipping cleanup\n"));
+        UDFPrint(("Operating System still has references to this file\n"));
+        UDFPrint(("     Skipping cleanup\n"));
 //        BrutePoint();
         return UDF_FREE_NOTHING;
     }
@@ -2321,7 +2321,7 @@ UDFCleanUpFile__(
             // we can't delete modified file
             // it should be closed & reopened (or flushed) before deletion
             DirNdx = UDFDirIndex(hDirNdx,Index);
-            KdPrint(("Cleanup Mod: %s%s%s%s%s%s\n",
+            UDFPrint(("Cleanup Mod: %s%s%s%s%s%s\n",
                                  (Dloc->FE_Flags & UDF_FE_FLAG_FE_MODIFIED) ? "FE "       : "",
                                  (Dloc->DataLoc.Modified)                   ? "DataLoc "  : "",
                                  (Dloc->DataLoc.Flags & EXTENT_FLAG_PREALLOCATED) ? "Data-PreAlloc " : "",
@@ -2357,8 +2357,8 @@ UDFCleanUpFile__(
                 if(DirNdx->FileInfo) {
                     if(!KeepDloc) {
                         BrutePoint();
-                        KdPrint(("UDF: Found not cleaned up reference.\n"));
-                        KdPrint(("     Skipping cleanup (1)\n"));
+                        UDFPrint(("UDF: Found not cleaned up reference.\n"));
+                        UDFPrint(("     Skipping cleanup (1)\n"));
 //                        BrutePoint();
                         return UDF_FREE_NOTHING;
                     }
@@ -2389,7 +2389,7 @@ UDFCleanUpFile__(
             }
         }
         if(Dloc->SDirInfo) {
-            KdPrint(("UDF: Found not cleaned up reference (SDir).\n"));
+            UDFPrint(("UDF: Found not cleaned up reference (SDir).\n"));
 
             // (Update Child Objects - II)
             if(Dloc->SDirInfo->ParentFile == FileInfo) {
@@ -2402,7 +2402,7 @@ UDFCleanUpFile__(
             // place (in parallel object)
             if(!KeepDloc) {
                 BrutePoint();
-                KdPrint(("     Skipping cleanup\n"));
+                UDFPrint(("     Skipping cleanup\n"));
                 return UDF_FREE_NOTHING;
             }
 
@@ -2998,7 +2998,7 @@ UDFCloseFile__(
 
     if(!FileInfo) return STATUS_SUCCESS;
     if(FileInfo->Index<2 && (FileInfo->ParentFile) && !UDFIsAStreamDir(FileInfo)) {
-        KdPrint(("Closing Current or Parent Directory... :-\\\n"));
+        UDFPrint(("Closing Current or Parent Directory... :-\\\n"));
         if(FileInfo->RefCount) {
             UDFInterlockedDecrement((PLONG)&(FileInfo->RefCount));
             ASSERT(FileInfo->Dloc);
@@ -3007,7 +3007,7 @@ UDFCloseFile__(
 #ifdef UDF_DBG
         } else {
             BrutePoint();
-            KdPrint(("ERROR: Closing unreferenced file!\n"));
+            UDFPrint(("ERROR: Closing unreferenced file!\n"));
 #endif // UDF_DBG
         }
         if(FileInfo->ParentFile->OpenCount) {
@@ -3015,7 +3015,7 @@ UDFCloseFile__(
 #ifdef UDF_DBG
         } else {
             BrutePoint();
-            KdPrint(("ERROR: Closing unopened file!\n"));
+            UDFPrint(("ERROR: Closing unopened file!\n"));
 #endif // UDF_DBG
         }
         return STATUS_SUCCESS;
@@ -3031,7 +3031,7 @@ UDFCloseFile__(
 #ifdef UDF_DBG
     } else {
         BrutePoint();
-        KdPrint(("ERROR: Closing unreferenced file!\n"));
+        UDFPrint(("ERROR: Closing unreferenced file!\n"));
 #endif // UDF_DBG
     }
     if(DirInfo) {
@@ -3043,7 +3043,7 @@ UDFCloseFile__(
 #ifdef UDF_DBG
         } else {
             BrutePoint();
-            KdPrint(("ERROR: Closing unopened file!\n"));
+            UDFPrint(("ERROR: Closing unopened file!\n"));
 #endif // UDF_DBG
         }
     }
@@ -3056,7 +3056,7 @@ UDFCloseFile__(
 //    ASSERT(FileInfo->Dloc->FELoc.Mapping[0].extLocation);
     PartNum = UDFGetPartNumByPhysLba(Vcb, FileInfo->Dloc->FELoc.Mapping[0].extLocation);
     if(PartNum == (uint32)-1) {
-        KdPrint(("  Is DELETED ?\n"));
+        UDFPrint(("  Is DELETED ?\n"));
         if(DirInfo) {
             PartNum = UDFGetPartNumByPhysLba(Vcb, DirInfo->Dloc->FELoc.Mapping[0].extLocation);
         } else {
@@ -3070,7 +3070,7 @@ UDFCloseFile__(
         //ASSERT(FileInfo->Dloc->FELoc.Mapping[0].extLocation);
         if(UDFIsAStreamDir(FileInfo)) {
             if(!UDFIsSDirDeleted(FileInfo)) {
-                KdPrint(("  Not DELETED SDir\n"));
+                UDFPrint(("  Not DELETED SDir\n"));
                 BrutePoint();
             }
             ASSERT(!FileInfo->Dloc->FELoc.Modified);
@@ -3133,14 +3133,14 @@ UDFCloseFile__(
         }
 
         if(!OS_SUCCESS(status = UDFFlushFE(Vcb, FileInfo, PartNum))) {
-            KdPrint(("Error flushing FE\n"));
+            UDFPrint(("Error flushing FE\n"));
 //flush_recovery:
             BrutePoint();
             if(FileInfo->Index >= 2) {
                 PDIR_INDEX_ITEM DirNdx;
                 DirNdx = UDFDirIndex(UDFGetDirIndexByFileInfo(FileInfo), FileInfo->Index);
                 if(DirNdx) {
-                    KdPrint(("Recovery: mark as deleted & flush FI\n"));
+                    UDFPrint(("Recovery: mark as deleted & flush FI\n"));
                     DirNdx->FI_Flags |= UDF_FI_FLAG_FI_MODIFIED;
                     DirNdx->FileCharacteristics |= FILE_DELETED;
                     FileInfo->FileIdent->fileCharacteristics |= FILE_DELETED;
@@ -3152,7 +3152,7 @@ UDFCloseFile__(
     }
     // ... but FI must be updated (if any)
     if(!OS_SUCCESS(status = UDFFlushFI(Vcb, FileInfo, PartNum))) {
-        KdPrint(("Error flushing FI\n"));
+        UDFPrint(("Error flushing FI\n"));
         return status;
     }
 #ifdef UDF_DBG
@@ -3475,12 +3475,12 @@ UDFResizeFile__(
     int8* OldInIcb = NULL;
     PEXTENT_MAP NewMap;
 
-    KdPrint(("UDFResizeFile__: FI %x, -> %I64x\n", FileInfo, NewLength));
+    UDFPrint(("UDFResizeFile__: FI %x, -> %I64x\n", FileInfo, NewLength));
     ValidateFileInfo(FileInfo);
 //    ASSERT(FileInfo->RefCount >= 1);
 
     if((NewLength >> Vcb->LBlockSizeBits) > Vcb->TotalAllocUnits) {
-        KdPrint(("STATUS_DISK_FULL\n"));
+        UDFPrint(("STATUS_DISK_FULL\n"));
         return STATUS_DISK_FULL;
     }
     if (NewLength == FileInfo->Dloc->DataLoc.Length) return STATUS_SUCCESS;
@@ -3631,7 +3631,7 @@ UDFLoadVAT(
     }
     if((Vcb->LastTrackNum > 1) &&
        (Vcb->LastLBA == Vcb->TrackMap[Vcb->LastTrackNum-1].LastLba)) {
-        KdPrint(("Hardware Read-only volume\n"));
+        UDFPrint(("Hardware Read-only volume\n"));
         Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
     }
 
@@ -3655,7 +3655,7 @@ retry_load_vat:
     len = (uint32)UDFGetFileSize(VatFileInfo);
     if(Vcb->Partitions[PartNdx].PartitionType == UDF_VIRTUAL_MAP15) {
         // load Vat 1.50 header
-        KdPrint(("Load VAT 1.50\n"));
+        UDFPrint(("Load VAT 1.50\n"));
         VirtualAllocationTable15* Buf;
         if(((icbtag*)(VatFileInfo->Dloc->FileEntry+1))->fileType != UDF_FILE_TYPE_VAT15) {
             status = STATUS_FILE_CORRUPT_ERROR;
@@ -3687,7 +3687,7 @@ err_vat_15:
     } else
     if(Vcb->Partitions[PartNdx].PartitionType == UDF_VIRTUAL_MAP20) {
         // load Vat 2.00 header
-        KdPrint(("Load VAT 2.00\n"));
+        UDFPrint(("Load VAT 2.00\n"));
         VirtualAllocationTable20* Buf;
         if(((icbtag*)(VatFileInfo->Dloc->FileEntry+1))->fileType != UDF_FILE_TYPE_VAT20) {
             status = STATUS_FILE_CORRUPT_ERROR;
@@ -3709,7 +3709,7 @@ err_vat_15:
 
     } else {
         // unknown (or wrong) VAT format
-        KdPrint(("unknown (or wrong) VAT format\n"));
+        UDFPrint(("unknown (or wrong) VAT format\n"));
         status = STATUS_FILE_CORRUPT_ERROR;
         goto err_vat_15;
     }
@@ -3886,7 +3886,7 @@ UDFFlushFE(
     }
 #endif // UDF_DBG
 retry_flush_FE:
-    KdPrint(("  FlushFE: %x\n", FileInfo->Dloc->FELoc.Mapping[0].extLocation));
+    UDFPrint(("  FlushFE: %x\n", FileInfo->Dloc->FELoc.Mapping[0].extLocation));
 #ifndef UDF_READ_ONLY_BUILD
     UDFReTagDirectory(Vcb, FileInfo);
     if(FileInfo->Dloc->DataLoc.Modified ||
@@ -3894,7 +3894,7 @@ retry_flush_FE:
         ASSERT(PartNum != (uint32)(-1));
         // prepare new AllocDescs for flushing...
         if(!OS_SUCCESS(status = UDFBuildAllocDescs(Vcb, PartNum, FileInfo, &NewAllocDescs))) {
-            KdPrint(("  FlushFE: UDFBuildAllocDescs() faliled (%x)\n", status));
+            UDFPrint(("  FlushFE: UDFBuildAllocDescs() faliled (%x)\n", status));
             if(NewAllocDescs)
                 MyFreePool__(NewAllocDescs);
             return status;
@@ -3917,7 +3917,7 @@ retry_flush_FE:
             status = UDFWriteExtent(Vcb, &(FileInfo->Dloc->AllocLoc), 0, (uint32)(FileInfo->Dloc->AllocLoc.Length), FALSE, NewAllocDescs, &WrittenBytes);
             MyFreePool__(NewAllocDescs);
             if(!OS_SUCCESS(status)) {
-                KdPrint(("  FlushFE: UDFWriteExtent() faliled (%x)\n", status));
+                UDFPrint(("  FlushFE: UDFWriteExtent() faliled (%x)\n", status));
                 return status;
             }
 #ifdef UDF_DBG
@@ -3951,7 +3951,7 @@ retry_flush_FE:
         ASSERT(PartNum != (uint32)(-1));
         ASSERT(!PartNum);
         if(PartNum == (uint32)(-1) || PartNum == (uint32)(-2)) {
-            KdPrint(("  bad PartNum: %d\n", PartNum));
+            UDFPrint(("  bad PartNum: %d\n", PartNum));
         }
         // update lengthAllocDescs in FE
         UDFSetAllocDescLen(Vcb, FileInfo);
@@ -3976,17 +3976,17 @@ retry_flush_FE:
                   (uint32)(FileInfo->Dloc->FELoc.Length), FALSE,
                   (int8*)(FileInfo->Dloc->FileEntry), &WrittenBytes);
         if(!OS_SUCCESS(status)) {
-            KdPrint(("  FlushFE: UDFWriteExtent(2) faliled (%x)\n", status));
+            UDFPrint(("  FlushFE: UDFWriteExtent(2) faliled (%x)\n", status));
             if(status == STATUS_DEVICE_DATA_ERROR) {
 relocate_FE:
-                KdPrint(("  try to relocate\n"));
+                UDFPrint(("  try to relocate\n"));
 
                 EXTENT_INFO _FEExtInfo;
                 // calculate the length required
                 
                 // allocate block for FE
                 if(OS_SUCCESS(UDFAllocateFESpace(Vcb, FileInfo->ParentFile, PartNum, &_FEExtInfo, (uint32)(FileInfo->Dloc->FELoc.Length)) )) {
-                    KdPrint(("  relocate %x -> %x\n",
+                    UDFPrint(("  relocate %x -> %x\n",
                         lba,
                         _FEExtInfo.Mapping[0].extLocation));
 
@@ -4001,7 +4001,7 @@ relocate_FE:
 
                     AllocMode = ((PFILE_ENTRY)(FileInfo->Dloc->FileEntry))->icbTag.flags & ICB_FLAG_ALLOC_MASK;
                     if(AllocMode == ICB_FLAG_AD_IN_ICB) {
-                        KdPrint(("  IN-ICB data lost\n"));
+                        UDFPrint(("  IN-ICB data lost\n"));
                         FileInfo->Dloc->DataLoc.Mapping[0].extLocation = _FEExtInfo.Mapping[0].extLocation;
                         FileInfo->Dloc->DataLoc.Modified = TRUE;
                     } else {
@@ -4013,7 +4013,7 @@ relocate_FE:
                         PDIR_INDEX_ITEM DirNdx;
                         DirNdx = UDFDirIndex(UDFGetDirIndexByFileInfo(FileInfo), FileInfo->Index);
                         if(DirNdx) {
-                            KdPrint(("  update reference in FI\n"));
+                            UDFPrint(("  update reference in FI\n"));
                             DirNdx->FileEntryLoc.logicalBlockNum =
                                 FileInfo->FileIdent->icb.extLocation.logicalBlockNum =
                                 UDFPhysLbaToPart(Vcb, PartNum, _FEExtInfo.Mapping[0].extLocation);
@@ -4021,7 +4021,7 @@ relocate_FE:
                         }
                     }
                     // this will update 
-                    KdPrint(("  retry flush...\n"));
+                    UDFPrint(("  retry flush...\n"));
                     goto retry_flush_FE;
                 }
             }
@@ -4070,7 +4070,7 @@ UDFFlushFI(
         ASSERT(FileInfo->FileIdent->fileCharacteristics & FILE_DELETED);
     }
 #endif // UDF_DBG
-    KdPrint(("  FlushFI: offs %x\n", (ULONG)(DirNdx->Offset)));
+    UDFPrint(("  FlushFI: offs %x\n", (ULONG)(DirNdx->Offset)));
 #ifndef UDF_READ_ONLY_BUILD
     if((DirNdx->FI_Flags & UDF_FI_FLAG_FI_MODIFIED)) {
         // flush FileIdent
@@ -4129,7 +4129,7 @@ UDFFlushFile__(
     ASSERT(FileInfo->Dloc->FELoc.Mapping[0].extLocation);
     PartNum = UDFGetPartNumByPhysLba(Vcb, FileInfo->Dloc->FELoc.Mapping[0].extLocation);
     if(PartNum == (uint32)-1) {
-        KdPrint(("  Is DELETED ?\n"));
+        UDFPrint(("  Is DELETED ?\n"));
         if(FileInfo->ParentFile) {
             PartNum = UDFGetPartNumByPhysLba(Vcb, FileInfo->ParentFile->Dloc->FELoc.Mapping[0].extLocation);
         } else {
@@ -4142,7 +4142,7 @@ UDFFlushFile__(
 
         if(UDFIsAStreamDir(FileInfo)) {
             if(!UDFIsSDirDeleted(FileInfo)) {
-                KdPrint(("  Not DELETED SDir\n"));
+                UDFPrint(("  Not DELETED SDir\n"));
                 BrutePoint();
             }
             ASSERT(!FileInfo->Dloc->FELoc.Modified);
@@ -4180,10 +4180,10 @@ full_flush:
     }
     // flush FE
     if(!OS_SUCCESS(status = UDFFlushFE(Vcb, FileInfo, PartNum))) {
-        KdPrint(("Error flushing FE\n"));
+        UDFPrint(("Error flushing FE\n"));
         BrutePoint();
         if(FlushFlags & UDF_FLUSH_FLAGS_LITE) {
-            KdPrint(("  flush pre-alloc\n"));
+            UDFPrint(("  flush pre-alloc\n"));
             FlushFlags &= ~UDF_FLUSH_FLAGS_LITE;
             goto full_flush;
         }
@@ -4191,7 +4191,7 @@ full_flush:
             PDIR_INDEX_ITEM DirNdx;
             DirNdx = UDFDirIndex(UDFGetDirIndexByFileInfo(FileInfo), FileInfo->Index);
             if(DirNdx) {
-                KdPrint(("Recovery: mark as deleted & flush FI\n"));
+                UDFPrint(("Recovery: mark as deleted & flush FI\n"));
                 DirNdx->FI_Flags |= UDF_FI_FLAG_FI_MODIFIED;
                 DirNdx->FileCharacteristics |= FILE_DELETED;
                 FileInfo->FileIdent->fileCharacteristics |= FILE_DELETED;
@@ -4604,14 +4604,14 @@ UDFReadTagged(
     _SEH2_TRY {
         RC = UDFReadSectors(Vcb, FALSE, Block, 1, FALSE, Buf, &ReadBytes);
         if(!OS_SUCCESS(RC)) {
-            KdPrint(("UDF: Block=%x, Location=%x: read failed\n", Block, Location));
+            UDFPrint(("UDF: Block=%x, Location=%x: read failed\n", Block, Location));
             try_return(RC);
         }
 
         *Ident = PTag->tagIdent;
 
         if(Location != PTag->tagLocation) {
-            KdPrint(("UDF: location mismatch block %x, tag %x != %x\n",
+            UDFPrint(("UDF: location mismatch block %x, tag %x != %x\n",
                 Block, PTag->tagLocation, Location));
             try_return(RC = STATUS_FILE_CORRUPT_ERROR);
         }
@@ -4623,14 +4623,14 @@ UDFReadTagged(
             checksum += (uint8)((i!=4) ? (*tb) : 0);
 
         if(checksum != PTag->tagChecksum) {
-            KdPrint(("UDF: tag checksum failed block %x\n", Block));
+            UDFPrint(("UDF: tag checksum failed block %x\n", Block));
             try_return(RC = STATUS_CRC_ERROR);
         }
 
         // Verify the tag version
         if((PTag->descVersion != 2) &&
            (PTag->descVersion != 3)) {
-            KdPrint(("UDF: Tag version 0x%04x != 0x0002 || 0x0003 block %x\n",
+            UDFPrint(("UDF: Tag version 0x%04x != 0x0002 || 0x0003 block %x\n",
                 (PTag->descVersion), Block));
             try_return(RC = STATUS_FILE_CORRUPT_ERROR);
         }
@@ -4639,16 +4639,16 @@ UDFReadTagged(
         if(((PTag->descCRCLength) + sizeof(tag) > Vcb->BlockSize) ||
            ((PTag->descCRC) == UDFCrc((uint8*)Buf + sizeof(tag), PTag->descCRCLength)) ||
            !(PTag->descCRC) ) {
-    /*        KdPrint(("Tag ID: %x, ver %x\t", PTag->tagIdent, PTag->descVersion ));
+    /*        UDFPrint(("Tag ID: %x, ver %x\t", PTag->tagIdent, PTag->descVersion ));
             if((i == TID_FILE_ENTRY) ||
                (i == TID_EXTENDED_FILE_ENTRY)) {
-                KdPrint(("StrategType: %x, ", Icb->strategyType ));
-                KdPrint(("FileType: %x\t", Icb->fileType ));
+                UDFPrint(("StrategType: %x, ", Icb->strategyType ));
+                UDFPrint(("FileType: %x\t", Icb->fileType ));
             }
-            KdPrint(("\n"));*/
+            UDFPrint(("\n"));*/
             try_return(RC = STATUS_SUCCESS);
         }
-        KdPrint(("UDF: Crc failure block %x: crc = %x, crclen = %x\n",
+        UDFPrint(("UDF: Crc failure block %x: crc = %x, crclen = %x\n",
             Block, PTag->descCRC, PTag->descCRCLength));
         RC = STATUS_CRC_ERROR;
 
@@ -5323,7 +5323,7 @@ UDFUpdateVAT(
     uint16 PartNdx = (uint16)(Vcb->VatPartNdx);
     uint16 PartNum = (uint16)(Lba ? UDFGetPartNumByPhysLba(Vcb, Lba) : UDFGetPartNumByPartNdx(Vcb, PartNdx));
     if(PartNum != UDFGetPartNumByPartNdx(Vcb, PartNdx)) {
-        KdPrint(("UDFUpdateVAT: Write to Write-Protected partition\n"));
+        UDFPrint(("UDFUpdateVAT: Write to Write-Protected partition\n"));
         return STATUS_MEDIA_WRITE_PROTECTED;
     }
     // !!! NOTE !!!
index 66ef1f9..67c6ba3 100644 (file)
@@ -120,6 +120,7 @@ extern "C" {
 
 #define PEXTENDED_IO_STACK_LOCATION  PIO_STACK_LOCATION
 
+#define NDEBUG
 #ifndef NDEBUG
 #define UDF_DBG
 #endif
@@ -220,6 +221,13 @@ extern CCHAR   DefLetter[];
 ))
 
 
+#if !defined(UDF_DBG) && !defined(PRINT_ALWAYS)
+#define UDFPrint(Args)
+#else
+#define UDFPrint(Args) KdPrint(Args)
+#endif
+#define UDFPrintErr(Args) KdPrint(Args)
+
 // 
 #if !defined(UDF_DBG) && !defined(PRINT_ALWAYS)
 
index 627d40b..ca94387 100644 (file)
@@ -103,8 +103,8 @@ DriverEntry(
     HKEY            hUdfRootKey;
     LARGE_INTEGER   delay;
 
-//    KdPrint(("UDF: Entered " VER_STR_PRODUCT_NAME " UDF DriverEntry \n"));
-//    KdPrint((KD_PREFIX "Build " VER_STR_PRODUCT "\n"));
+//    UDFPrint(("UDF: Entered " VER_STR_PRODUCT_NAME " UDF DriverEntry \n"));
+//    UDFPrint((KD_PREFIX "Build " VER_STR_PRODUCT "\n"));
 
     _SEH2_TRY {
         _SEH2_TRY {
@@ -113,11 +113,11 @@ DriverEntry(
             CrNtInit(DriverObject, RegistryPath);
 
             //PsGetVersion(&MajorVersion, &MinorVersion, &BuildNumber, NULL);
-            KdPrint(("UDF: OS Version Major: %x, Minor: %x, Build number: %d\n",
+            UDFPrint(("UDF: OS Version Major: %x, Minor: %x, Build number: %d\n",
                                 MajorVersion, MinorVersion, BuildNumber));
 */
 #ifdef __REACTOS__
-            KdPrint(("UDF Init: OS should be ReactOS\n"));
+            UDFPrint(("UDF Init: OS should be ReactOS\n"));
 #endif
 
             // initialize the global data structure
@@ -145,7 +145,7 @@ DriverEntry(
             // initialize the mounted logical volume list head
             InitializeListHead(&(UDFGlobalData.VCBQueue));
 
-            KdPrint(("UDF: Init memory manager\n"));
+            UDFPrint(("UDF: Init memory manager\n"));
             // Initialize internal memory management
             if(!MyAllocInit()) {
                 try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
@@ -173,7 +173,7 @@ DriverEntry(
             RtlInitUnicodeString(&UDFGlobalData.UnicodeStrSDir, L":");
             RtlInitUnicodeString(&UDFGlobalData.AclName, UDF_SN_NT_ACL);
 
-            KdPrint(("UDF: Init delayed close queues\n"));
+            UDFPrint(("UDF: Init delayed close queues\n"));
 #ifdef UDF_DELAYED_CLOSE
             InitializeListHead( &UDFGlobalData.DelayedCloseQueue );
             InitializeListHead( &UDFGlobalData.DirDelayedCloseQueue );
@@ -193,11 +193,11 @@ DriverEntry(
 
             UDFGlobalData.DefaultZoneSizeInNumStructs=10;
 
-            KdPrint(("UDF: Init zones\n"));
+            UDFPrint(("UDF: Init zones\n"));
             if (!NT_SUCCESS(RC = UDFInitializeZones()))
                 try_return(RC);
 
-            KdPrint(("UDF: Init pointers\n"));
+            UDFPrint(("UDF: Init pointers\n"));
             // initialize the IRP major function table, and the fast I/O table
             UDFInitializeFunctionPointers(DriverObject);
 
@@ -212,7 +212,7 @@ DriverEntry(
 
             RtlInitUnicodeString(&DriverDeviceName, UDF_FS_NAME);
 
-            KdPrint(("UDF: Create Driver dev obj\n"));
+            UDFPrint(("UDF: Create Driver dev obj\n"));
             if (!NT_SUCCESS(RC = IoCreateDevice(
                     DriverObject,       // our driver object
                     sizeof(UDFFS_DEV_EXTENSION),  // don't need an extension for this object
@@ -239,7 +239,7 @@ DriverEntry(
             RtlInitUnicodeString(&unicodeDeviceName, UDF_DOS_FS_NAME);
             IoCreateSymbolicLink(&unicodeDeviceName, &DriverDeviceName);
 
-            KdPrint(("UDF: Create CD dev obj\n"));
+            UDFPrint(("UDF: Create CD dev obj\n"));
             if (!NT_SUCCESS(RC = UDFCreateFsDeviceObject(UDF_FS_NAME_CD,
                                     DriverObject,
                                     FILE_DEVICE_CD_ROM_FILE_SYSTEM,
@@ -248,7 +248,7 @@ DriverEntry(
                 try_return(RC);
             }
 #ifdef UDF_HDD_SUPPORT
-            KdPrint(("UDF: Create HDD dev obj\n"));
+            UDFPrint(("UDF: Create HDD dev obj\n"));
             if (!NT_SUCCESS(RC = UDFCreateFsDeviceObject(UDF_FS_NAME_HDD,
                                     DriverObject,
                                     FILE_DEVICE_DISK_FILE_SYSTEM,
@@ -300,18 +300,18 @@ DriverEntry(
 */
 
             if (UDFGlobalData.UDFDeviceObject_CD) {
-                KdPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for CD\n"));
+                UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for CD\n"));
                 IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_CD);
             }
 #ifdef UDF_HDD_SUPPORT
             if (UDFGlobalData.UDFDeviceObject_HDD) {
-                KdPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for HDD\n"));
+                UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for HDD\n"));
                 IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_HDD);
             }
 #endif // UDF_HDD_SUPPORT
             FsRegistered = TRUE;
 
-            KdPrint(("UDF: IoRegisterFsRegistrationChange()\n"));
+            UDFPrint(("UDF: IoRegisterFsRegistrationChange()\n"));
             IoRegisterFsRegistrationChange( DriverObject, (PDRIVER_FS_NOTIFICATION)UDFFsNotification );
 
 //            delay.QuadPart = -10000000;
@@ -323,12 +323,12 @@ DriverEntry(
 #if 0
             if(!WinVer_IsNT) {
                 /*ExInitializeWorkItem(&RemountWorkQueueItem, UDFRemountAll, NULL);
-                KdPrint(("UDFDriverEntry: create remount thread\n"));
+                UDFPrint(("UDFDriverEntry: create remount thread\n"));
                 ExQueueWorkItem(&RemountWorkQueueItem, DelayedWorkQueue);*/
 
                 for(CdRomNumber = 0;true;CdRomNumber++) {
                     sprintf(deviceNameBuffer, "\\Device\\CdRom%d", CdRomNumber);
-                    KdPrint(( "UDF: DriverEntry : dismount %s\n", deviceNameBuffer));
+                    UDFPrint(( "UDF: DriverEntry : dismount %s\n", deviceNameBuffer));
                     RtlInitString(&deviceName, deviceNameBuffer);
                     RC = RtlAnsiStringToUnicodeString(&unicodeCdRomDeviceName, &deviceName, TRUE);
 
@@ -358,7 +358,7 @@ DriverEntry(
 
         } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
             // we encountered an exception somewhere, eat it up
-            KdPrint(("UDF: exception\n"));
+            UDFPrint(("UDF: exception\n"));
             RC = _SEH2_GetExceptionCode();
         } _SEH2_END;
 
@@ -368,7 +368,7 @@ DriverEntry(
     } _SEH2_FINALLY {
         // start unwinding if we were unsuccessful
         if (!NT_SUCCESS(RC)) {
-            KdPrint(("UDF: failed with status %x\n", RC));
+            UDFPrint(("UDF: failed with status %x\n", RC));
             // Now, delete any device objects, etc. we may have created
 /*            if (UDFGlobalData.UDFDeviceObject) {
                 IoDeleteDevice(UDFGlobalData.UDFDeviceObject);
@@ -598,7 +598,7 @@ UDFCreateFsDeviceObject(
     RtlInitUnicodeString(&DriverDeviceName, FsDeviceName);
     *DeviceObject = NULL;
 
-    KdPrint(("UDFCreateFsDeviceObject: create dev\n"));
+    UDFPrint(("UDFCreateFsDeviceObject: create dev\n"));
 
     if (!NT_SUCCESS(RC = IoCreateDevice(
             DriverObject,                   // our driver object
@@ -624,7 +624,7 @@ UDFCreateFsDeviceObject(
     // register the driver with the I/O Manager, pretend as if this is
     //  a physical disk based FSD (or in order words, this FSD manages
     //  logical volumes residing on physical disk drives)
-/*    KdPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem()\n"));
+/*    UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem()\n"));
     IoRegisterFileSystem(*DeviceObject);*/
     return(RC);
 } // end UDFCreateFsDeviceObject()
@@ -653,7 +653,7 @@ UDFDismountDevice(
                                      NULL,
                                      NULL );
 
-        KdPrint(("\n*** UDFDismountDevice: Create\n"));
+        UDFPrint(("\n*** UDFDismountDevice: Create\n"));
         RC = ZwCreateFile( &NtFileHandle,
                            GENERIC_READ,
                            &ObjectAttributes,
@@ -669,7 +669,7 @@ UDFDismountDevice(
 
         if (!NT_SUCCESS(RC)) try_return(RC);
                   
-        KdPrint(("\n*** UDFDismountDevice: QueryVolInfo\n"));
+        UDFPrint(("\n*** UDFDismountDevice: QueryVolInfo\n"));
         RC = ZwQueryVolumeInformationFile( NtFileHandle,
                                            &IoStatus,
                                            Buffer,
@@ -689,7 +689,7 @@ UDFDismountDevice(
             UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_DVDpRW) ||
             UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_DVDRAM) )) try_return(STATUS_SUCCESS);
         
-        KdPrint(("\n*** UDFDismountDevice: LockVolume\n"));
+        UDFPrint(("\n*** UDFDismountDevice: LockVolume\n"));
         RC = ZwFsControlFile(NtFileHandle,
                              NULL,
                              NULL,
@@ -703,7 +703,7 @@ UDFDismountDevice(
 
         if (!NT_SUCCESS(RC)) try_return(RC);
 
-        KdPrint(("\n*** UDFDismountDevice: DismountVolume\n"));
+        UDFPrint(("\n*** UDFDismountDevice: DismountVolume\n"));
         RC = ZwFsControlFile(NtFileHandle,
                              NULL,
                              NULL,
@@ -717,7 +717,7 @@ UDFDismountDevice(
 
         if (!NT_SUCCESS(RC)) try_return(RC);
 
-        KdPrint(("\n*** UDFDismountDevice: NotifyMediaChange\n"));
+        UDFPrint(("\n*** UDFDismountDevice: NotifyMediaChange\n"));
         RC = ZwDeviceIoControlFile(NtFileHandle,
                                    NULL,
                                    NULL,
@@ -732,7 +732,7 @@ UDFDismountDevice(
         if (!NT_SUCCESS(RC)) try_return(RC);
         
         
-        KdPrint(("\n*** UDFDismountDevice: UnlockVolume\n"));
+        UDFPrint(("\n*** UDFDismountDevice: UnlockVolume\n"));
         RC = ZwFsControlFile(NtFileHandle,
                              NULL,
                              NULL,
@@ -744,12 +744,12 @@ UDFDismountDevice(
                              NULL,
                              NULL);
 
-        KdPrint(("\n*** UDFDismountDevice: Close\n"));
+        UDFPrint(("\n*** UDFDismountDevice: Close\n"));
         ZwClose( NtFileHandle );
         
         NtFileHandle = (HANDLE)-1;
 
-        KdPrint(("\n*** UDFDismountDevice: Create 2\n"));
+        UDFPrint(("\n*** UDFDismountDevice: Create 2\n"));
         RC = ZwCreateFile( &NtFileHandle,
                            GENERIC_READ,
                            &ObjectAttributes,
@@ -769,7 +769,7 @@ try_exit: NOTHING;
         if (NtFileHandle != (HANDLE)-1) ZwClose( NtFileHandle );
     } _SEH2_END;
 
-    KdPrint(("\n*** UDFDismountDevice: RC=%x\n",RC));
+    UDFPrint(("\n*** UDFDismountDevice: RC=%x\n",RC));
     return RC;
 }
 
@@ -825,7 +825,7 @@ Return Value:
         && UDFGlobalData.UDFDeviceObject_HDD != DeviceObject
 #endif // UDF_HDD_SUPPORT
     ) {
-        KdPrint(("\n*** UDFFSNotification \n\n"));
+        UDFPrint(("\n*** UDFFSNotification \n\n"));
 
         // Acquire GlobalDataResource
         UDFAcquireResourceExclusive(&(UDFGlobalData.GlobalDataResource), TRUE);
@@ -845,7 +845,7 @@ Return Value:
             FsNotification_ThreadId = (HANDLE)(-1);
 
         } else {
-            KdPrint(("\n*** recursive UDFFSNotification call,\n can't become top-level UDF FSD \n\n"));
+            UDFPrint(("\n*** recursive UDFFSNotification call,\n can't become top-level UDF FSD \n\n"));
         }
 
         // Release the global resource.
@@ -872,7 +872,7 @@ UDFRemountAll(
     
 /*    for(CdRomNumber = 0;true;CdRomNumber++) {
         sprintf(deviceNameBuffer, "\\Device\\CdRom%d", CdRomNumber);
-        KdPrint(( "UDF: UDFRemountAll : dismount %s\n", deviceNameBuffer));
+        UDFPrint(( "UDF: UDFRemountAll : dismount %s\n", deviceNameBuffer));
         RtlInitString(&deviceName, deviceNameBuffer);
         RC = RtlAnsiStringToUnicodeString(&unicodeCdRomDeviceName, &deviceName, TRUE);
 
index 43ba121..a9c15bf 100644 (file)
@@ -22,7 +22,7 @@ UDFDriverUnload(
     // significant amount of work here deallocating stuff.
     //
 
-    KdPrint( ("UDF: Unloading!!\n") );
+    UDFPrint( ("UDF: Unloading!!\n") );
 
     // prevent mount oparations
     UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_BEING_UNLOADED;
@@ -30,7 +30,7 @@ UDFDriverUnload(
     // wait for all volumes to be dismounted
     delay.QuadPart = 10*1000*1000*10;
     while(TRUE) {
-        KdPrint(("Poll...\n"));
+        UDFPrint(("Poll...\n"));
         KeDelayExecutionThread(KernelMode, FALSE, &delay);
     }
 
index 600656c..3662fca 100644 (file)
@@ -45,7 +45,7 @@ UDFVerifyVcb(
     BOOLEAN Nop = TRUE;
     BOOLEAN UnsafeIoctl = (Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL) ? TRUE : FALSE;
 
-    KdPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
+    UDFPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
     //  Fail immediately if the volume is in the progress of being dismounted
     //  or has been marked invalid.
     if (Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED) { 
@@ -58,7 +58,7 @@ UDFVerifyVcb(
     if ( (Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA) &&
         !(Vcb->Vpb->RealDevice->Flags & DO_VERIFY_VOLUME) &&
         (!(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) || UnsafeIoctl) ) {
-        KdPrint(("UDFVerifyVCB: UnsafeIoctl=%d, locked=%d\n", UnsafeIoctl, (Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) ? 0 : 1));
+        UDFPrint(("UDFVerifyVCB: UnsafeIoctl=%d, locked=%d\n", UnsafeIoctl, (Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) ? 0 : 1));
         Vcb->VCBFlags &= ~UDF_VCB_FLAGS_UNSAFE_IOCTL;
         RC = UDFTSendIOCTL( IOCTL_STORAGE_CHECK_VERIFY,
                                      Vcb,
@@ -68,7 +68,7 @@ UDFVerifyVcb(
     
         //  Be safe about the count in case the driver didn't fill it in
         if (Iosb.Information != sizeof(ULONG))  MediaChangeCount = 0;
-        KdPrint(("  MediaChangeCount %d -> %d\n", Vcb->MediaChangeCount, MediaChangeCount));
+        UDFPrint(("  MediaChangeCount %d -> %d\n", Vcb->MediaChangeCount, MediaChangeCount));
 
         //  If the volume is now an empty device, or we have receieved a
         //  bare STATUS_VERIFY_REQUIRED (various hardware conditions such
@@ -81,7 +81,7 @@ UDFVerifyVcb(
              (NT_SUCCESS(RC) && (Vcb->MediaChangeCount != MediaChangeCount)) ||
              UnsafeIoctl) {
 
-            KdPrint(("  set DO_VERIFY_VOLUME\n"));
+            UDFPrint(("  set DO_VERIFY_VOLUME\n"));
             Vcb->Vpb->RealDevice->Flags |= DO_VERIFY_VOLUME;
 
             //  If the volume is not mounted and we got a media change count,
@@ -97,45 +97,45 @@ UDFVerifyVcb(
 
         } else if (!NT_SUCCESS(RC)) {
 //            Vcb->Vpb->RealDevice->Flags |= DO_VERIFY_VOLUME;
-            KdPrint(("  UDFNormalizeAndRaiseStatus(%x)\n", RC));
+            UDFPrint(("  UDFNormalizeAndRaiseStatus(%x)\n", RC));
             UDFNormalizeAndRaiseStatus(IrpContext,RC);
             ASSERT(Nop);
         }
     }
 
-    KdPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
+    UDFPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
     //  The Vcb may be mounted but the underlying real device may need to be verified.
     //  If it does then we'll set the Iosb in the irp to be our real device
     if (Vcb->Vpb->RealDevice->Flags & DO_VERIFY_VOLUME) {
 
-        KdPrint(("  DO_VERIFY_VOLUME -> IoSetHardErrorOrVerifyDevice()\n"));
+        UDFPrint(("  DO_VERIFY_VOLUME -> IoSetHardErrorOrVerifyDevice()\n"));
         IoSetHardErrorOrVerifyDevice( IrpContext->Irp,
                                       Vcb->Vpb->RealDevice );
 
         RC = STATUS_VERIFY_REQUIRED;
-        KdPrint(("  UDFRaiseStatus()\n"));
+        UDFPrint(("  UDFRaiseStatus()\n"));
         UDFRaiseStatus(IrpContext, RC);
         ASSERT(Nop);
     }
 
-    KdPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
+    UDFPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
     if (!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
-        KdPrint(("  !UDF_VCB_FLAGS_VOLUME_MOUNTED -> IoSetHardErrorOrVerifyDevice()\n"));
+        UDFPrint(("  !UDF_VCB_FLAGS_VOLUME_MOUNTED -> IoSetHardErrorOrVerifyDevice()\n"));
         Vcb->Vpb->RealDevice->Flags |= DO_VERIFY_VOLUME;
         IoSetHardErrorOrVerifyDevice( IrpContext->Irp, Vcb->Vpb->RealDevice );
         RC = STATUS_WRONG_VOLUME;
-        KdPrint(("  UDFRaiseStatus()\n"));
+        UDFPrint(("  UDFRaiseStatus()\n"));
         UDFRaiseStatus(IrpContext, RC);
 //        UDFRaiseStatus(IrpContext, STATUS_UNRECOGNIZED_VOLUME);
         ASSERT(Nop);
     }
     if ((Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED)) {
-        KdPrint(("  UDF_VCB_FLAGS_BEING_DISMOUNTED\n"));
+        UDFPrint(("  UDF_VCB_FLAGS_BEING_DISMOUNTED\n"));
         RC = STATUS_FILE_INVALID;
         UDFRaiseStatus( IrpContext, RC );
         ASSERT(Nop);
     }
-    KdPrint(("UDFVerifyVcb: RC = %x\n", RC));
+    UDFPrint(("UDFVerifyVcb: RC = %x\n", RC));
 
     return RC;
 } // end UDFVerifyVcb()
@@ -172,7 +172,7 @@ UDFVerifyVolume(
     //  Update the real device in the IrpContext from the Vpb.  There was no available
     //  file object when the IrpContext was created.
     //    IrpContext->RealDevice = Vpb->RealDevice;
-    KdPrint(("UDFVerifyVolume:\n"));
+    UDFPrint(("UDFVerifyVolume:\n"));
 
     //  Acquire shared global access, the termination handler for the
     //  following try statement will free the access.
@@ -182,14 +182,14 @@ UDFVerifyVolume(
 
     _SEH2_TRY {
 
-        KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+        UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
         // Check if the real device still needs to be verified.  If it doesn't
         // then obviously someone beat us here and already did the work
         // so complete the verify irp with success.  Otherwise reenable
         // the real device and get to work.
         if( !(Vpb->RealDevice->Flags & DO_VERIFY_VOLUME) &&
             ((Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) && !UnsafeIoctl) ) {
-            KdPrint(("UDFVerifyVolume: STATUS_SUCCESS (1)\n"));
+            UDFPrint(("UDFVerifyVolume: STATUS_SUCCESS (1)\n"));
             try_return(RC = STATUS_SUCCESS);
         }
         Vcb->VCBFlags &= ~UDF_VCB_FLAGS_UNSAFE_IOCTL;
@@ -204,12 +204,12 @@ UDFVerifyVolume(
             // If we will allow a raw mount then return WRONG_VOLUME to
             // allow the volume to be mounted by raw.
             if(FlagOn( IrpSp->Flags, SL_ALLOW_RAW_MOUNT )) {
-                KdPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (1)\n"));
+                UDFPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (1)\n"));
                 RC = STATUS_WRONG_VOLUME;
             }
 
             if(UDFIsRawDevice(RC)) {
-                KdPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (2)\n"));
+                UDFPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (2)\n"));
                 RC = STATUS_WRONG_VOLUME;
             }
             try_return( RC );
@@ -220,8 +220,8 @@ UDFVerifyVolume(
             MediaChangeCount = 0;
         }
 
-        KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
-        KdPrint(("UDFVerifyVolume: MediaChangeCount=%x, Vcb->MediaChangeCount=%x, UnsafeIoctl=%x\n",
+        UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+        UDFPrint(("UDFVerifyVolume: MediaChangeCount=%x, Vcb->MediaChangeCount=%x, UnsafeIoctl=%x\n",
             MediaChangeCount, Vcb->MediaChangeCount, UnsafeIoctl));
         // Verify that the device actually saw a change. If the driver does not
         // support the MCC, then we must verify the volume in any case.
@@ -229,7 +229,7 @@ UDFVerifyVolume(
             (Vcb->MediaChangeCount != MediaChangeCount) ||
            UnsafeIoctl ) {
 
-            KdPrint(("UDFVerifyVolume: compare\n"));
+            UDFPrint(("UDFVerifyVolume: compare\n"));
 
             NewVcb = (PVCB)MyAllocatePool__(NonPagedPool,sizeof(VCB));
             if(!NewVcb)
@@ -251,13 +251,13 @@ UDFVerifyVolume(
             NewVcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY |
                                 UDF_VCB_FLAGS_MEDIA_READ_ONLY;
             // Compare physical parameters (phase 1)
-            KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+            UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
             RC = UDFCompareVcb(Vcb,NewVcb, TRUE);
             if(!NT_SUCCESS(RC)) try_return(RC);
 
             if((Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) &&
                 Vcb->MountPhErrorCount > MOUNT_ERR_THRESHOLD ) {
-                KdPrint(("UDFVerifyVolume: it was very BAD volume. Do not perform Logical check\n"));
+                UDFPrint(("UDFVerifyVolume: it was very BAD volume. Do not perform Logical check\n"));
                 goto skip_logical_check;
             }
             // Initialize internal cache
@@ -285,14 +285,14 @@ UDFVerifyVolume(
                               UDFWCacheErrorHandler);
             if(!NT_SUCCESS(RC)) try_return(RC);
 
-            KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+            UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
             RC = UDFGetDiskInfoAndVerify(NewVcb->TargetDeviceObject,NewVcb);
-            KdPrint(("  NewVcb->NSRDesc=%x\n", NewVcb->NSRDesc));
+            UDFPrint(("  NewVcb->NSRDesc=%x\n", NewVcb->NSRDesc));
             if(!NT_SUCCESS(RC)) {
                 if((Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) &&
                    (NewVcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) &&
                    !(NewVcb->NSRDesc & VRS_ISO9660_FOUND)) {
-                    KdPrint(("UDFVerifyVolume: both are RAW -> remount\n", Vcb->Modified));
+                    UDFPrint(("UDFVerifyVolume: both are RAW -> remount\n", Vcb->Modified));
                     RC = STATUS_SUCCESS;
                     goto skip_logical_check;
                 }
@@ -308,7 +308,7 @@ UDFVerifyVolume(
 
             NewVcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_MOUNTED;
             // Compare logical parameters (phase 2)
-            KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+            UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
             RC = UDFCompareVcb(Vcb,NewVcb, FALSE);
             if(!NT_SUCCESS(RC)) try_return(RC);
             // We have unitialized WCache, so it is better to
@@ -320,10 +320,10 @@ skip_logical_check:;
 
         }
 
-        KdPrint(("UDFVerifyVolume: compared\n"));
-        KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+        UDFPrint(("UDFVerifyVolume: compared\n"));
+        UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
         if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_LOCKED)) {
-            KdPrint(("UDFVerifyVolume: set UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
+            UDFPrint(("UDFVerifyVolume: set UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
             Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_MOUNTED;
             Vcb->SoftEjectReq = FALSE;
         }
@@ -339,7 +339,7 @@ try_exit: NOTHING;
 
         // If we got the wrong volume, mark the Vcb as not mounted.
         if(RC == STATUS_WRONG_VOLUME) {
-            KdPrint(("UDFVerifyVolume: clear UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
+            UDFPrint(("UDFVerifyVolume: clear UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
             Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
             Vcb->WriteSecurity = FALSE;
 //            ASSERT(!(Vcb->EjectWaiter));
@@ -352,7 +352,7 @@ try_exit: NOTHING;
         if(NT_SUCCESS(RC) &&
            (Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)){
             BOOLEAN CacheInitialized = FALSE;
-            KdPrint(("    !!! VerifyVolume - QUICK REMOUNT !!!\n"));
+            UDFPrint(("    !!! VerifyVolume - QUICK REMOUNT !!!\n"));
             // Initialize internal cache
             CacheInitialized = WCacheIsInitialized__(&(Vcb->FastCache));
             if(!CacheInitialized) {
@@ -390,10 +390,10 @@ try_exit: NOTHING;
                         if(!Vcb->CDR_Mode) {
                             if((Vcb->TargetDeviceObject->DeviceType == FILE_DEVICE_DISK) ||
                                CdrwMediaClassEx_IsRAM(Vcb->MediaClassEx)) {
-                                KdPrint(("UDFMountVolume: RAM mode\n"));
+                                UDFPrint(("UDFMountVolume: RAM mode\n"));
                                 Mode = WCACHE_MODE_RAM;
                             } else {
-                                KdPrint(("UDFMountVolume: RW mode\n"));
+                                UDFPrint(("UDFMountVolume: RW mode\n"));
                                 Mode = WCACHE_MODE_RW;
                             }
         /*                    if(FsDeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM) {
@@ -415,10 +415,10 @@ try_exit: NOTHING;
                     Vcb->WriteSecurity = FALSE;
                     Vcb->UseExtendedFE = FALSE;
                 }
-                KdPrint(("UDFVerifyVolume: try start EjectWaiter\n"));
+                UDFPrint(("UDFVerifyVolume: try start EjectWaiter\n"));
                 RC = UDFStartEjectWaiter(Vcb);
                 if(!NT_SUCCESS(RC)) {
-                    KdPrint(("UDFVerifyVolume: start EjectWaiter failed\n"));
+                    UDFPrint(("UDFVerifyVolume: start EjectWaiter failed\n"));
                     Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
                     Vcb->WriteSecurity = FALSE;
                 }
@@ -427,7 +427,7 @@ try_exit: NOTHING;
 
         if(NewVcb) {
             // Release internal cache
-            KdPrint(("UDFVerifyVolume: delete NewVcb\n"));
+            UDFPrint(("UDFVerifyVolume: delete NewVcb\n"));
             WCacheFlushAll__(&(NewVcb->FastCache),NewVcb);
             WCacheRelease__(&(NewVcb->FastCache));
 
@@ -449,7 +449,7 @@ try_exit: NOTHING;
     Irp->IoStatus.Status = RC;
     IoCompleteRequest(Irp,IO_DISK_INCREMENT);
 
-    KdPrint(("UDFVerifyVolume: RC = %x\n", RC));
+    UDFPrint(("UDFVerifyVolume: RC = %x\n", RC));
 
     return RC;
 } // end UDFVerifyVolume ()
@@ -480,7 +480,7 @@ UDFPerformVerify(
     NTSTATUS RC = STATUS_SUCCESS;
     PIO_STACK_LOCATION IrpSp;
 
-    KdPrint(("UDFPerformVerify:\n"));
+    UDFPrint(("UDFPerformVerify:\n"));
     if(!IrpContext) return STATUS_INVALID_PARAMETER;
     if(!Irp) return STATUS_INVALID_PARAMETER;
 
@@ -506,7 +506,7 @@ UDFPerformVerify(
 
     Vcb = (PVCB)IrpSp->DeviceObject->DeviceExtension;
 
-    KdPrint(("UDFPerformVerify: check\n"));
+    UDFPrint(("UDFPerformVerify: check\n"));
     //  Check if the volume still thinks it needs to be verified,
     //  if it doesn't then we can skip doing a verify because someone
     //  else beat us to it.
@@ -547,7 +547,7 @@ UDFPerformVerify(
                    (Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED)) &&
                    (Vcb->VCBOpenCount <= UDF_RESIDUAL_REFERENCE) )
             {
-                KdPrint(("UDFPerformVerify: UDFCheckForDismount\n"));
+                UDFPrint(("UDFPerformVerify: UDFCheckForDismount\n"));
                 UDFAcquireResourceExclusive(&(UDFGlobalData.GlobalDataResource), TRUE);
                 UDFCheckForDismount( IrpContext, Vcb, FALSE );
                 UDFReleaseResource(&(UDFGlobalData.GlobalDataResource));
@@ -559,7 +559,7 @@ UDFPerformVerify(
                 (IrpSp->FileObject->RelatedFileObject == NULL) &&
                 ((RC == STATUS_SUCCESS) || (RC == STATUS_WRONG_VOLUME)) ) {
 
-                KdPrint(("UDFPerformVerify: IO_REMOUNT\n"));
+                UDFPrint(("UDFPerformVerify: IO_REMOUNT\n"));
 
                 Irp->IoStatus.Information = IO_REMOUNT;
 
@@ -576,12 +576,12 @@ UDFPerformVerify(
             //  for a popup.
             } else if ((Irp != NULL) && !NT_SUCCESS( RC )) {
 
-                KdPrint(("UDFPerformVerify: check IoIsErrorUserInduced\n"));
+                UDFPrint(("UDFPerformVerify: check IoIsErrorUserInduced\n"));
                 //  Fill in the device object if required.
                 if (IoIsErrorUserInduced( RC ) ) {
                     IoSetHardErrorOrVerifyDevice( Irp, DeviceToVerify );
                 }
-                KdPrint(("UDFPerformVerify: UDFNormalizeAndRaiseStatus\n"));
+                UDFPrint(("UDFPerformVerify: UDFNormalizeAndRaiseStatus\n"));
                 UDFNormalizeAndRaiseStatus( IrpContext, RC );
             }
         }
@@ -599,7 +599,7 @@ UDFPerformVerify(
         RC = UDFExceptionHandler( IrpContext, Irp);
     } _SEH2_END;
 
-    KdPrint(("UDFPerformVerify: RC = %x\n", RC));
+    UDFPrint(("UDFPerformVerify: RC = %x\n", RC));
 
     return RC;
     
@@ -637,7 +637,7 @@ UDFCheckForDismount(
     BOOLEAN VcbAcquired;
     ULONG ResidualReferenceCount;
 
-    KdPrint(("UDFCheckForDismount:\n"));
+    UDFPrint(("UDFCheckForDismount:\n"));
     if(!Vcb) return FALSE;
 
     //  GlobalDataResource is already acquired
@@ -737,7 +737,7 @@ UDFDismountVcb(
 
     BOOLEAN FinalReference;
 
-    KdPrint(("UDFDismountVcb:\n"));
+    UDFPrint(("UDFDismountVcb:\n"));
     //  We should only take this path once.
     ASSERT( !(Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED) );
 
@@ -856,9 +856,9 @@ UDFCompareVcb(
     UDF_FILE_INFO    RootFileInfo;
     BOOLEAN SimpleLogicalCheck = FALSE;
 
-    KdPrint(("UDFCompareVcb:\n"));
+    UDFPrint(("UDFCompareVcb:\n"));
     if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_BEING_UNLOADED) {
-        KdPrint(("  WRONG_VOLUME\n"));
+        UDFPrint(("  WRONG_VOLUME\n"));
         return STATUS_WRONG_VOLUME;
     }
 
@@ -866,7 +866,7 @@ UDFCompareVcb(
 
     // compare physical parameters
     if(PhysicalOnly) {
-        KdPrint(("  PhysicalOnly\n"));
+        UDFPrint(("  PhysicalOnly\n"));
         if(VCB_NE(FirstLBA) ||
            VCB_NE(LastLBA) ||
            VCB_NE(FirstTrackNum) ||
@@ -888,13 +888,13 @@ UDFCompareVcb(
     //       VCB_NE(xxx) ||
            VCB_NE(LastSession) ) {
 
-            KdPrint(("  WRONG_VOLUME (2)\n"));
+            UDFPrint(("  WRONG_VOLUME (2)\n"));
             return STATUS_WRONG_VOLUME;
         }
         // Note, MRWStatus can change while media is mounted (stoppped/in-progress/complete)
         // We can compare only (Vcb->MRWStatus == 0) values
         if((OldVcb->MRWStatus == 0) != (NewVcb->MRWStatus == 0)) {
-            KdPrint(("  WRONG_VOLUME (4), missmatch MRW status\n"));
+            UDFPrint(("  WRONG_VOLUME (4), missmatch MRW status\n"));
         }
         for(uint32 i=OldVcb->FirstTrackNum; i<=OldVcb->LastTrackNum; i++) {
             if(VCB_NE(TrackMap[i].FirstLba) ||
@@ -903,11 +903,11 @@ UDFCompareVcb(
                VCB_NE(TrackMap[i].TrackParam) ||
                VCB_NE(TrackMap[i].DataParam) ||
                VCB_NE(TrackMap[i].NWA_V) ) {
-                KdPrint(("  WRONG_VOLUME (3), missmatch trk %d\n", i));
+                UDFPrint(("  WRONG_VOLUME (3), missmatch trk %d\n", i));
                 return STATUS_WRONG_VOLUME;
             }
         }
-        KdPrint(("  Vcb compare Ok\n"));
+        UDFPrint(("  Vcb compare Ok\n"));
         return STATUS_SUCCESS;
     }
 
@@ -917,48 +917,48 @@ UDFCompareVcb(
     // Now, we hope, that nobody changed media.
     // We shall make simplified logical structure check
     if(OldVcb->Modified) {
-        KdPrint(("  Vcb SIMPLE compare on !!!MODIFIED!!! volume\n"));
+        UDFPrint(("  Vcb SIMPLE compare on !!!MODIFIED!!! volume\n"));
         ASSERT(FALSE);
         SimpleLogicalCheck = TRUE;
     }
 
     // compare logical structure
     if(!SimpleLogicalCheck && (OldVcb->InitVatCount != NewVcb->InitVatCount)) {
-        KdPrint(("  InitVatCount %d != %d \n", OldVcb->InitVatCount, NewVcb->InitVatCount));
+        UDFPrint(("  InitVatCount %d != %d \n", OldVcb->InitVatCount, NewVcb->InitVatCount));
         return STATUS_WRONG_VOLUME;
     }
 
     // Compare volume creation time
     if(OldVcb->VolCreationTime != NewVcb->VolCreationTime) {
-        KdPrint(("  VolCreationTime %I64x != %I64x \n", OldVcb->VolCreationTime, NewVcb->VolCreationTime));
+        UDFPrint(("  VolCreationTime %I64x != %I64x \n", OldVcb->VolCreationTime, NewVcb->VolCreationTime));
         return STATUS_WRONG_VOLUME;
     }
     // Compare serial numbers 
     if(OldVcb->SerialNumber != NewVcb->SerialNumber) {
-        KdPrint(("  SerialNumber %x != %x \n", OldVcb->SerialNumber, NewVcb->SerialNumber));
+        UDFPrint(("  SerialNumber %x != %x \n", OldVcb->SerialNumber, NewVcb->SerialNumber));
         return STATUS_WRONG_VOLUME;
     }   
     // Compare volume idents
     if(!SimpleLogicalCheck &&
        RtlCompareUnicodeString(&(OldVcb->VolIdent),&(NewVcb->VolIdent),FALSE)) {
-        KdPrint(("  VolIdent missmatch \n"));
+        UDFPrint(("  VolIdent missmatch \n"));
         return STATUS_WRONG_VOLUME;
     }
     if(SimpleLogicalCheck) {
         // do not touch RootDir. It can be partially recorded
-        KdPrint(("  SimpleLogicalCheck Ok\n"));
+        UDFPrint(("  SimpleLogicalCheck Ok\n"));
         return STATUS_SUCCESS;
     }
 
     RC = UDFOpenRootFile__(NewVcb, &(NewVcb->RootLbAddr), &RootFileInfo);
     if(!NT_SUCCESS(RC)) {
-        KdPrint(("  Can't open root file, status %x\n", RC));
+        UDFPrint(("  Can't open root file, status %x\n", RC));
         UDFCleanUpFile__(NewVcb, &RootFileInfo);
         return STATUS_WRONG_VOLUME;
     }
     // perform exhaustive check
     if(!(OldVcb->RootDirFCB)) {
-        KdPrint(("  !(OldVcb->RootDirFCB)\n"));
+        UDFPrint(("  !(OldVcb->RootDirFCB)\n"));
 wr_vol:
         UDFCloseFile__(NewVcb, &RootFileInfo);
         UDFCleanUpFile__(NewVcb, &RootFileInfo);
@@ -966,13 +966,13 @@ wr_vol:
     }
 
     if(!UDFCompareFileInfo(&RootFileInfo, OldVcb->RootDirFCB->FileInfo)) {
-        KdPrint(("  !UDFCompareFileInfo\n"));
+        UDFPrint(("  !UDFCompareFileInfo\n"));
         goto wr_vol;
     }
     UDFCloseFile__(NewVcb, &RootFileInfo);
     UDFCleanUpFile__(NewVcb, &RootFileInfo);
 
-    KdPrint(("UDFCompareVcb: Ok\n"));
+    UDFPrint(("UDFCompareVcb: Ok\n"));
     return STATUS_SUCCESS;
 
 #undef VCB_NE
index 5d6c045..2197fb2 100644 (file)
@@ -92,7 +92,7 @@ UDFQueryVolInfo(
     PtrUDFIrpContext    PtrIrpContext = NULL;
     BOOLEAN             AreWeTopLevel = FALSE;
 
-    KdPrint(("UDFQueryVolInfo: \n"));
+    UDFPrint(("UDFQueryVolInfo: \n"));
 
     FsRtlEnterFileSystem();
     ASSERT(DeviceObject);
@@ -164,7 +164,7 @@ UDFCommonQueryVolInfo(
 
     _SEH2_TRY {
 
-        KdPrint(("UDFCommonQueryVolInfo: \n"));
+        UDFPrint(("UDFCommonQueryVolInfo: \n"));
 
         ASSERT(PtrIrpContext);
         ASSERT(Irp);
@@ -306,11 +306,11 @@ UDFQueryFsVolumeInfo(
 
     PAGED_CODE();
 
-    KdPrint(("  UDFQueryFsVolumeInfo: \n"));
+    UDFPrint(("  UDFQueryFsVolumeInfo: \n"));
     //  Fill in the data from the Vcb.
     Buffer->VolumeCreationTime.QuadPart = Vcb->VolCreationTime;
     Buffer->VolumeSerialNumber = Vcb->PhSerialNumber;
-    KdPrint(("  SN %x\n", Vcb->PhSerialNumber));
+    UDFPrint(("  SN %x\n", Vcb->PhSerialNumber));
 
     Buffer->SupportsObjects = FALSE;
 
@@ -355,7 +355,7 @@ UDFQueryFsSizeInfo(
 {
     PAGED_CODE();
 
-    KdPrint(("  UDFQueryFsSizeInfo: \n"));
+    UDFPrint(("  UDFQueryFsSizeInfo: \n"));
     //  Fill in the output buffer.
     if(Vcb->BitmapModified) {
         Vcb->TotalAllocUnits =
@@ -377,7 +377,7 @@ UDFQueryFsSizeInfo(
     if(!Buffer->BytesPerSector)
         Buffer->BytesPerSector = 2048;
 
-    KdPrint(("  Space: Total %I64x, Free %I64x\n",
+    UDFPrint(("  Space: Total %I64x, Free %I64x\n",
         Buffer->TotalAllocationUnits.QuadPart,
         Buffer->AvailableAllocationUnits.QuadPart));
 
@@ -407,7 +407,7 @@ UDFQueryFsFullSizeInfo(
 {
     PAGED_CODE();
 
-    KdPrint(("  UDFQueryFsFullSizeInfo: \n"));
+    UDFPrint(("  UDFQueryFsFullSizeInfo: \n"));
     //  Fill in the output buffer.
     if(Vcb->BitmapModified) {
         Vcb->TotalAllocUnits =
@@ -430,7 +430,7 @@ UDFQueryFsFullSizeInfo(
     if(!Buffer->BytesPerSector)
         Buffer->BytesPerSector = 2048;
 
-    KdPrint(("  Space: Total %I64x, Free %I64x\n",
+    UDFPrint(("  Space: Total %I64x, Free %I64x\n",
         Buffer->TotalAllocationUnits.QuadPart,
         Buffer->ActualAvailableAllocationUnits.QuadPart));
 
@@ -460,7 +460,7 @@ UDFQueryFsDeviceInfo(
 {
     PAGED_CODE();
 
-    KdPrint(("  UDFQueryFsDeviceInfo: \n"));
+    UDFPrint(("  UDFQueryFsDeviceInfo: \n"));
     //  Update the output buffer.
     if (Vcb->TargetDeviceObject->DeviceType != FILE_DEVICE_CD_ROM && Vcb->TargetDeviceObject->DeviceType != FILE_DEVICE_DVD)
     {
@@ -472,7 +472,7 @@ UDFQueryFsDeviceInfo(
         Buffer->Characteristics = Vcb->TargetDeviceObject->Characteristics;
     }
     Buffer->DeviceType = Vcb->TargetDeviceObject->DeviceType;
-    KdPrint(("    Characteristics %x, DeviceType %x\n", Buffer->Characteristics, Buffer->DeviceType));
+    UDFPrint(("    Characteristics %x, DeviceType %x\n", Buffer->Characteristics, Buffer->DeviceType));
     //  Adjust the length variable
     *Length -= sizeof( FILE_FS_DEVICE_INFORMATION );
     return STATUS_SUCCESS;
@@ -504,7 +504,7 @@ UDFQueryFsAttributeInfo(
     ULONG FsTypeTitleLen;
 
     PAGED_CODE();
-    KdPrint(("  UDFQueryFsAttributeInfo: \n"));
+    UDFPrint(("  UDFQueryFsAttributeInfo: \n"));
     //  Fill out the fixed portion of the buffer.
     Buffer->FileSystemAttributes = FILE_CASE_SENSITIVE_SEARCH |
                                    FILE_CASE_PRESERVED_NAMES |
@@ -620,7 +620,7 @@ UDFSetVolInfo(
     PtrUDFIrpContext    PtrIrpContext = NULL;
     BOOLEAN             AreWeTopLevel = FALSE;
 
-    KdPrint(("UDFSetVolInfo: \n"));
+    UDFPrint(("UDFSetVolInfo: \n"));
 
     FsRtlEnterFileSystem();
     ASSERT(DeviceObject);
@@ -678,7 +678,7 @@ UDFCommonSetVolInfo(
 
     _SEH2_TRY {
 
-        KdPrint(("UDFCommonSetVolInfo: \n"));
+        UDFPrint(("UDFCommonSetVolInfo: \n"));
         ASSERT(PtrIrpContext);
         ASSERT(Irp);
     
@@ -692,7 +692,7 @@ UDFCommonSetVolInfo(
         ASSERT(Ccb);
 
         if(Ccb && Ccb->Fcb && (Ccb->Fcb->NodeIdentifier.NodeType != UDF_NODE_TYPE_VCB)) {
-            KdPrint(("    Can't change Label on Non-volume object\n"));
+            UDFPrint(("    Can't change Label on Non-volume object\n"));
             try_return(RC = STATUS_ACCESS_DENIED);
         }
 
@@ -702,7 +702,7 @@ UDFCommonSetVolInfo(
         //  Reference our input parameters to make things easier
 
         if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
-            KdPrint(("    Can't change Label on blank volume ;)\n"));
+            UDFPrint(("    Can't change Label on blank volume ;)\n"));
             try_return(RC = STATUS_ACCESS_DENIED);
         }
 
@@ -795,10 +795,10 @@ UDFSetLabelInfo (
 {
     PAGED_CODE();
 
-    KdPrint(("  UDFSetLabelInfo: \n"));
+    UDFPrint(("  UDFSetLabelInfo: \n"));
     if(Buffer->VolumeLabelLength > UDF_VOL_LABEL_LEN*sizeof(WCHAR)) {
         // Too long Volume Label... NT doesn't like it
-        KdPrint(("  UDFSetLabelInfo: STATUS_INVALID_VOLUME_LABEL\n"));
+        UDFPrint(("  UDFSetLabelInfo: STATUS_INVALID_VOLUME_LABEL\n"));
         return STATUS_INVALID_VOLUME_LABEL;
     }
 
@@ -812,7 +812,7 @@ UDFSetLabelInfo (
     Vcb->VolIdent.Buffer[Buffer->VolumeLabelLength/sizeof(WCHAR)] = 0;
     UDFSetModified(Vcb);
 
-    KdPrint(("  UDFSetLabelInfo: OK\n"));
+    UDFPrint(("  UDFSetLabelInfo: OK\n"));
     return STATUS_SUCCESS;
 } // end UDFSetLabelInfo ()
 
index dd22e91..467e41b 100644 (file)
@@ -160,26 +160,26 @@ UDFCommonWrite(
 
         switch((ULONG)TopIrp) {
         case FSRTL_FSP_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_FSP_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_FSP_TOP_LEVEL_IRP\n"));
             break;
         case FSRTL_CACHE_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_CACHE_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_CACHE_TOP_LEVEL_IRP\n"));
             break;
         case FSRTL_MOD_WRITE_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
             break;
         case FSRTL_FAST_IO_TOP_LEVEL_IRP:
-            KdPrint(("  FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
+            UDFPrint(("  FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
             BrutePoint();
             break;
         case NULL:
-            KdPrint(("  NULL TOP_LEVEL_IRP\n"));
+            UDFPrint(("  NULL TOP_LEVEL_IRP\n"));
             break;
         default:
             if(TopIrp == Irp) {
-                KdPrint(("  TOP_LEVEL_IRP\n"));
+                UDFPrint(("  TOP_LEVEL_IRP\n"));
             } else {
-                KdPrint(("  RECURSIVE_IRP, TOP = %x\n", TopIrp));
+                UDFPrint(("  RECURSIVE_IRP, TOP = %x\n", TopIrp));
             }
             break;
         }
@@ -239,7 +239,7 @@ UDFCommonWrite(
         PagingIo = (Irp->Flags & IRP_PAGING_IO) ? TRUE : FALSE;
         NonBufferedIo = (Irp->Flags & IRP_NOCACHE) ? TRUE : FALSE;
         SynchronousIo = (FileObject->Flags & FO_SYNCHRONOUS_IO) ? TRUE : FALSE;
-        KdPrint(("    Flags: %s; %s; %s; %s; Irp(W): %8.8x\n",
+        UDFPrint(("    Flags: %s; %s; %s; %s; Irp(W): %8.8x\n",
                       CanWait ? "Wt" : "nw", PagingIo ? "Pg" : "np",
                       NonBufferedIo ? "NBuf" : "buff", SynchronousIo ? "Snc" : "Asc",
                       Irp->Flags));
@@ -303,7 +303,7 @@ UDFCommonWrite(
 
             if(PtrIrpContext->IrpContextFlags & UDF_IRP_CONTEXT_FLUSH2_REQUIRED) {
 
-                KdPrint(("  UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
+                UDFPrint(("  UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
                 PtrIrpContext->IrpContextFlags &= ~UDF_IRP_CONTEXT_FLUSH2_REQUIRED;
 
                 if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK)) {
@@ -341,7 +341,7 @@ UDFCommonWrite(
                 try_return(RC = STATUS_INVALID_USER_BUFFER);
             // Indicate, that volume contents can change after this operation
             // This flag will force VerifyVolume in future
-            KdPrint(("  set UnsafeIoctl\n"));
+            UDFPrint(("  set UnsafeIoctl\n"));
             Vcb->VCBFlags |= UDF_VCB_FLAGS_UNSAFE_IOCTL;
             // Make sure, that volume will never be quick-remounted
             // It is very important for ChkUdf utility.
@@ -387,7 +387,7 @@ UDFCommonWrite(
                 // Cache Manager and/or the VMM does not want us to perform
                 // the write at this time. Post the request.
                 PtrIrpContext->IrpContextFlags |= UDF_IRP_CONTEXT_DEFERRED_WRITE;
-                KdPrint(("UDFCommonWrite: Defer write\n"));
+                UDFPrint(("UDFCommonWrite: Defer write\n"));
                 MmPrint(("    CcDeferWrite()\n"));
                 CcDeferWrite(FileObject, UDFDeferredWriteCallBack, PtrIrpContext, Irp, WriteLength, IsThisADeferredWrite);
                 try_return(RC = STATUS_PENDING);
@@ -685,7 +685,7 @@ UDFCommonWrite(
                     NtReqFcb->CommonFCBHeader.AllocationSize.LowPart &= ~(PAGE_SIZE-1);
                 }
 
-                KdPrint(("UDFCommonWrite: Set size %x (alloc size %x)\n", ByteOffset.LowPart + TruncatedLength, NtReqFcb->CommonFCBHeader.AllocationSize.LowPart));
+                UDFPrint(("UDFCommonWrite: Set size %x (alloc size %x)\n", ByteOffset.LowPart + TruncatedLength, NtReqFcb->CommonFCBHeader.AllocationSize.LowPart));
                 if (CcIsFileCached(FileObject)) {
                     if(ExtendFS) {
                         MmPrint(("    CcSetFileSizes()\n"));
@@ -743,7 +743,7 @@ UDFCommonWrite(
             if (!FileObject->PrivateCacheMap) {
                 // This is the first cached I/O operation. You must ensure
                 // that the FCB Common FCB Header contains valid sizes at this time
-                KdPrint(("UDFCommonWrite: Init system cache\n"));
+                UDFPrint(("UDFCommonWrite: Init system cache\n"));
                 MmPrint(("    CcInitializeCacheMap()\n"));
                 CcInitializeCacheMap(FileObject, (PCC_FILE_SIZES)(&(NtReqFcb->CommonFCBHeader.AllocationSize)),
                     FALSE,      // We will not utilize pin access for this file
@@ -847,11 +847,11 @@ UDFCommonWrite(
 
 #if 1
             if((ULONG)TopIrp == FSRTL_MOD_WRITE_TOP_LEVEL_IRP) {
-                KdPrint(("FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n"));
+                UDFPrint(("FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n"));
                 CanWait = TRUE;
             } else
             if((ULONG)TopIrp == FSRTL_CACHE_TOP_LEVEL_IRP) {
-                KdPrint(("FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n"));
+                UDFPrint(("FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n"));
                 CanWait = TRUE;
             }
 
@@ -861,7 +861,7 @@ UDFCommonWrite(
             } else
             {}
 /*            if((TopIrp != Irp)) {
-                KdPrint(("(TopIrp != Irp) => CanWait\n"));
+                UDFPrint(("(TopIrp != Irp) => CanWait\n"));
                 CanWait = TRUE;
             } else*/
 #endif
@@ -872,13 +872,13 @@ UDFCommonWrite(
             }
             // Successful check will cause WCache lock
             if(!CanWait && UDFIsFileCached__(Vcb, Fcb->FileInfo, ByteOffset.QuadPart, TruncatedLength, TRUE)) {
-                KdPrint(("UDFCommonWrite: Cached => CanWait\n"));
+                UDFPrint(("UDFCommonWrite: Cached => CanWait\n"));
                 CacheLocked = TRUE;
                 CanWait = TRUE;
             }
             // Send the request to lower level drivers
             if(!CanWait) {
-                KdPrint(("UDFCommonWrite: Post physical write %x bytes at %x\n", TruncatedLength, ByteOffset.LowPart));
+                UDFPrint(("UDFCommonWrite: Post physical write %x bytes at %x\n", TruncatedLength, ByteOffset.LowPart));
 
                 try_return(RC = STATUS_PENDING);
             }
@@ -1022,7 +1022,7 @@ try_exit:   NOTHING;
         } // can we complete the IRP ?
     } _SEH2_END; // end of "__finally" processing
 
-    KdPrint(("\n"));
+    UDFPrint(("\n"));
     return(RC);
 } // end UDFCommonWrite()
 
@@ -1050,7 +1050,7 @@ UDFDeferredWriteCallBack(
     IN PVOID Context2           // Should be Irp
     )          
 {
-    KdPrint(("UDFDeferredWriteCallBack\n"));
+    UDFPrint(("UDFDeferredWriteCallBack\n"));
     // We should typically simply post the request to our internal
     // queue of posted requests (just as we would if the original write
     // could not be completed because the caller could not block).