[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,
+