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
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));
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)
// 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;
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;
}
(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;
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;
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));
FileDirNdx->FileSize =
NTFileInfo->EndOfFile.QuadPart =
FileEntry->informationLength;
- KdPrint((" informationLength=%I64x, lengthAllocDescs=%I64x\n",
+ UDFPrint((" informationLength=%I64x, lengthAllocDescs=%I64x\n",
FileEntry->informationLength,
FileEntry->lengthAllocDescs
));
// 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));
FileDirNdx->FileSize =
NTFileInfo->EndOfFile.QuadPart =
ExFileEntry->informationLength;
- KdPrint((" informationLength=%I64x, lengthAllocDescs=%I64x\n",
+ UDFPrint((" informationLength=%I64x, lengthAllocDescs=%I64x\n",
FileEntry->informationLength,
FileEntry->lengthAllocDescs
));
}
// 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;
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;
#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;
}
}
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;
}
}
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;
#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;
#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
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));
}
}
}
NULL,
0);
if(!NT_SUCCESS(RC)) {
- KdPrint((" opened i2=%x\n", i));
+ UDFPrint((" opened i2=%x\n", i));
h = ((HANDLE)-1);
}
}
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"));
}
//#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();
#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
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);
return NULL;
#endif //CDRW_W32
}
- KdPrint((" opened as file, h=%x\n", h));
+ UDFPrint((" opened as file, h=%x\n", h));
break;
} while(TRUE);
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);
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));
}
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;
{
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));
}
}
{
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;
{
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;
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
#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;
}
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
}
}
- 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));
}
}
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);
}
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
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;
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;
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;
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();
// 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();
ULONG i;
ULONG addr;
-// KdPrint(("MemFrames: %x\n",FrameCount));
+// UDFPrint(("MemFrames: %x\n",FrameCount));
if(!size || (size > MY_HEAP_FRAME_SIZE)) return NULL;
#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();
// }
#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();
// }
{
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;
}
#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;
PCHAR Tag;
#endif
-// KdPrint(("MemFrames: %x\n",FrameCount));
+// UDFPrint(("MemFrames: %x\n",FrameCount));
(*NewBuff) = addr;
if(OldLength == NewLength) return OldLength;
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;
}
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;
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;
}
IN PVCB Vcb
)
{
- KdPrint(("ClrModified\n"));
+ UDFPrint(("ClrModified\n"));
UDFInterlockedDecrement((PLONG)&(Vcb->Modified));
} // end UDFClrModified()
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);
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;
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;
}
} 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;
}
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;
// 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"));
}
}
}
// 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;
}
}
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;
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));
}
}
}
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;
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);
}
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);
}
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
final_RC = RC;
}
} else {
- KdPrint((" NO remap for @ %x\n", (lba0+i) & ~mask));
+ UDFPrint((" NO remap for @ %x\n", (lba0+i) & ~mask));
}
j=0;
}
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) {
(*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;
}
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;
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) {
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) {
}
#endif //_BROWSE_UDF_
} _SEH2_END;
- KdPrint(("TWrite: %x\n", RC));
+ UDFPrint(("TWrite: %x\n", RC));
return RC;
#undef Vcb
//#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),
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()
{
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,
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;
}
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;
#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;
}
// 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;
}
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;
(PGET_WRITE_MODE_USER_OUT)MyAllocatePool__(NonPagedPool, 512);
}
if(!(WParams = Vcb->WParams)) {
- KdPrint(("!WParams\n"));
+ UDFPrint(("!WParams\n"));
return STATUS_INSUFFICIENT_RESOURCES;
}
return STATUS_SUCCESS;
}
#endif //UDF_FORMAT_MEDIA
- KdPrint(("!get WParams\n"));
+ UDFPrint(("!get WParams\n"));
return RC;
}
// clear unnecassary flags
return STATUS_SUCCESS;
}
#endif //UDF_FORMAT_MEDIA
- KdPrint((" inv sector mode\n"));
+ UDFPrint((" inv sector mode\n"));
return STATUS_INVALID_PARAMETER;
}
// set packet size
check_dvd_bg_format:
- KdPrint((" check BGF\n"));
+ UDFPrint((" check BGF\n"));
if(!Vcb->CDR_Mode) {
if(OS_SUCCESS(RC)) {
Vcb->LastModifiedTrack = i;
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) {
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;
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) &&
((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;
}
}
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) {
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()
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
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) &&
// 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
(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_
(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
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);
} 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
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
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)++;
(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
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);
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);
}
} _SEH2_FINALLY {
#ifdef UDF_DBG
if(OS_SUCCESS(status)) {
- KdPrint(("Retry\n"));
+ UDFPrint(("Retry\n"));
}
#endif //UDF_DBG
} _SEH2_END;
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_
}
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) {
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
// 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) {
// 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 ||
// 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;
}
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)) {
}
#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
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
// 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"
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,
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;
}
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;
}
// 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
}
// 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,
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;
!(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 {
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 =
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) {
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;
}
}
}
- KdPrint((" set track LastLBA %x\n", Vcb->LastPossibleLBA));
+ UDFPrint((" set track LastLBA %x\n", Vcb->LastPossibleLBA));
Vcb->NWA =
Vcb->LastLBA =
Vcb->TrackMap[TrackNumber].LastLba =
#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;
}
uint32 LastLeadOut = 0;
// BOOLEAN IsMRW = FALSE;
- KdPrint(("UDFReadAndProcessFullToc\n"));
+ UDFPrint(("UDFReadAndProcessFullToc\n"));
if(!toc) return STATUS_INSUFFICIENT_RESOURCES;
Vcb->FirstTrackNum = 0xFF;
}
/* 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;
#define fms FALSE
#endif //UDF_FORMAT_MEDIA
- KdPrint(("UDFUseStandard\n"));
+ UDFPrint(("UDFUseStandard\n"));
_SEH2_TRY {
#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
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 {
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;
}
// 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;
#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),
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 {
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);
// 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;
}
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 {
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;
#define fms FALSE
#endif //UDF_FORMAT_MEDIA
- KdPrint(("UDFGetDiskInfo\n"));
+ UDFPrint(("UDFGetDiskInfo\n"));
if(!ioBuf) {
return STATUS_INSUFFICIENT_RESOURCES;
#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_
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;
}
}
} 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
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
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) {
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;
}
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;
}
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;
}
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;
}
#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;
}
// 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;
}
}
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) ) {
#endif //UDF_FORMAT_MEDIA
}
} else {
- KdPrint(("Writable disk\n"));
+ UDFPrint(("Writable disk\n"));
}
Vcb->MaxWriteSpeed = cap->MaximumWriteSpeedSupported;
Vcb->MaxReadSpeed = cap->MaximumSpeedSupported;
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
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;
}
} 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
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;
(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)
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;
}
}
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) {
} _SEH2_END;
- KdPrint(("UDFGetDiskInfo: %x\n", RC));
+ UDFPrint(("UDFGetDiskInfo: %x\n", RC));
return(RC);
} // end UDFGetDiskInfo()
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;
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));
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');
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_
/* 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;
}
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_
}
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;
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));
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()
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,
(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"
return RC;
}
- KdPrint((" Caching page:\n"
+ UDFPrint((" Caching page:\n"
"PageCode %d\n"
"PageLength %d\n"
"ReadDisableCache %d\n"
} else {
RC = STATUS_SUCCESS;
}
- KdPrint(("UDFSetCaching: %x\n", RC));
+ UDFPrint(("UDFSetCaching: %x\n", RC));
return RC;
} // end UDFSetCaching()
UNICODE_STRING NameString;
NTSTATUS status;
- //KdPrint(("RegTGetKeyHandle: h=%x, %S\n", hRootKey, KeyName));
+ //UDFPrint(("RegTGetKeyHandle: h=%x, %S\n", hRootKey, KeyName));
RtlInitUnicodeString(&NameString, KeyName);
);
if(!NT_SUCCESS(status)) {
- //KdPrint((" status %x\n", status));
+ //UDFPrint((" status %x\n", status));
*hKey = NULL;
}
#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;
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);
#define USE_WC_PRINT
#ifdef USE_WC_PRINT
- #define WcPrint KdPrint
+ #define WcPrint UDFPrint
#else
#define WcPrint(x) {;}
#endif
_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
// 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);
// 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;
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)
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
- KdPrint(("Hmm...\n"));
+ UDFPrint(("Hmm...\n"));
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
- KdPrint(("Hmm...\n"));
+ UDFPrint(("Hmm...\n"));
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
- KdPrint(("Hmm...\n"));
+ UDFPrint(("Hmm...\n"));
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
- KdPrint(("Hmm...\n"));
+ UDFPrint(("Hmm...\n"));
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
*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
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;
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;
}
Cache->FrameList[frame].UpdateCount++;
-// KdPrint((" BCount:%x\n",BCount));
+// UDFPrint((" BCount:%x\n",BCount));
while(BCount) {
if(i >= Cache->BlocksPerFrame) {
frame++;
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)*/
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++;
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++;
// 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;
// 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;
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 &&
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) {
{
//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;
Irp->IoStatus.Information = 0;
if(UDFGlobalData.AutoFormatCount == IoGetCurrentIrpStackLocation(Irp)->FileObject) {
- KdPrint(("Deregister Autoformat\n"));
+ UDFPrint(("Deregister Autoformat\n"));
UDFGlobalData.AutoFormatCount = NULL;
}
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);
PUDF_FILE_INFO SDirInfo;
ULONG i;
- KdPrint((" UDFBuildTreeItemsList():\n"));
+ UDFPrint((" UDFBuildTreeItemsList():\n"));
if(!(*PassedList) || !(*FoundList)) {
(*PassedList) = (PUDF_FILE_INFO*)
_SEH2_TRY {
- KdPrint((" UDFCloseAllXXXDelayedInDir(): Acquire DelayedCloseResource\n"));
+ UDFPrint((" UDFCloseAllXXXDelayedInDir(): Acquire DelayedCloseResource\n"));
// Acquire DelayedCloseResource
UDFAcquireResourceExclusive(&(UDFGlobalData.DelayedCloseResource), TRUE);
ResAcq = TRUE;
&PassedList, &PassedListSize, &FoundList, &FoundListSize);
if(!NT_SUCCESS(RC)) {
- KdPrint((" UDFBuildTreeItemsList(): error %x\n", RC));
+ UDFPrint((" UDFBuildTreeItemsList(): error %x\n", RC));
try_return(RC);
}
// 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);
}
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;
}
#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)) &&
*/
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);
}
}
// 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;
/*
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));
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() */
}
// 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;
}
}
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"));
// 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
// ****************
// 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"));
(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;
PCHAR CdbData;
PCHAR ModeSelectData;
- KdPrint(("UDFCommonDeviceControl\n"));
+ UDFPrint(("UDFCommonDeviceControl\n"));
_SEH2_TRY {
// First, get a pointer to the current I/O stack location
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);
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);
}
}
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) {
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],
));
} 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],
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; }
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; }
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));
// some CD-recording libraries
Vcb->SerialNumber--;
- KdPrint(("Forgotten\n"));
+ UDFPrint(("Forgotten\n"));
goto notify_media_change;
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;
case IOCTL_UDF_REGISTER_AUTOFORMAT: {
- KdPrint(("UDF Register Autoformat\n"));
+ UDFPrint(("UDF Register Autoformat\n"));
if(UDFGlobalData.AutoFormatCount) {
RC = STATUS_SHARING_VIOLATION;
} else {
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) {
break;
}
case IOCTL_UDF_INVALIDATE_VOLUMES: {
- KdPrint(("UDF Invaidate volume\n"));
+ UDFPrint(("UDF Invaidate volume\n"));
if(AcquiredVcb) {
UDFReleaseResource(&(Vcb->VCBResource));
AcquiredVcb = FALSE;
//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 );
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;
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);
}
(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;
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);
}
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);
}
/*
#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;
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);
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));
}
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;
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;
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
// 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);
}
if(Vcb && UnsafeIoctl) {
- KdPrint((" set UnsafeIoctl\n"));
+ UDFPrint((" set UnsafeIoctl\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_UNSAFE_IOCTL;
}
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
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);
}
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.
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.
NTSTATUS RC;
UCHAR AllocMode;
- KdPrint(("UDFSetFileAllocModeFromICB\n"));
+ UDFPrint(("UDFSetFileAllocModeFromICB\n"));
Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
Fcb = Ccb->Fcb;
// 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)
} 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.
BOOLEAN AcquiredFCB = FALSE;
PEXTENDED_IO_STACK_LOCATION pStackLocation = (PEXTENDED_IO_STACK_LOCATION) IrpSp;
- KdPrint(("UDFNotifyChangeDirectory\n"));
+ UDFPrint(("UDFNotifyChangeDirectory\n"));
_SEH2_TRY {
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;
// 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;
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,
// 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,
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
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;
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;
IN PVOID Contxt
)
{
- KdPrint(("UDFSyncCompletionRoutine2\n"));
+ UDFPrint(("UDFSyncCompletionRoutine2\n"));
PKEVENT SyncEvent = (PKEVENT)Contxt;
KeSetEvent( SyncEvent, 0, FALSE );
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;
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.
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));
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));
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_
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);
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
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_
// 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
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);
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;
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 );
}
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);
}
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;
}*/
{
if( !(Fcb->Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED) /*||
!FsRtlOplockIsFastIoPossible(&(Fcb->Oplock))*/ ) {
- KdPrint((" FastIoIsNotPossible\n"));
+ UDFPrint((" FastIoIsNotPossible\n"));
return FastIoIsNotPossible;
}
/*
}
*/
if(FsRtlAreThereCurrentFileLocks(&(Fcb->NTRequiredFCB->FileLock)) ) {
- KdPrint((" FastIoIsQuestionable\n"));
+ UDFPrint((" FastIoIsQuestionable\n"));
return FastIoIsQuestionable;
}
- KdPrint((" FastIoIsPossible\n"));
+ UDFPrint((" FastIoIsPossible\n"));
return FastIoIsPossible;
} // end UDFIsFastIoPossible()
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 {
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 {
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 {
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));
}
}
// 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
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 );
UNICODE_STRING nameString;
NTSTATUS RC;
- KdPrint(("UDFCheckOtherFSByName: trying %s \n",DeviceObjectName));
+ UDFPrint(("UDFCheckOtherFSByName: trying %s \n",DeviceObjectName));
RtlInitUnicodeString( &nameString, DeviceObjectName );
RC = IoGetDeviceObjectPointer(
);
if (!NT_SUCCESS(RC)) {
- KdPrint(("UDFCheckOtherFSByName: error %x while calling IoGetDeviceObjectPointer \n",RC));
+ UDFPrint(("UDFCheckOtherFSByName: error %x while calling IoGetDeviceObjectPointer \n",RC));
return;
}
// 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);
}
}
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
- KdPrint(("UDFFlush: \n"));
+ UDFPrint(("UDFFlush: \n"));
FsRtlEnterFileSystem();
ASSERT(DeviceObject);
BOOLEAN PostRequest = FALSE;
BOOLEAN CanWait = TRUE;
- KdPrint(("UDFCommonFlush: \n"));
+ UDFPrint(("UDFCommonFlush: \n"));
_SEH2_TRY {
// BOOLEAN PurgeCache = FALSE;
ULONG ret_val = 0;
- KdPrint(("UDFFlushAFile: \n"));
+ UDFPrint(("UDFFlushAFile: \n"));
if(!Fcb)
return 0;
IN ULONG FlushFlags
)
{
- KdPrint(("UDFFlushADirectory: \n"));
+ UDFPrint(("UDFFlushADirectory: \n"));
// PDIR_INDEX_HDR hDI;
PDIR_INDEX_ITEM DI;
// BOOLEAN Referenced = FALSE;
#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/* |
// 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);
{
// NTSTATUS RC = STATUS_SUCCESS;
- KdPrint(("UDFFlushCompletion: \n"));
+ UDFPrint(("UDFFlushCompletion: \n"));
if (Irp->PendingReturned) {
IoMarkIrpPending(Irp);
PtrUDFIrpContext PtrIrpContext;
BOOLEAN AreWeTopLevel = FALSE;
- KdPrint(("\nUDFFSControl: \n\n"));
+ UDFPrint(("\nUDFFSControl: \n\n"));
FsRtlEnterFileSystem();
ASSERT(DeviceObject);
} _SEH2_EXCEPT(UDFExceptionFilter(PtrIrpContext, _SEH2_GetExceptionInformation())) {
- KdPrint(("UDFFSControl: exception ***"));
+ UDFPrintErr(("UDFFSControl: exception ***"));
RC = UDFExceptionHandler(PtrIrpContext, Irp);
UDFLogEvent(UDF_ERROR_INTERNAL_ERROR, RC);
PIO_STACK_LOCATION IrpSp = NULL;
// PDEVICE_OBJECT PtrTargetDeviceObject = NULL;
- KdPrint(("\nUDFCommonFSControl\n\n"));
+ UDFPrint(("\nUDFCommonFSControl\n\n"));
// BrutePoint();
_SEH2_TRY {
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;
} _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;
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;
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;
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;
// 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;
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)) {
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.
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 ....
&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 {
}
}
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);
}
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,
// 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,
#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)
#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) {
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;
}
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
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;
}
// 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,
try_exit: NOTHING;
} _SEH2_FINALLY {
- KdPrint(("UDFMountVolume: RC = %x\n", RC));
+ UDFPrint(("UDFMountVolume: RC = %x\n", RC));
if(ioBuf) {
MyFreePool__(ioBuf);
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,
// 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;
}
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;
} _SEH2_END;
- KdPrint(("UDFMountVolume: final RC = %x\n", RC));
+ UDFPrint(("UDFMountVolume: final RC = %x\n", RC));
return RC;
} // end UDFMountVolume()
{
// 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,
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;
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()
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) {
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)) {
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;
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
// 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);
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);
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);
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);
}*/
// 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)
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;
ULONG StatsSize;
ULONG BytesToCopy;
- KdPrint(("UDFGetStatistics\n"));
+ UDFPrint(("UDFGetStatistics\n"));
// Extract the buffer
BufferLength = IrpSp->Parameters.FileSystemControl.OutputBufferLength;
UNICODE_STRING CurName;
PWCHAR TmpBuffer;
- KdPrint(("UDFIsPathnameValid\n"));
+ UDFPrint(("UDFIsPathnameValid\n"));
// Extract the pathname
PathnameBuffer = (PPATHNAME_BUFFER)Irp->AssociatedIrp.SystemBuffer;
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;
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;
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;
PtrUDFFCB Fcb;
PtrUDFCCB Ccb;
- KdPrint(("UDFGetVolumeBitmap\n"));
+ UDFPrint(("UDFGetVolumeBitmap\n"));
ULONG BytesToCopy;
ULONG TotalClusters;
// 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;
} _SEH2_EXCEPT(UDFExceptionFilter(IrpContext, _SEH2_GetExceptionInformation())) {
BrutePoint();
- KdPrint(("UDFGetVolumeBitmap: Exception\n"));
+ UDFPrintErr(("UDFGetVolumeBitmap: Exception\n"));
// UDFUnlockCallersBuffer(IrpContext, Irp, OutputBuffer);
BrutePoint();
// RC = UDFExceptionHandler(IrpContext, Irp);
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;
PtrUDFFCB Fcb;
PtrUDFCCB Ccb;
- KdPrint(("UDFIsVolumeDirty\n"));
+ UDFPrint(("UDFIsVolumeDirty\n"));
Irp->IoStatus.Information = 0;
} 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;
}
// 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;
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;
(PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation( Irp );
PPREVENT_MEDIA_REMOVAL_USER_IN Buf = NULL;
- KdPrint(("UDFInvalidateVolumes\n"));
+ UDFPrint(("UDFInvalidateVolumes\n"));
KIRQL SavedIrql;
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;
}
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;
}
// 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;
}
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;
}
#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
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));
}
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()
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
- KdPrint(("UDFLockControl\n"));
+ UDFPrint(("UDFLockControl\n"));
// BrutePoint();
FsRtlEnterFileSystem();
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.
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.
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.
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
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
#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
// 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.
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;
}
// 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;
if (ExceptionCode == STATUS_VERIFY_REQUIRED) {
if (KeGetCurrentIrql() >= APC_LEVEL) {
- KdPrint((" use UDFPostRequest()\n"));
+ UDFPrint((" use UDFPostRequest()\n"));
ExceptionCode = UDFPostRequest( PtrIrpContext, Irp );
}
}
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;
}
// 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;
}
}
- 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.
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
// 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
// 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.
// 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;
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()
// 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) {
UDFSetFlag(Ccb->CCBFlags, UDF_CCB_NOT_FROM_ZONE);
}
- KdPrint(("UDFAllocateCCB: %x\n", Ccb));
+ UDFPrint(("UDFAllocateCCB: %x\n", Ccb));
return(Ccb);
} // end UDFAllocateCCB()
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
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()
PtrUDFFCB Fcb
)
{
- KdPrint(("UDFCleanUpFCB: %x\n", Fcb));
+ UDFPrint(("UDFCleanUpFCB: %x\n", Fcb));
if(!Fcb) return;
ASSERT(Fcb->NodeIdentifier.NodeType == UDF_NODE_TYPE_FCB);
}
#ifdef UDF_DBG
else {
- KdPrint(("UDF: Fcb has invalid FCBName Buffer\n"));
+ UDFPrint(("UDF: Fcb has invalid FCBName Buffer\n"));
BrutePoint();
}
#endif
}
#ifdef UDF_DBG
else {
- KdPrint(("UDF: Fcb has invalid FCBName field\n"));
+ UDFPrint(("UDF: Fcb has invalid FCBName field\n"));
BrutePoint();
}
#endif
(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;
}
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
// 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
#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;
}
// Note: PtrIrpContext is invalid here
- KdPrint((" *** Thr: %x Done!\n", PsGetCurrentThread()));
+ UDFPrint((" *** Thr: %x Done!\n", PsGetCurrentThread()));
} _SEH2_EXCEPT(UDFExceptionFilter(PtrIrpContext, _SEH2_GetExceptionInformation())) {
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()
}
}
- 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)),
)
{
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));
#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) {
}*/
_SEH2_TRY {
- KdPrint(("UDF: Delete resources\n"));
+ UDFPrint(("UDF: Delete resources\n"));
UDFDeleteResource(&(Vcb->VCBResource));
UDFDeleteResource(&(Vcb->BitMapResource1));
UDFDeleteResource(&(Vcb->FcbListResource));
} _SEH2_END;
_SEH2_TRY {
- KdPrint(("UDF: Cleanup VCB\n"));
+ UDFPrint(("UDF: Cleanup VCB\n"));
ASSERT(IsListEmpty(&(Vcb->NextNotifyIRP)));
FsRtlNotifyUninitializeSync(&(Vcb->NotifyIRPMutex));
UDFCleanupVCB(Vcb);
} _SEH2_END;
_SEH2_TRY {
- KdPrint(("UDF: Delete DO\n"));
+ UDFPrint(("UDF: Delete DO\n"));
IoDeleteDevice(Vcb->VCBDeviceObject);
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
BrutePoint();
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);
}
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(¶mPathUnknown, RegistryPath->Buffer);
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) {
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);
}
if(!NT_SUCCESS(status)) {
try_return(val = DefValue);
}
- KdPrint(("UDFCheckRegValue: (3) |%S|\n", defaultParamPath.Buffer));
+ UDFPrint(("UDFCheckRegValue: (3) |%S|\n", defaultParamPath.Buffer));
}
if(PtrVolumePath) {
}
}
- KdPrint(( " Parameter = %ws\n", Name));
+ UDFPrint(( " Parameter = %ws\n", Name));
{
HKEY hk = NULL;
}
} _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()
// PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
- KdPrint(("UDFQuerySetEA: \n"));
+ UDFPrint(("UDFQuerySetEA: \n"));
FsRtlEnterFileSystem();
ASSERT(DeviceObject);
ExIsResourceAcquiredExclusiveLite(Resource) ? 1 :
(ExIsResourceAcquiredSharedLite(Resource) ? 2 : 0);
if(ReAcqRes) {
- KdPrint(("UDFAcquireResourceExclusiveWithCheck: ReAcqRes, %x\n", ReAcqRes));
+ UDFPrint(("UDFAcquireResourceExclusiveWithCheck: ReAcqRes, %x\n", ReAcqRes));
} else {
// BrutePoint();
}
// OK
} else
if(ReAcqRes == 2) {
- KdPrint(("UDFAcquireResourceExclusiveWithCheck: !!! Shared !!!\n"));
+ UDFPrint(("UDFAcquireResourceExclusiveWithCheck: !!! Shared !!!\n"));
//BrutePoint();
} else {
UDFAcquireResourceExclusive(Resource, TRUE);
ExIsResourceAcquiredExclusiveLite(Resource) ? 1 :
(ExIsResourceAcquiredSharedLite(Resource) ? 2 : 0);
if(ReAcqRes) {
- KdPrint(("UDFAcquireResourceSharedWithCheck: ReAcqRes, %x\n", ReAcqRes));
+ UDFPrint(("UDFAcquireResourceSharedWithCheck: ReAcqRes, %x\n", ReAcqRes));
/* } else {
BrutePoint();*/
}
// OK
} else
if(ReAcqRes == 1) {
- KdPrint(("UDFAcquireResourceSharedWithCheck: Exclusive\n"));
+ UDFPrint(("UDFAcquireResourceSharedWithCheck: Exclusive\n"));
//BrutePoint();
} else {
UDFAcquireResourceShared(Resource, TRUE);
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel;
- KdPrint(("UDFPnp\n"));
+ UDFPrint(("UDFPnp\n"));
ASSERT(FALSE);
FsRtlEnterFileSystem();
NTSTATUS RC;
PIO_STACK_LOCATION IrpSp;
PVCB Vcb;
- KdPrint(("UDFCommonPnp\n"));
+ UDFPrint(("UDFCommonPnp\n"));
_SEH2_TRY {
// Get the current Irp stack location.
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 );
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.
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;
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;
}
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"));
// 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) {
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)) {
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
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
#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;
}
} else
{}
/* if((TopIrp != Irp)) {
- KdPrint(("(TopIrp != Irp) => CanWait\n"));
+ UDFPrint(("(TopIrp != Irp) => CanWait\n"));
CanWait = TRUE;
} else*/
#endif
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
{
VOID *ReturnedBuffer = NULL;
- KdPrint(("UDFGetCallersBuffer: \n"));
+ UDFPrint(("UDFGetCallersBuffer: \n"));
// If an MDL is supplied, use it.
if(Irp->MdlAddress) {
NTSTATUS RC = STATUS_SUCCESS;
PMDL PtrMdl = NULL;
- KdPrint(("UDFLockCallersBuffer: \n"));
+ UDFPrint(("UDFLockCallersBuffer: \n"));
ASSERT(Irp);
{
NTSTATUS RC = STATUS_SUCCESS;
- KdPrint(("UDFUnlockCallersBuffer: \n"));
+ UDFPrint(("UDFUnlockCallersBuffer: \n"));
ASSERT(Irp);
// 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);
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,
NTSTATUS RC = STATUS_SUCCESS;
PFILE_OBJECT FileObject = NULL;
- KdPrint(("UDFMdlComplete: \n"));
+ UDFPrint(("UDFMdlComplete: \n"));
FileObject = IrpSp->FileObject;
ASSERT(FileObject);
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
- KdPrint(("UDFGetSecurity\n"));
+ UDFPrint(("UDFGetSecurity\n"));
// BrutePoint();
FsRtlEnterFileSystem();
PVOID PtrSystemBuffer = NULL;
ULONG BufferLength = 0;
- KdPrint(("UDFCommonGetSecurity\n"));
+ UDFPrint(("UDFCommonGetSecurity\n"));
_SEH2_TRY {
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
- KdPrint(("UDFSetSecurity\n"));
+ UDFPrint(("UDFSetSecurity\n"));
// BrutePoint();
FsRtlEnterFileSystem();
PtrUDFCCB Ccb = NULL;
ACCESS_MASK DesiredAccess = 0;
- KdPrint(("UDFCommonSetSecurity\n"));
+ UDFPrint(("UDFCommonSetSecurity\n"));
_SEH2_TRY {
UDFConvertToSelfRelative(&(NtReqFcb->SecurityDesc));
KdDump(NtReqFcb->SecurityDesc, RtlLengthSecurityDescriptor(NtReqFcb->SecurityDesc));
- KdPrint(("\n"));
+ UDFPrint(("\n"));
RC = SeSetSecurityDescriptorInfo(/*FileObject*/ NULL,
&(IrpSp->Parameters.SetSecurity.SecurityInformation),
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);
}
PSECURITY_DESCRIPTOR NewSD;
ULONG Len;
- KdPrint((" UDFConvertToSelfRelative\n"));
+ UDFPrint((" UDFConvertToSelfRelative\n"));
if(!(*SecurityDesc))
return STATUS_NO_SECURITY_ON_OBJECT;
SECURITY_INFORMATION SecurityInformation;
ULONG Len;
- KdPrint((" UDFInheritAcl\n"));
+ UDFPrint((" UDFInheritAcl\n"));
if(!(*ParentSecurityDesc)) {
*SecurityDesc = NULL;
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);
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))
#ifdef UDF_ENABLE_SECURITY
// SECURITY_INFORMATION SecurityInformation;
-// KdPrint((" UDFAssignAcl\n"));
+// UDFPrint((" UDFAssignAcl\n"));
if(!NtReqFcb->SecurityDesc) {
PSECURITY_DESCRIPTOR ExplicitSecurity = NULL;
#ifdef UDF_ENABLE_SECURITY
// NTSTATUS RC = STATUS_SUCCESS;
-// KdPrint((" UDFDeassignAcl\n"));
+// UDFPrint((" UDFDeassignAcl\n"));
if(!NtReqFcb->SecurityDesc)
return;
NTSTATUS RC;
ULONG NumberBytesRead;
-// KdPrint(("UDFWriteSecurity\n"));
+// UDFPrint(("UDFWriteSecurity\n"));
#if !defined(UDF_READ_ONLY_BUILD)
FileInfo = Fcb->FileInfo;
ASSERT(FileInfo);
if(!FileInfo) {
- KdPrint((" Volume Security\n"));
+ UDFPrint((" Volume Security\n"));
try_return(RC = STATUS_SUCCESS);
}
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
- KdPrint(("UDFShutDown\n"));
+ UDFPrint(("UDFShutDown\n"));
// BrutePoint();
FsRtlEnterFileSystem();
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
#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
// 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));
}
) {
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
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;
) {
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
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;
) {
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
if(Success) {
#ifdef TRACK_RESOURCES
- KdPrint(("Res:Exc:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:Exc:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
AcqCounter++;
return Success;
}
#ifdef TRACK_RESOURCES
- KdPrint(("Res:Exc:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:Exc:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
// BrutePoint();
{
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
#ifdef TRACK_RESOURCES
- KdPrint(("Res:Free:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:Free:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
ExReleaseResourceForThreadLite(Resource, ResourceThreadId);
#ifdef TRACK_RESOURCES
- KdPrint(("Res:Free:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:Free:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
AcqCounter--;
{
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
#ifdef TRACK_RESOURCES
- KdPrint(("Res:Del:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:Del:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
_SEH2_TRY {
BrutePoint();
} _SEH2_END;
#ifdef TRACK_RESOURCES
- KdPrint(("Res:Del:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:Del:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
ResCounter--;
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
NTSTATUS RC;
#ifdef TRACK_RESOURCES
- KdPrint(("Res:Ini:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:Ini:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
ASSERT(!(*((PULONG)Resource)));
ASSERT(!(*(((PULONG)Resource)+1)));
RC = ExInitializeResourceLite(Resource);
#ifdef TRACK_RESOURCES
- KdPrint(("Res:Ini:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:Ini:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
if(NT_SUCCESS(RC)) {
{
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
#ifdef TRACK_RESOURCES
- KdPrint(("Res:2Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:2Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
ExConvertExclusiveToSharedLite(Resource);
#ifdef TRACK_RESOURCES
- KdPrint(("Res:2Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:2Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
}
) {
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
if(Success) {
#ifdef TRACK_RESOURCES
- KdPrint(("Res:Sha*:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:Sha*:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
return Success;
}
#ifdef TRACK_RESOURCES
- KdPrint(("Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
+ UDFPrint(("Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
// BrutePoint();
#ifdef TRACK_REF_COUNTERS
LONG a;
a = InterlockedIncrement(addr);
- KdPrint(("ThId:%x:Ilck:Inc:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
+ UDFPrint(("ThId:%x:Ilck:Inc:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
PsGetCurrentThread(),BugCheckId,Line,addr,a-1,a));
return a;
#else
#ifdef TRACK_REF_COUNTERS
LONG a;
a = InterlockedDecrement(addr);
- KdPrint(("ThId:%x:Ilck:Dec:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
+ UDFPrint(("ThId:%x:Ilck:Dec:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
PsGetCurrentThread(),BugCheckId,Line,addr,a+1,a));
return a;
#else
#ifdef TRACK_REF_COUNTERS
LONG a;
a = InterlockedExchangeAdd(addr,i);
- KdPrint(("ThId:%x:Ilck:Add:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
+ UDFPrint(("ThId:%x:Ilck:Add:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
PsGetCurrentThread(),BugCheckId,Line,addr,a,a+i));
return a;
#else
#endif //TRACK_SYS_ALLOC_CALLERS
) {
ULONG i;
-// KdPrint(("SysAllocated: %x\n",AllocCount));
+// UDFPrint(("SysAllocated: %x\n",AllocCount));
if(!MemDescInited) {
RtlZeroMemory(&MemDesc, sizeof(MemDesc));
MemDescInited = 1;
}
}
if(cur_max == MAX_MEM_DEBUG_DESCRIPTORS) {
- KdPrint(("Debug memory descriptor list full\n"));
+ UDFPrint(("Debug memory descriptor list full\n"));
return ExAllocatePoolWithTag(Type, (size) , 'Fnwd');
}
}
}
if (i==cur_max && cur_max != MAX_MEM_DEBUG_DESCRIPTORS) {
- KdPrint(("Buug! - Deallocating nonallocated block\n"));
+ UDFPrint(("Buug! - Deallocating nonallocated block\n"));
return;
}
not_bug:
-// KdPrint(("SysAllocated: %x\n",AllocCount));
+// UDFPrint(("SysAllocated: %x\n",AllocCount));
ExFreePool(addr);
}
IN PLARGE_INTEGER Timeout OPTIONAL
)
{
- KdPrint(("UDFWaitForSingleObject\n"));
+ UDFPrint(("UDFWaitForSingleObject\n"));
LARGE_INTEGER LocalTimeout;
LARGE_INTEGER delay;
delay.QuadPart = -(WAIT_FOR_XXX_EMU_DELAY);
if(Timeout && (Timeout->QuadPart)) LocalTimeout = *Timeout;
else LocalTimeout.QuadPart = 0x7FFFFFFFFFFFFFFFLL;
- KdPrint(("SignalState %x\n", *Object));
+ UDFPrint(("SignalState %x\n", *Object));
if(!Object) return STATUS_INVALID_PARAMETER;
if((*Object)) return STATUS_SUCCESS;
while(LocalTimeout.QuadPart>0 && !(*Object) ) {
- KdPrint(("SignalState %x\n", *Object));
+ UDFPrint(("SignalState %x\n", *Object));
// Stall for a while.
KeDelayExecutionThread(KernelMode, FALSE, &delay);
LocalTimeout.QuadPart -= WAIT_FOR_XXX_EMU_DELAY;
RC = KeWaitForSingleObject(Object, Executive, KernelMode, FALSE, to);
if(RC == STATUS_SUCCESS)
break;
- KdPrint(("No response ?\n"));
+ UDFPrint(("No response ?\n"));
if(c<2)
BrutePoint();
}
if(bm = (uint32*)(((PVCB)_Vcb)->BSBM_Bitmap)) {
ret_val |= (UDFGetBadBit(bm, Lba) ? WCACHE_BLOCK_BAD : 0);
if(ret_val & WCACHE_BLOCK_BAD) {
- KdPrint(("Marked BB @ %#x\n", Lba));
+ UDFPrint(("Marked BB @ %#x\n", Lba));
}
}
*/
#define UDF_DUMP_DIRTREE
#ifdef UDF_DUMP_DIRTREE
-#define DirPrint(x) KdPrint(x)
+#define DirPrint(x) UDFPrint(x)
#else
#define DirPrint(x) {;}
#endif
if(FileId->fileCharacteristics & (~0x1f))
continue;
if(prevOffset + ((FileId->lengthFileIdent + FileId->lengthOfImpUse + sizeof(FILE_IDENT_DESC) + 3) & (~((uint32)3))) <= Length) {
- KdPrint(("UDFFindNextFI OK: %x\n", prevOffset));
+ UDFPrint(("UDFFindNextFI OK: %x\n", prevOffset));
return prevOffset;
}
}
ExtInfo = &(FileInfo->Dloc->DataLoc);
FileInfo->Dloc->DirIndex = NULL;
- KdPrint(("UDF: scaning directory\n"));
+ UDFPrint(("UDF: scaning directory\n"));
// allocate buffer for the whole directory
ASSERT((uint32)(ExtInfo->Length));
if(!ExtInfo->Length)
Count++;
if(Offset+sizeof(FILE_IDENT_DESC) > ExtInfo->Length) {
if(Offset != ExtInfo->Length) {
- KdPrint((" Trash at the end of Dir\n"));
+ UDFPrint((" Trash at the end of Dir\n"));
}
// BrutePoint();
break;
DirPrint((" final Offset %x\n", Offset));
if(Offset > ExtInfo->Length) {
BrutePoint();
- KdPrint((" Unexpected end of Dir\n"));
+ UDFPrint((" Unexpected end of Dir\n"));
DbgFreePool(buff);
return STATUS_FILE_CORRUPT_ERROR;
}
while((Offset<ExtInfo->Length) && FileId->descTag.tagIdent) {
// add new entry to index list
if(FileId->descTag.tagIdent != TID_FILE_IDENT_DESC) {
- KdPrint((" Invalid tagIdent %x (expected %x) offst %x\n", FileId->descTag.tagIdent, TID_FILE_IDENT_DESC, Offset));
+ UDFPrint((" Invalid tagIdent %x (expected %x) offst %x\n", FileId->descTag.tagIdent, TID_FILE_IDENT_DESC, Offset));
DirPrint((" FileId: filen %x, iulen %x, charact %x\n",
FileId->lengthFileIdent, FileId->lengthOfImpUse, FileId->fileCharacteristics));
DirPrint((" loc: @%x\n", UDFExtentOffsetToLba(Vcb, ExtInfo->Mapping, Offset, NULL, NULL, NULL, NULL)));
DirNdx->FI_Flags |= UDF_FI_FLAG_FI_INTERNAL;
}
#if 0
- KdPrint(("%ws\n", DirNdx->FName.Buffer));
+ UDFPrint(("%ws\n", DirNdx->FName.Buffer));
#endif
DirPrint(("%ws\n", DirNdx->FName.Buffer));
// remember FileEntry location...
Count++;
if(Offset+sizeof(FILE_IDENT_DESC) > ExtInfo->Length) {
if(Offset != ExtInfo->Length) {
- KdPrint((" Trash at the end of Dir (2)\n"));
+ UDFPrint((" Trash at the end of Dir (2)\n"));
}
// BrutePoint();
break;
DbgFreePool(buff);
if(Count < 2) {
UDFDirIndexFree(hDirNdx);
- KdPrint((" Directory too short\n"));
+ UDFPrint((" Directory too short\n"));
return STATUS_FILE_CORRUPT_ERROR;
}
// store index
AllocExt.extLength = len;
AllocExt.extLocation = UDFPartLbaToPhys(Vcb, &locAddr);
if(AllocExt.extLocation == LBA_OUT_OF_EXTENT) {
- KdPrint(("bad address\n"));
+ UDFPrint(("bad address\n"));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
// check integrity
if((NextAllocDesc->descTag.tagIdent != TID_ALLOC_EXTENT_DESC) ||
(NextAllocDesc->lengthAllocDescs > (len - sizeof(ALLOC_EXT_DESC))) ) {
- KdPrint(("Integrity check failed\n"));
- KdPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
- KdPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
- KdPrint(("len = %x\n", len));
+ UDFPrint(("Integrity check failed\n"));
+ UDFPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
+ UDFPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
+ UDFPrint(("len = %x\n", len));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
if(type != EXTENT_NOT_RECORDED_NOT_ALLOCATED && len) {
Extent[i].extLocation = UDFPartLbaToPhys(Vcb, &locAddr);
if(Extent[i].extLocation == LBA_OUT_OF_EXTENT) {
- KdPrint(("bad address (2)\n"));
+ UDFPrint(("bad address (2)\n"));
MyFreePool__(Extent);
return NULL;
}
AllocExt.extLength = len;
AllocExt.extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
if(AllocExt.extLocation == LBA_OUT_OF_EXTENT) {
- KdPrint(("bad address\n"));
+ UDFPrint(("bad address\n"));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
// check integrity
if((NextAllocDesc->descTag.tagIdent != TID_ALLOC_EXTENT_DESC) ||
(NextAllocDesc->lengthAllocDescs > (len - sizeof(ALLOC_EXT_DESC))) ) {
- KdPrint(("Integrity check failed\n"));
- KdPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
- KdPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
- KdPrint(("len = %x\n", len));
+ UDFPrint(("Integrity check failed\n"));
+ UDFPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
+ UDFPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
+ UDFPrint(("len = %x\n", len));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
if(type != EXTENT_NOT_RECORDED_NOT_ALLOCATED && len) {
Extent[i].extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
if(Extent[i].extLocation == LBA_OUT_OF_EXTENT) {
- KdPrint(("bad address (2)\n"));
+ UDFPrint(("bad address (2)\n"));
MyFreePool__(Extent);
return NULL;
}
AllocExt.extLength = len;
AllocExt.extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
if(AllocExt.extLocation == LBA_OUT_OF_EXTENT) {
- KdPrint(("bad address\n"));
+ UDFPrint(("bad address\n"));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
// check integrity
if((NextAllocDesc->descTag.tagIdent != TID_ALLOC_EXTENT_DESC) ||
(NextAllocDesc->lengthAllocDescs > (len - sizeof(ALLOC_EXT_DESC))) ) {
- KdPrint(("Integrity check failed\n"));
+ UDFPrint(("Integrity check failed\n"));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
if(type != EXTENT_NOT_RECORDED_NOT_ALLOCATED && len) {
Extent[i].extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
if(Extent[i].extLocation == LBA_OUT_OF_EXTENT) {
- KdPrint(("bad address (2)\n"));
+ UDFPrint(("bad address (2)\n"));
MyFreePool__(Extent);
return NULL;
}
if(XEntry->tagIdent == TID_FILE_ENTRY) {
-// KdPrint(("Standard FileEntry\n"));
+// UDFPrint(("Standard FileEntry\n"));
PFILE_ENTRY FileEntry = (PFILE_ENTRY)XEntry;
ExtPrint(("Standard FileEntry\n"));
AllocMode = FileEntry->icbTag.flags & ICB_FLAG_ALLOC_MASK;
} else if(XEntry->tagIdent == TID_EXTENDED_FILE_ENTRY) {
-// KdPrint(("Extended FileEntry\n"));
+// UDFPrint(("Extended FileEntry\n"));
ExtPrint(("Extended FileEntry\n"));
PEXTENDED_FILE_ENTRY ExFileEntry = (PEXTENDED_FILE_ENTRY)XEntry;
(*Buff) = (int8*)MyAllocatePoolTag__(NonPagedPool, NewLen, MEM_SHAD_TAG);
if(!(*Buff)) {
status = STATUS_INSUFFICIENT_RESOURCES;
- KdPrint(("UDFResizeExtent() failed (%x)\n",status));
+ UDFPrint(("UDFResizeExtent() failed (%x)\n",status));
BrutePoint();
goto sh_alloc_err;
}
if(UDFGetExtentLength(AllocExtent->Mapping) < NewLen) {
status = UDFResizeExtent(Vcb, PartNum, NewLen, TRUE, AllocExtent);
if(!OS_SUCCESS(status)) {
- KdPrint(("UDFResizeExtent(2) failed (%x)\n",status));
+ UDFPrint(("UDFResizeExtent(2) failed (%x)\n",status));
BrutePoint();
sh_alloc_err:
MyFreePool__(Alloc);
PEXTENT_MAP Mapping2;
uint32 i;
- KdPrint((" DiscardFESpace\n"));
+ UDFPrint((" DiscardFESpace\n"));
Mapping2 = Mapping;
for(i=0;i<lim;i++, Mapping++) {
// we should not discard allocated FEs
if( (Mapping->extLength >> 30) == EXTENT_RECORDED_ALLOCATED) {
- KdPrint((" used @ %x\n", Mapping->extLocation));
+ UDFPrint((" used @ %x\n", Mapping->extLocation));
Mapping->extLength = Vcb->LBlockSize | (EXTENT_NOT_RECORDED_NOT_ALLOCATED << 30);
Mapping->extLocation = 0;
} else {
- KdPrint((" free @ %x\n", Mapping->extLocation));
+ UDFPrint((" free @ %x\n", Mapping->extLocation));
}
}
UDFMarkSpaceAsXXX(Vcb, 0, Mapping2, AS_DISCARDED);
switch(AllocClass) {
case UDF_PREALLOC_CLASS_FE:
- KdPrint(("AllocationCache FE:\n"));
+ UDFPrint(("AllocationCache FE:\n"));
pAllocCache = &(Vcb->FEChargeCache);
plim = &(Vcb->FEChargeCacheMaxSize);
lim = 32;
break;
case UDF_PREALLOC_CLASS_DIR:
- KdPrint(("AllocationCache DIR:\n"));
+ UDFPrint(("AllocationCache DIR:\n"));
pAllocCache = &(Vcb->PreallocCache);
plim = &(Vcb->PreallocCacheMaxSize);
lim = 32;
UDFReleaseResource(&(Vcb->PreallocResource));
return status;
}
- KdPrint(("Get AllocationCache for %x\n", ParentLocation));
+ UDFPrint(("Get AllocationCache for %x\n", ParentLocation));
for(i=0; i<lim; i++) {
if(AllocCache[i].ParentLocation == ParentLocation) {
UDFReleaseResource(&(Vcb->PreallocResource));
return status;
}
- KdPrint(("Store AllocationCache for %x, map %x\n", ParentLocation, Ext->Mapping));
+ UDFPrint(("Store AllocationCache for %x, map %x\n", ParentLocation, Ext->Mapping));
for(i=0; i<lim; i++) {
if(AllocCache[i].ParentLocation == LBA_NOT_ALLOCATED) {
uint32 i, lim;
OSSTATUS status;
- KdPrint(("Flush AllocationCache\n"));
+ UDFPrint(("Flush AllocationCache\n"));
UDFAcquireResourceExclusive(&(Vcb->PreallocResource),TRUE);
status = UDFInitAllocationCache(Vcb, AllocClass, &AllocCache, &lim, FALSE);
if(Vcb->LowFreeSpace) {
status = UDFAllocFreeExtent(Vcb, Len << Vcb->LBlockSizeBits,p_start, p_end, FEExtInfo, EXTENT_FLAG_VERIFY);
if(OS_SUCCESS(status)) {
- KdPrint(("FE @ %x (1)\n", FEExtInfo->Mapping[0].extLocation ));
+ UDFPrint(("FE @ %x (1)\n", FEExtInfo->Mapping[0].extLocation ));
}
return status;
} else {
}
if(!OS_SUCCESS(status = UDFAllocFreeExtent(Vcb, lim << Vcb->LBlockSizeBits, p_start, p_end, Ext, EXTENT_FLAG_VERIFY) )) {
// can't pre-allocate space for multiple FEs. Try single FE
- KdPrint(("allocate single FE entry\n"));
+ UDFPrint(("allocate single FE entry\n"));
status = UDFAllocFreeExtent(Vcb, Len,
p_start, p_end, FEExtInfo, EXTENT_FLAG_VERIFY);
if(OS_SUCCESS(status)) {
- KdPrint(("FE @ %x (2)\n", FEExtInfo->Mapping[0].extLocation ));
+ UDFPrint(("FE @ %x (2)\n", FEExtInfo->Mapping[0].extLocation ));
}
return status;
}
if(Vcb->BSBM_Bitmap) {
uint32 lba = Ext->Mapping[i].extLocation;
if(UDFGetBadBit((uint32*)(Vcb->BSBM_Bitmap), lba)) {
- KdPrint(("Remove BB @ %x from FE charge\n", lba));
+ UDFPrint(("Remove BB @ %x from FE charge\n", lba));
Ext->Mapping[i].extLength |= (EXTENT_NOT_RECORDED_NOT_ALLOCATED << 30);
Ext->Mapping[i].extLocation = 0;
continue;
Ext->Mapping[i].extLength |= (EXTENT_NOT_RECORDED_ALLOCATED << 30);
return STATUS_INSUFFICIENT_RESOURCES;
}
- KdPrint(("FE @ %x (3)\n", FEExtInfo->Mapping[0].extLocation ));
+ UDFPrint(("FE @ %x (3)\n", FEExtInfo->Mapping[0].extLocation ));
FEExtInfo->Length = Len;
FEExtInfo->Offset = 0;
FEExtInfo->Modified = TRUE;
status = UDFAllocFreeExtent(Vcb, Len,
UDFPartStart(Vcb, PartNum), UDFPartEnd(Vcb, PartNum), FEExtInfo, EXTENT_FLAG_VERIFY);
if(OS_SUCCESS(status)) {
- KdPrint(("FE @ %x (4)\n", FEExtInfo->Mapping[0].extLocation ));
+ UDFPrint(("FE @ %x (4)\n", FEExtInfo->Mapping[0].extLocation ));
}
return status;
}
int64 l2 = ((l-1)/MaxGrow + 1)*MaxGrow;
status = UDFResizeExtent(Vcb, PartNum, l2, AlwaysInIcb, ExtInfo);
if(!OS_SUCCESS(status)) {
- KdPrint(("Sub-call to UDFResizeExtent() failed (%x)\n", status));
+ UDFPrint(("Sub-call to UDFResizeExtent() failed (%x)\n", status));
return status;
}
l = ExtInfo->Length;
while((Length - l) > MaxGrow) {
status = UDFResizeExtent(Vcb, PartNum, l+MaxGrow, AlwaysInIcb, ExtInfo);
if(!OS_SUCCESS(status)) {
- KdPrint(("Sub-call (2) to UDFResizeExtent() failed (%x)\n", status));
+ UDFPrint(("Sub-call (2) to UDFResizeExtent() failed (%x)\n", status));
return status;
}
l = ExtInfo->Length;
TmpExtInf.Mapping = (PEXTENT_MAP)MyAllocatePoolTag__(NonPagedPool , (i+1)*sizeof(EXTENT_MAP),
MEM_EXTMAP_TAG);
if(!TmpExtInf.Mapping) {
- KdPrint(("UDFResizeExtent: !TmpExtInf.Mapping\n"));
+ UDFPrint(("UDFResizeExtent: !TmpExtInf.Mapping\n"));
UDFReleaseResource(&(Vcb->BitMapResource1));
return STATUS_INSUFFICIENT_RESOURCES;
}
&TmpExtInf,
ExtInfo->Flags /*& EXTENT_FLAG_ALLOC_MASK*/);
if(!OS_SUCCESS(status)) {
- KdPrint(("UDFResizeExtent: UDFAllocFreeExtent() failed (%x)\n", status));
+ UDFPrint(("UDFResizeExtent: UDFAllocFreeExtent() failed (%x)\n", status));
return status;
}
ExtInfo->Mapping = UDFMergeMappings(ExtInfo->Mapping, TmpExtInf.Mapping);
UDFPartStart(Vcb, PartNum), UDFPartEnd(Vcb, PartNum), XSBMExtInfo, EXTENT_FLAG_ALLOC_SEQUENTIAL) ))
return status;
if(XSBMExtInfo->Mapping[1].extLength) {
- KdPrint(("Can't allocate space for Freed Space bitmap\n"));
+ UDFPrint(("Can't allocate space for Freed Space bitmap\n"));
*XSl = 0;
} else {
*XSl = (uint32)(XSBMExtInfo->Length);
status = UDFWriteExtent(Vcb, &USBMExtInfo, sizeof(SPACE_BITMAP_DESC), USl, FALSE, new_bm, &WrittenBytes);
#ifdef UDF_DBG
} else {
- KdPrint(("Can't update USBM\n"));
+ UDFPrint(("Can't update USBM\n"));
#endif // UDF_DBG
}
if(USBMExtInfo.Mapping) MyFreePool__(USBMExtInfo.Mapping);
status2 = UDFWriteExtent(Vcb, &FSBMExtInfo, sizeof(SPACE_BITMAP_DESC), FSl, FALSE, new_bm, &WrittenBytes);
} else {
status2 = status;
- KdPrint(("Can't update FSBM\n"));
+ UDFPrint(("Can't update FSBM\n"));
}
if(FSBMExtInfo.Mapping) MyFreePool__(FSBMExtInfo.Mapping);
} else {
#ifdef UDF_DBG
if(phd->unallocatedSpaceTable.extLength) {
// rebuild unallocatedSpaceTable
- KdPrint(("unallocatedSpaceTable (part %d)\n", i));
+ UDFPrint(("unallocatedSpaceTable (part %d)\n", i));
}
if(phd->freedSpaceTable.extLength) {
// rebuild freedSpaceTable
- KdPrint(("freedSpaceTable (part %d)\n", i));
+ UDFPrint(("freedSpaceTable (part %d)\n", i));
}
#endif // UDF_DBG
UDFUpdateXSpaceBitmaps(Vcb, p->partitionNumber, phd);
return STATUS_UNSUCCESSFUL;
}
- KdPrint(("UDF: Updating LVID @%x (%x)\n", Vcb->LVid_loc.extLocation, Vcb->LVid_loc.extLength));
+ UDFPrint(("UDF: Updating LVID @%x (%x)\n", Vcb->LVid_loc.extLocation, Vcb->LVid_loc.extLength));
len = max(Vcb->LVid_loc.extLength, Vcb->BlockSize);
lvid = Vcb->LVid;
if(lvid->descTag.tagSerialNum > UDF_LVID_TTL) {
#endif
if(Close){
- KdPrint(("UDF: Opening LVID\n"));
+ UDFPrint(("UDF: Opening LVID\n"));
lvid->integrityType = INTEGRITY_TYPE_CLOSE;
} else {
- KdPrint(("UDF: Closing LVID\n"));
+ UDFPrint(("UDF: Closing LVID\n"));
lvid->integrityType = INTEGRITY_TYPE_OPEN;
}
LVID_hd->uniqueID = Vcb->NextUniqueId;
if(equal) {
- KdPrint(("UDF: equal Ids\n"));
+ UDFPrint(("UDF: equal Ids\n"));
return STATUS_SUCCESS;
}
// BOOLEAN merged;
BOOLEAN sorted;
- KdPrint(("UDF: Updating Sparable Part Map:\n"));
+ UDFPrint(("UDF: Updating Sparable Part Map:\n"));
if(!Vcb->SparingTableModified) return STATUS_SUCCESS;
if(!Vcb->SparingTable) return STATUS_SUCCESS;
} while(sorted);
for(i=0;i<Vcb->SparingCount;i++) {
- KdPrint((" @%x -> %x \n",
+ UDFPrint((" @%x -> %x \n",
RelocMap[i].origLocation, RelocMap[i].mappedLocation));
}
Vcb->SparingTableModified = FALSE;
// if(!merged) {
-// KdPrint((" sparing table unchanged\n"));
+// UDFPrint((" sparing table unchanged\n"));
// MyFreePool__(SparTable);
// return STATUS_SUCCESS;
// }
// walk through all available Sparing Tables
for(i=0;i<Vcb->SparingTableCount;i++) {
// read (next) table
- KdPrint((" sparing table @%x\n", Vcb->SparingTableLoc[i]));
+ UDFPrint((" sparing table @%x\n", Vcb->SparingTableLoc[i]));
status = UDFReadSectors(Vcb, FALSE, Vcb->SparingTableLoc[i], 1, FALSE, (int8*)SparTable, &ReadBytes);
// tag should be set to TID_UNUSED_DESC
if(OS_SUCCESS(status) && (SparTable->descTag.tagIdent == TID_UNUSED_DESC)) {
Vcb->BlockSize-1)
>> Vcb->BlockSizeBits);
if(BC2 > BC) {
- KdPrint((" sizeSparingTable @%x too long: %x > %x\n",
+ UDFPrint((" sizeSparingTable @%x too long: %x > %x\n",
Vcb->SparingTableLoc[i], BC2, BC
));
continue;
BC2, FALSE, (int8*)SparTable, &ReadBytes);
if(!OS_SUCCESS(status)) {
- KdPrint((" Error reading sizeSparingTable @%x (%x)\n",
+ UDFPrint((" Error reading sizeSparingTable @%x (%x)\n",
Vcb->SparingTableLoc[i], BC2
));
continue;
Vcb->BlockSize-1)
>> Vcb->BlockSizeBits);
if(BC2 > BC) {
- KdPrint((" new sizeSparingTable @%x too long: %x > %x\n",
+ UDFPrint((" new sizeSparingTable @%x too long: %x > %x\n",
Vcb->SparingTableLoc[i], BC2, BC
));
continue;
for(m=0; m<Vcb->SparingCount; m++) {
if(RelocMap[m].mappedLocation == NewRelocMap[n].mappedLocation) {
if(RelocMap[m].origLocation != NewRelocMap[n].origLocation) {
- KdPrint((" update @%x (%x) -> @%x (%x)\n",
+ UDFPrint((" update @%x (%x) -> @%x (%x)\n",
NewRelocMap[m].origLocation, NewRelocMap[m].mappedLocation,
RelocMap[m].origLocation, RelocMap[m].mappedLocation));
merged = TRUE;
}
*/
// if(merged) {
- KdPrint(("UDF: record updated\n"));
+ UDFPrint(("UDF: record updated\n"));
status = UDFWriteSectors(Vcb, FALSE, Vcb->SparingTableLoc[i], BC2, FALSE, (int8*)SparTable, &ReadBytes);
if(!OS_SUCCESS(status)) {
if(!OS_SUCCESS(status2)) {
goto Err_SetVI;
}
- KdPrint(("UDF: Updating LVD @%x (%x)\n", Lba.block, Vcb->BlockSize));
+ UDFPrint(("UDF: Updating LVD @%x (%x)\n", Lba.block, Vcb->BlockSize));
status = UDFSetDstring(&(Vcb->VolIdent), (dstring*)&CS0, CUR_IDENT_SZ);
if(!OS_SUCCESS(status)) {
if(RtlCompareMemory(lvd->logicalVolIdent, CS0, CUR_IDENT_SZ) == CUR_IDENT_SZ) {
// no changes
- KdPrint(("UDF: equal VolIds\n"));
+ UDFPrint(("UDF: equal VolIds\n"));
status = STATUS_SUCCESS;
goto Err_SetVI;
}
if(!pvoldesc) return STATUS_INSUFFICIENT_RESOURCES;
- KdPrint(("UDF: Updating PVD @%x (%x)\n", Lba.block, Vcb->BlockSize));
+ UDFPrint(("UDF: Updating PVD @%x (%x)\n", Lba.block, Vcb->BlockSize));
status = UDFSetDstring(&(Vcb->VolIdent), (dstring*)&CS0, CUR_IDENT_SZ);
if(!OS_SUCCESS(status)) {
PEXTENT_MAP Map = NULL;
PEXTENT_INFO DataLoc;
- KdPrint(("UDFUpdateNonAllocated:\n"));
+ UDFPrint(("UDFUpdateNonAllocated:\n"));
if(!Vcb->NonAllocFileInfo) {
return STATUS_SUCCESS;
}
DataLoc = &(Vcb->NonAllocFileInfo->Dloc->DataLoc);
ASSERT(!DataLoc->Offset);
if(Vcb->NonAllocFileInfo->Dloc->DataLoc.Offset) {
- KdPrint(("NonAllocFileInfo in IN_ICB mode !!!\n"));
+ UDFPrint(("NonAllocFileInfo in IN_ICB mode !!!\n"));
return STATUS_SUCCESS;
}
PartNum = UDFGetPartNumByPhysLba(Vcb, Vcb->NonAllocFileInfo->Dloc->FELoc.Mapping[0].extLocation);
// add BAD blocks to unallocatable space
// if the block is already in NonAllocatable, ignore it
if(UDFLocateLbaInExtent(Vcb, DataLoc->Mapping, i) != LBA_OUT_OF_EXTENT) {
- KdPrint(("lba %#x is already in NonAllocFileInfo\n", i));
+ UDFPrint(("lba %#x is already in NonAllocFileInfo\n", i));
continue;
}
- KdPrint(("add lba %#x to NonAllocFileInfo\n", i));
+ UDFPrint(("add lba %#x to NonAllocFileInfo\n", i));
DataLoc->Modified = TRUE;
Ext.extLength = Vcb->LBlockSize;
// align lba on LogicalBlock boundary
// ensure that BAD space is marked as USED
UDFMarkSpaceAsXXX(Vcb, 0, &(DataLoc->Mapping[0]), AS_USED); // mark as used
- KdPrint(("UDFUpdateNonAllocated: done\n"));
+ UDFPrint(("UDFUpdateNonAllocated: done\n"));
return STATUS_SUCCESS;
} // end UDFUpdateNonAllocated()
UDFFlushAllCachedAllocations(Vcb, UDF_PREALLOC_CLASS_DIR);
if(Vcb->VerifyOnWrite) {
- KdPrint(("UDF: Flushing cache for verify\n"));
+ UDFPrint(("UDF: Flushing cache for verify\n"));
//WCacheFlushAll__(&(Vcb->FastCache), Vcb);
WCacheFlushBlocks__(&(Vcb->FastCache), Vcb, 0, Vcb->LastLBA);
UDFVFlush(Vcb);
// RAM mode
#ifdef UDF_DBG
if(!OS_SUCCESS(UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr, &(Vcb->VolIdent))))
- KdPrint(("Error updating VolIdent (1)\n"));
+ UDFPrint(("Error updating VolIdent (1)\n"));
if(!OS_SUCCESS(UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr2, &(Vcb->VolIdent))))
- KdPrint(("Error updating VolIdent (2)\n"));
+ UDFPrint(("Error updating VolIdent (2)\n"));
#else
UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr, &(Vcb->VolIdent));
UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr2, &(Vcb->VolIdent));
#ifdef UDF_DBG
if(!OS_SUCCESS(UDFUpdateVDS(Vcb, Vcb->VDS1, Vcb->VDS1 + Vcb->VDS1_Len, flags)))
- KdPrint(("Error updating Main VDS\n"));
+ UDFPrint(("Error updating Main VDS\n"));
if(!OS_SUCCESS(UDFUpdateVDS(Vcb, Vcb->VDS2, Vcb->VDS2 + Vcb->VDS2_Len, flags)))
- KdPrint(("Error updating Reserve VDS\n"));
+ UDFPrint(("Error updating Reserve VDS\n"));
#else
UDFUpdateVDS(Vcb, Vcb->VDS1, Vcb->VDS1 + Vcb->VDS1_Len, flags);
UDFUpdateVDS(Vcb, Vcb->VDS2, Vcb->VDS2 + Vcb->VDS2_Len, flags);
if(!Buf)
return 0;
- KdPrint(("UDFFindAnchor\n"));
+ UDFPrint(("UDFFindAnchor\n"));
// init probable locations...
RtlZeroMemory(&(Vcb->Anchor), sizeof(Vcb->Anchor));
Vcb->Anchor[0] = 256 + Vcb->FirstLBALastSes;
Vcb->Anchor[i] = 0;
MRW_candidate = FALSE;
if(Vcb->Anchor[i]) {
- KdPrint(("check Anchor %x\n", Vcb->Anchor[i]));
+ UDFPrint(("check Anchor %x\n", Vcb->Anchor[i]));
if(!OS_SUCCESS(status = UDFReadTagged(Vcb,Buf,
Vcb->Anchor[i], Vcb->Anchor[i], &ident))) {
if(OS_SUCCESS(status = UDFReadTagged(Vcb,Buf,
Vcb->Anchor[i]+MRW_DMA_OFFSET, Vcb->Anchor[i], &ident))) {
// do MRW workaround.....
- KdPrint(("UDF: looks like we have MRW....\n"));
+ UDFPrint(("UDF: looks like we have MRW....\n"));
MRW_candidate = TRUE;
goto MRW_workaround;
}
Vcb->Anchor[i] = 0;
if(status == STATUS_NONEXISTENT_SECTOR) {
- KdPrint(("UDF: disk seems to be incomplete\n"));
+ UDFPrint(("UDF: disk seems to be incomplete\n"));
break;
}
} else {
(ident != TID_FILE_ENTRY && ident != TID_EXTENDED_FILE_ENTRY))) {
Vcb->Anchor[i] = 0;
} else {
- KdPrint(("UDF: Found AVD at %x (point %d)\n",Vcb->Anchor[i], i));
+ UDFPrint(("UDF: Found AVD at %x (point %d)\n",Vcb->Anchor[i], i));
if(!LastBlock)
LastBlock = Vcb->LastLBA;
if(MRW_candidate) {
- KdPrint(("UDF: looks like we _*really*_ have MRW....\n"));
+ UDFPrint(("UDF: looks like we _*really*_ have MRW....\n"));
IsMRW = TRUE;
ASSERT(Vcb->LastReadTrack == 1);
Vcb->TrackMap[Vcb->LastReadTrack].Flags |= TrackMap_FixMRWAddressing;
WCachePurgeAll__(&(Vcb->FastCache), Vcb);
- KdPrint(("UDF: MRW on non-MRW drive => ReadOnly"));
+ UDFPrint(("UDF: MRW on non-MRW drive => ReadOnly"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
UDFRegisterFsStructure(Vcb, Vcb->Anchor[i], Vcb->BlockSize);
}
}
- KdPrint(("UDF: -----------------\nUDF: Last block %x\n",LastBlock));
+ UDFPrint(("UDF: -----------------\nUDF: Last block %x\n",LastBlock));
MyFreePool__(Buf);
return LastBlock;
} // end UDFFindAnchor()
// Relative to First LBA in Last Session
offset = Vcb->FirstLBA + 0x10;
- KdPrint(("UDFFindVRS:\n"));
+ UDFPrint(("UDFFindVRS:\n"));
// Process the sequence (if applicable)
for (;(offset-BeginOffset <=0x20); offset ++) {
switch (vsd->structType)
{
case 0:
- KdPrint(("UDF: ISO9660 Boot Record found\n"));
+ UDFPrint(("UDF: ISO9660 Boot Record found\n"));
break;
case 1:
- KdPrint(("UDF: ISO9660 Primary Volume Descriptor found\n"));
+ UDFPrint(("UDF: ISO9660 Primary Volume Descriptor found\n"));
break;
case 2:
- KdPrint(("UDF: ISO9660 Supplementary Volume Descriptor found\n"));
+ UDFPrint(("UDF: ISO9660 Supplementary Volume Descriptor found\n"));
break;
case 3:
- KdPrint(("UDF: ISO9660 Volume Partition Descriptor found\n"));
+ UDFPrint(("UDF: ISO9660 Volume Partition Descriptor found\n"));
break;
case 255:
- KdPrint(("UDF: ISO9660 Volume Descriptor Set Terminator found\n"));
+ UDFPrint(("UDF: ISO9660 Volume Descriptor Set Terminator found\n"));
break;
default:
- KdPrint(("UDF: ISO9660 VRS (%u) found\n", vsd->structType));
+ UDFPrint(("UDF: ISO9660 VRS (%u) found\n", vsd->structType));
break;
}
}
else if(!strncmp((int8*)(&vsd->stdIdent), STD_ID_BEA01, STD_ID_LEN))
{
- KdPrint(("UDF: BEA01 Found\n"));
+ UDFPrint(("UDF: BEA01 Found\n"));
}
else if(!strncmp((int8*)(&vsd->stdIdent), STD_ID_TEA01, STD_ID_LEN))
{
- KdPrint(("UDF: TEA01 Found\n"));
+ UDFPrint(("UDF: TEA01 Found\n"));
break;
}
else if(!strncmp((int8*)(&vsd->stdIdent), STD_ID_NSR02, STD_ID_LEN))
{
retStat |= VRS_NSR02_FOUND;
- KdPrint(("UDF: NSR02 Found\n"));
+ UDFPrint(("UDF: NSR02 Found\n"));
break;
}
else if(!strncmp((int8*)(&vsd->stdIdent), STD_ID_NSR03, STD_ID_LEN))
{
retStat |= VRS_NSR03_FOUND;
- KdPrint(("UDF: NSR03 Found\n"));
+ UDFPrint(("UDF: NSR03 Found\n"));
break;
}
}
// OSSTATUS RC = STATUS_SUCCESS;
pvoldesc = (PrimaryVolDesc *)Buf;
- KdPrint(("UDF: PrimaryVolDesc:\n"));
- KdPrint(("volDescSeqNum = %d\n", pvoldesc->volDescSeqNum));
- KdPrint(("primaryVolDescNum = %d\n", pvoldesc->primaryVolDescNum));
+ UDFPrint(("UDF: PrimaryVolDesc:\n"));
+ UDFPrint(("volDescSeqNum = %d\n", pvoldesc->volDescSeqNum));
+ UDFPrint(("primaryVolDescNum = %d\n", pvoldesc->primaryVolDescNum));
// remember recording time...
Vcb->VolCreationTime = UDFTimeToNT(&(pvoldesc->recordingDateAndTime));
// ...VolIdent...
}
UDFGetDstring(&(Vcb->VolIdent), (dstring*)&(pvoldesc->volIdent), CUR_IDENT_SZ);
#undef CUR_IDENT_SZ
- KdPrint(("volIdent[] = '%ws'\n", Vcb->VolIdent.Buffer));
+ UDFPrint(("volIdent[] = '%ws'\n", Vcb->VolIdent.Buffer));
#ifdef UDF_DBG
- KdPrint(("volSeqNum = %d\n", pvoldesc->volSeqNum));
- KdPrint(("maxVolSeqNum = %d\n", pvoldesc->maxVolSeqNum));
- KdPrint(("interchangeLvl = %d\n", pvoldesc->interchangeLvl));
- KdPrint(("maxInterchangeLvl = %d\n", pvoldesc->maxInterchangeLvl));
- KdPrint(("charSetList = %d\n", pvoldesc->charSetList));
- KdPrint(("maxCharSetList = %d\n", pvoldesc->maxCharSetList));
+ UDFPrint(("volSeqNum = %d\n", pvoldesc->volSeqNum));
+ UDFPrint(("maxVolSeqNum = %d\n", pvoldesc->maxVolSeqNum));
+ UDFPrint(("interchangeLvl = %d\n", pvoldesc->interchangeLvl));
+ UDFPrint(("maxInterchangeLvl = %d\n", pvoldesc->maxInterchangeLvl));
+ UDFPrint(("charSetList = %d\n", pvoldesc->charSetList));
+ UDFPrint(("maxCharSetList = %d\n", pvoldesc->maxCharSetList));
// ...& just print VolSetIdent
UNICODE_STRING instr;
#define CUR_IDENT_SZ (sizeof(pvoldesc->volSetIdent))
UDFGetDstring(&instr, (dstring*)&(pvoldesc->volSetIdent), CUR_IDENT_SZ);
#undef CUR_IDENT_SZ
- KdPrint(("volSetIdent[] = '%ws'\n", instr.Buffer));
-// KdPrint(("maxInterchangeLvl = %d\n", pvoldesc->maxInterchangeLvl));
- KdPrint(("flags = %x\n", pvoldesc->flags));
+ UDFPrint(("volSetIdent[] = '%ws'\n", instr.Buffer));
+// UDFPrint(("maxInterchangeLvl = %d\n", pvoldesc->maxInterchangeLvl));
+ UDFPrint(("flags = %x\n", pvoldesc->flags));
if(instr.Buffer) MyFreePool__(instr.Buffer);
#endif // UDF_DBG
} // end UDFLoadPVolDesc()
}
// walk through all sectors inside LogicalVolumeIntegrityDesc
while(loc.extLength) {
- KdPrint(("UDF: Reading LVID @%x (%x)\n", loc.extLocation, loc.extLength));
+ UDFPrint(("UDF: Reading LVID @%x (%x)\n", loc.extLocation, loc.extLength));
len = max(loc.extLength, Vcb->BlockSize);
Buf = (int8*)MyAllocatePool__(NonPagedPool,len);
if(!Buf)
RC = UDFReadTagged(Vcb,Buf, loc.extLocation, loc.extLocation, &ident);
if(!OS_SUCCESS(RC)) {
exit_with_err:
- KdPrint(("UDF: Reading LVID @%x (%x) failed.\n", loc.extLocation, loc.extLength));
+ UDFPrint(("UDF: Reading LVID @%x (%x) failed.\n", loc.extLocation, loc.extLength));
switch(Vcb->PartitialDamagedVolumeAction) {
case UDF_PART_DAMAGED_RO:
- KdPrint(("UDF: Switch to r/o mode.\n"));
+ UDFPrint(("UDF: Switch to r/o mode.\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_MEDIA_DEFECT_RO;
RC = STATUS_SUCCESS;
break;
case UDF_PART_DAMAGED_NO:
- KdPrint(("UDF: Switch to raw mount mode, return UNRECOGNIZED_VOLUME.\n"));
+ UDFPrint(("UDF: Switch to raw mount mode, return UNRECOGNIZED_VOLUME.\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_RAW_DISK;
//RC = STATUS_WRONG_VOLUME;
break;
case UDF_PART_DAMAGED_RW:
default:
- KdPrint(("UDF: Keep r/w mode for your own risk.\n"));
+ UDFPrint(("UDF: Keep r/w mode for your own risk.\n"));
RC = STATUS_SUCCESS;
// asume we have INTEGRITY_TYPE_CLOSE
Vcb->IntegrityType = INTEGRITY_TYPE_CLOSE;
LVID_iUse = UDFGetLVIDiUse(Vcb);
- KdPrint(("UDF: Last LVID:\n"));
- KdPrint((" minR: %x\n",LVID_iUse->minUDFReadRev ));
- KdPrint((" minW: %x\n",LVID_iUse->minUDFWriteRev));
- KdPrint((" maxW: %x\n",LVID_iUse->maxUDFWriteRev));
- KdPrint((" Type: %s\n",!Vcb->IntegrityType ? "Open" : "Close"));
+ UDFPrint(("UDF: Last LVID:\n"));
+ UDFPrint((" minR: %x\n",LVID_iUse->minUDFReadRev ));
+ UDFPrint((" minW: %x\n",LVID_iUse->minUDFWriteRev));
+ UDFPrint((" maxW: %x\n",LVID_iUse->maxUDFWriteRev));
+ UDFPrint((" Type: %s\n",!Vcb->IntegrityType ? "Open" : "Close"));
Vcb->minUDFReadRev = LVID_iUse->minUDFReadRev;
Vcb->minUDFWriteRev = LVID_iUse->minUDFWriteRev;
Vcb->numFiles = LVID_iUse->numFiles;
Vcb->numDirs = LVID_iUse->numDirs;
- KdPrint((" nFiles: %x\n",Vcb->numFiles ));
- KdPrint((" nDirs: %x\n",Vcb->numDirs ));
+ UDFPrint((" nFiles: %x\n",Vcb->numFiles ));
+ UDFPrint((" nDirs: %x\n",Vcb->numDirs ));
// Check if we can understand this format
if(Vcb->minUDFReadRev > UDF_MAX_READ_REVISION)
RC = STATUS_UNRECOGNIZED_VOLUME;
// Check if we know how to write here
if(Vcb->minUDFWriteRev > UDF_MAX_WRITE_REVISION) {
- KdPrint((" Target FS requires: %x Revision => ReadOnly\n",Vcb->minUDFWriteRev));
+ UDFPrint((" Target FS requires: %x Revision => ReadOnly\n",Vcb->minUDFWriteRev));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_NEW_FS_RO;
}
LVID_hd = (LogicalVolHeaderDesc*)&(Vcb->LVid->logicalVolContentsUse);
Vcb->NextUniqueId = LVID_hd->uniqueID;
- KdPrint((" Next FID: %x\n",Vcb->NextUniqueId));
+ UDFPrint((" Next FID: %x\n",Vcb->NextUniqueId));
break;
}
uint16 i, offset;
uint8 type;
OSSTATUS status = STATUS_SUCCESS;
- KdPrint(("UDF: LogicalVolDesc\n"));
+ UDFPrint(("UDF: LogicalVolDesc\n"));
// Validate partition map counter
if(!(Vcb->Partitions)) {
Vcb->PartitionMaps = lvd->numPartitionMaps;
if(Vcb->PartitionMaps != lvd->numPartitionMaps)
return STATUS_DISK_CORRUPT_ERROR;
}
- KdPrint(("UDF: volDescSeqNum = %x\n", lvd->volDescSeqNum));
+ UDFPrint(("UDF: volDescSeqNum = %x\n", lvd->volDescSeqNum));
// Get logical block size (may be different from physical)
Vcb->LBlockSize = lvd->logicalBlockSize;
// Get current UDF revision
case 32768: Vcb->LBlockSizeBits = 15; break;
case 65536: Vcb->LBlockSizeBits = 16; break;
default:
- KdPrint(("UDF: Bad block size (%ld)\n", Vcb->LBlockSize));
+ UDFPrint(("UDF: Bad block size (%ld)\n", Vcb->LBlockSize));
return STATUS_DISK_CORRUPT_ERROR;
}
- KdPrint(("UDF: logical block size (%ld)\n", Vcb->LBlockSize));
+ UDFPrint(("UDF: logical block size (%ld)\n", Vcb->LBlockSize));
Vcb->LB2B_Bits = Vcb->LBlockSizeBits - Vcb->BlockSizeBits;
- KdPrint(("UDF: mapTableLength = %x\n", lvd->mapTableLength));
- KdPrint(("UDF: numPartitionMaps = %x\n", lvd->numPartitionMaps));
+ UDFPrint(("UDF: mapTableLength = %x\n", lvd->mapTableLength));
+ UDFPrint(("UDF: numPartitionMaps = %x\n", lvd->numPartitionMaps));
// walk through all available part maps
for (i=0,offset=0;
i<Vcb->PartitionMaps && offset<lvd->mapTableLength;
{
GenericPartitionMap* gpm = (GenericPartitionMap *)(((uint8*)(lvd+1))+offset);
type = gpm->partitionMapType;
- KdPrint(("Partition (%d) type %x, len %x\n", i, type, gpm->partitionMapLength));
+ UDFPrint(("Partition (%d) type %x, len %x\n", i, type, gpm->partitionMapLength));
if(type == PARTITION_MAP_TYPE_1)
{
GenericPartitionMap1 *gpm1 = (GenericPartitionMap1 *)(((uint8*)(lvd+1))+offset);
if( (udfis->currentRev == 0x0150)/* ||
(Vcb->CurrentUDFRev == 0x0150)*/ ) {
- KdPrint(("Found VAT 1.50\n"));
+ UDFPrint(("Found VAT 1.50\n"));
Vcb->Partitions[i].PartitionType = UDF_VIRTUAL_MAP15;
} else
if( (udfis->currentRev == 0x0200) ||
(udfis->currentRev == 0x0201) /*||
(Vcb->CurrentUDFRev == 0x0200) ||
(Vcb->CurrentUDFRev == 0x0201)*/ ) {
- KdPrint(("Found VAT 2.00\n"));
+ UDFPrint(("Found VAT 2.00\n"));
Vcb->Partitions[i].PartitionType = UDF_VIRTUAL_MAP20;
}
status = STATUS_SUCCESS;
}
else if(!strncmp((int8*)&(upm2->partIdent.ident), UDF_ID_SPARABLE, strlen(UDF_ID_SPARABLE)))
{
- KdPrint(("Load sparing table\n"));
+ UDFPrint(("Load sparing table\n"));
PSPARABLE_PARTITION_MAP spm = (PSPARABLE_PARTITION_MAP)(((uint8*)(lvd+1))+offset);
Vcb->Partitions[i].PartitionType = UDF_SPARABLE_MAP15;
status = UDFLoadSparingTable(Vcb, spm);
}
else if(!strncmp((int8*)&(upm2->partIdent.ident), UDF_ID_METADATA, strlen(UDF_ID_METADATA)))
{
- KdPrint(("Found metadata partition\n"));
+ UDFPrint(("Found metadata partition\n"));
// PMETADATA_PARTITION_MAP mpm = (PMETADATA_PARTITION_MAP)(((uint8*)(lvd+1))+offset);
Vcb->Partitions[i].PartitionType = UDF_METADATA_MAP25;
//status = UDFLoadSparingTable(Vcb, spm);
}
else
{
- KdPrint(("Unknown ident: %s\n", upm2->partIdent.ident));
+ UDFPrint(("Unknown ident: %s\n", upm2->partIdent.ident));
continue;
}
Vcb->Partitions[i].VolumeSeqNum = upm2->volSeqNum;
// remember FileSet location
long_ad *la = (long_ad *)&(lvd->logicalVolContentsUse[0]);
*fileset = (la->extLocation);
- KdPrint(("FileSet found in LogicalVolDesc at block=%x, partition=%d\n",
+ UDFPrint(("FileSet found in LogicalVolDesc at block=%x, partition=%d\n",
fileset->logicalBlockNum,
fileset->partitionReferenceNum));
}
)
{
// LogicalVolDesc *lvd = (LogicalVolDesc *)Buf;
- KdPrint(("UDF: Bogus LogicalVolDesc\n"));
+ UDFPrint(("UDF: Bogus LogicalVolDesc\n"));
// Validate partition map counter
if(!(Vcb->Partitions)) {
Vcb->PartitionMaps = 1;
if(Vcb->PartitionMaps != 1)
return STATUS_DISK_CORRUPT_ERROR;
}
- KdPrint(("UDF: volDescSeqNum = %x\n", 0));
+ UDFPrint(("UDF: volDescSeqNum = %x\n", 0));
// Get logical block size (may be different from physical)
Vcb->LBlockSize = 2048;
// Get current UDF revision
if(Vcb->LBlockSize < Vcb->BlockSize)
return STATUS_DISK_CORRUPT_ERROR;
Vcb->LBlockSizeBits = 11;
- KdPrint(("UDF: logical block size (%ld)\n", Vcb->LBlockSize));
+ UDFPrint(("UDF: logical block size (%ld)\n", Vcb->LBlockSize));
Vcb->LB2B_Bits = Vcb->LBlockSizeBits - Vcb->BlockSizeBits;
- KdPrint(("UDF: mapTableLength = %x\n", 0));
- KdPrint(("UDF: numPartitionMaps = %x\n", 0));
+ UDFPrint(("UDF: mapTableLength = %x\n", 0));
+ UDFPrint(("UDF: numPartitionMaps = %x\n", 0));
// if(CDRW) {
/* } else if(CDR)
if()
- KdPrint(("Found VAT 1.50\n"));
+ UDFPrint(("Found VAT 1.50\n"));
Vcb->Partitions[i].PartitionType = UDF_VIRTUAL_MAP15;
} else
- KdPrint(("Found VAT 2.00\n"));
+ UDFPrint(("Found VAT 2.00\n"));
Vcb->Partitions[i].PartitionType = UDF_VIRTUAL_MAP20;
}
}
// long_ad *la = (long_ad *)&(lvd->logicalVolContentsUse[0]);
fileset->logicalBlockNum = 0;
fileset->partitionReferenceNum = 0;
- KdPrint(("FileSet found in LogicalVolDesc at block=%x, partition=%d\n",
+ UDFPrint(("FileSet found in LogicalVolDesc at block=%x, partition=%d\n",
fileset->logicalBlockNum,
fileset->partitionReferenceNum));
}
BOOLEAN bit_set;
UDF_CHECK_BITMAP_RESOURCE(Vcb);
- KdPrint(("UDFAddXSpaceBitmap: at block=%x, partition=%d\n",
+ UDFPrint(("UDFAddXSpaceBitmap: at block=%x, partition=%d\n",
bm->extPosition,
PartNum));
UDF_CHECK_BITMAP_RESOURCE(Vcb);
- KdPrint((" UDFVerifyXSpaceBitmap: part %x\n", PartNum));
+ UDFPrint((" UDFVerifyXSpaceBitmap: part %x\n", PartNum));
if(!(Length = (bm->extLength & UDF_EXTENT_LENGTH_MASK))) return STATUS_SUCCESS;
// i=UDFPartStart(Vcb, PartNum);
DbgFreePool(tmp);
return status;
}
- KdPrint((" BM Lba %x\n", lba));
+ UDFPrint((" BM Lba %x\n", lba));
if(Ident != TID_SPACE_BITMAP_DESC) {
status = STATUS_DISK_CORRUPT_ERROR;
goto err_vfyxsbm_1;
PartNum = UDFGetPartNumByPartNdx(Vcb, PartNdx);
- KdPrint(("UDFVerifyFreeSpaceBitmap:\n"));
+ UDFPrint(("UDFVerifyFreeSpaceBitmap:\n"));
// read info for partition header (if any)
if(phd) {
// read unallocated Bitmap
}
// read UnallocatedSpaceDesc & convert to Bitmap
if(Lba) {
- KdPrint((" Lba @%x\n", Lba));
+ UDFPrint((" Lba @%x\n", Lba));
if(!(AllocDesc = (int8*)MyAllocatePool__(NonPagedPool, Vcb->LBlockSize + sizeof(EXTENT_AD) )))
return STATUS_INSUFFICIENT_RESOURCES;
RtlZeroMemory(((int8*)AllocDesc) + Vcb->LBlockSize, sizeof(EXTENT_AD));
Extent = UDFMergeMappings(Extent, (PEXTENT_MAP)(AllocDesc+sizeof(UNALLOC_SPACE_DESC)) );
#ifdef UDF_DBG
} else {
- KdPrint(("Broken unallocated space descriptor sequence\n"));
+ UDFPrint(("Broken unallocated space descriptor sequence\n"));
#endif // UDF_DBG
}
}
Extent = UDFMergeMappings(Extent, (PEXTENT_MAP)(AllocDesc+sizeof(UNALLOC_SPACE_DESC)) );
#ifdef UDF_DBG
} else {
- KdPrint(("Broken unallocated space descriptor sequence\n"));
+ UDFPrint(("Broken unallocated space descriptor sequence\n"));
#endif // UDF_DBG
}
}
uint32 i;
OSSTATUS RC;
BOOLEAN Found = FALSE;
- KdPrint(("UDF: Pard Descr:\n"));
- KdPrint((" volDescSeqNum = %x\n", p->volDescSeqNum));
- KdPrint((" partitionFlags = %x\n", p->partitionFlags));
- KdPrint((" partitionNumber = %x\n", p->partitionNumber));
- KdPrint((" accessType = %x\n", p->accessType));
- KdPrint((" partitionStartingLocation = %x\n", p->partitionStartingLocation));
- KdPrint((" partitionLength = %x\n", p->partitionLength));
+ UDFPrint(("UDF: Pard Descr:\n"));
+ UDFPrint((" volDescSeqNum = %x\n", p->volDescSeqNum));
+ UDFPrint((" partitionFlags = %x\n", p->partitionFlags));
+ UDFPrint((" partitionNumber = %x\n", p->partitionNumber));
+ UDFPrint((" accessType = %x\n", p->accessType));
+ UDFPrint((" partitionStartingLocation = %x\n", p->partitionStartingLocation));
+ UDFPrint((" partitionLength = %x\n", p->partitionLength));
// There is nothing interesting to comment here
// Just look at Names & Messages....
for (i=0; i<Vcb->PartitionMaps; i++) {
- KdPrint(("Searching map: (%d == %d)\n",
+ UDFPrint(("Searching map: (%d == %d)\n",
Vcb->Partitions[i].PartitionNum, (p->partitionNumber) ));
if(Vcb->Partitions[i].PartitionNum == (p->partitionNumber)) {
Found = TRUE;
Vcb->Partitions[i].UspaceBitmap = 0xFFFFFFFF;
Vcb->Partitions[i].FspaceBitmap = 0xFFFFFFFF;
Vcb->Partitions[i].AccessType = p->accessType;
- KdPrint(("Access mode %x\n", p->accessType));
+ UDFPrint(("Access mode %x\n", p->accessType));
if(p->accessType == PARTITION_ACCESS_WO) {
Vcb->CDR_Mode = TRUE;
// Vcb->Partitions[i].PartitionLen = Vcb->LastPossibleLBA - p->partitionStartingLocation;
} else if(p->accessType < PARTITION_ACCESS_WO) {
// Soft-read-only volume
- KdPrint(("Soft Read-only volume\n"));
+ UDFPrint(("Soft Read-only volume\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_PART_RO;
} else if(p->accessType > PARTITION_ACCESS_MAX_KNOWN) {
phd = (PPARTITION_HEADER_DESC)(p->partitionContentsUse);
#ifdef UDF_DBG
if(phd->unallocatedSpaceTable.extLength)
- KdPrint(("unallocatedSpaceTable (part %d)\n", i));
+ UDFPrint(("unallocatedSpaceTable (part %d)\n", i));
#endif // UDF_DBG
if(phd->unallocatedSpaceBitmap.extLength) {
Vcb->Partitions[i].UspaceBitmap =
phd->unallocatedSpaceBitmap.extPosition;
- KdPrint(("unallocatedSpaceBitmap (part %d) @ %x\n",
+ UDFPrint(("unallocatedSpaceBitmap (part %d) @ %x\n",
i, Vcb->Partitions[i].UspaceBitmap ));
}
#ifdef UDF_DBG
if(phd->partitionIntegrityTable.extLength)
- KdPrint(("partitionIntegrityTable (part %d)\n", i));
+ UDFPrint(("partitionIntegrityTable (part %d)\n", i));
if(phd->freedSpaceTable.extLength)
- KdPrint(("freedSpaceTable (part %d)\n", i));
+ UDFPrint(("freedSpaceTable (part %d)\n", i));
#endif // UDF_DBG
if(phd->freedSpaceBitmap.extLength) {
Vcb->Partitions[i].FspaceBitmap =
phd->freedSpaceBitmap.extPosition;
- KdPrint(("freedSpaceBitmap (part %d)\n", i));
+ UDFPrint(("freedSpaceBitmap (part %d)\n", i));
}
RC = UDFBuildFreeSpaceBitmap(Vcb, i, phd, 0);
//Vcb->Modified = FALSE;
}
#ifdef UDF_DBG
if(!Found) {
- KdPrint(("Partition (%d) not found in partition map\n", (p->partitionNumber) ));
+ UDFPrint(("Partition (%d) not found in partition map\n", (p->partitionNumber) ));
} else {
- KdPrint(("Partition (%d:%d type %x) starts at physical %x, length %x\n",
+ UDFPrint(("Partition (%d:%d type %x) starts at physical %x, length %x\n",
p->partitionNumber, i-1, Vcb->Partitions[i-1].PartitionType,
Vcb->Partitions[i-1].PartitionRoot, Vcb->Partitions[i-1].PartitionLen));
}
uint32 i;
OSSTATUS RC;
BOOLEAN Found = FALSE;
- KdPrint(("UDF: Verify Part Descr:\n"));
- KdPrint((" volDescSeqNum = %x\n", p->volDescSeqNum));
- KdPrint((" partitionFlags = %x\n", p->partitionFlags));
- KdPrint((" partitionNumber = %x\n", p->partitionNumber));
- KdPrint((" accessType = %x\n", p->accessType));
- KdPrint((" partitionStartingLocation = %x\n", p->partitionStartingLocation));
- KdPrint((" partitionLength = %x\n", p->partitionLength));
+ UDFPrint(("UDF: Verify Part Descr:\n"));
+ UDFPrint((" volDescSeqNum = %x\n", p->volDescSeqNum));
+ UDFPrint((" partitionFlags = %x\n", p->partitionFlags));
+ UDFPrint((" partitionNumber = %x\n", p->partitionNumber));
+ UDFPrint((" accessType = %x\n", p->accessType));
+ UDFPrint((" partitionStartingLocation = %x\n", p->partitionStartingLocation));
+ UDFPrint((" partitionLength = %x\n", p->partitionLength));
// There is nothing interesting to comment here
// Just look at Names & Messages....
for (i=0; i<Vcb->PartitionMaps; i++) {
- KdPrint(("Searching map: (%d == %d)\n",
+ UDFPrint(("Searching map: (%d == %d)\n",
Vcb->Partitions[i].PartitionNum, (p->partitionNumber) ));
if(Vcb->Partitions[i].PartitionNum == (p->partitionNumber)) {
Found = TRUE;
// Vcb->Partitions[i].FspaceBitmap = 0xFFFFFFFF;
if(Vcb->Partitions[i].AccessType != p->accessType)
return STATUS_DISK_CORRUPT_ERROR;
- KdPrint(("Access mode %x\n", p->accessType));
+ UDFPrint(("Access mode %x\n", p->accessType));
if(p->accessType == PARTITION_ACCESS_WO) {
if(Vcb->CDR_Mode != TRUE)
return STATUS_DISK_CORRUPT_ERROR;
// Vcb->Partitions[i].PartitionLen = Vcb->LastPossibleLBA - p->partitionStartingLocation;
} else if(p->accessType < PARTITION_ACCESS_WO) {
// Soft-read-only volume
- KdPrint(("Soft Read-only volume\n"));
+ UDFPrint(("Soft Read-only volume\n"));
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY))
return STATUS_DISK_CORRUPT_ERROR;
} else if(p->accessType > PARTITION_ACCESS_MAX_KNOWN) {
phd = (PPARTITION_HEADER_DESC)(p->partitionContentsUse);
#ifdef UDF_DBG
if(phd->unallocatedSpaceTable.extLength)
- KdPrint(("unallocatedSpaceTable (part %d)\n", i));
+ UDFPrint(("unallocatedSpaceTable (part %d)\n", i));
#endif // UDF_DBG
if(phd->unallocatedSpaceBitmap.extLength) {
if(Vcb->Partitions[i].UspaceBitmap ==
phd->unallocatedSpaceBitmap.extPosition) {
- KdPrint(("Warning: both USpaceBitmaps have same location\n"));
+ UDFPrint(("Warning: both USpaceBitmaps have same location\n"));
}
- KdPrint(("unallocatedSpaceBitmap (part %d) @ %x\n",
+ UDFPrint(("unallocatedSpaceBitmap (part %d) @ %x\n",
i, Vcb->Partitions[i].UspaceBitmap ));
}
#ifdef UDF_DBG
if(phd->partitionIntegrityTable.extLength)
- KdPrint(("partitionIntegrityTable (part %d)\n", i));
+ UDFPrint(("partitionIntegrityTable (part %d)\n", i));
if(phd->freedSpaceTable.extLength)
- KdPrint(("freedSpaceTable (part %d)\n", i));
+ UDFPrint(("freedSpaceTable (part %d)\n", i));
#endif // UDF_DBG
if(phd->freedSpaceBitmap.extLength) {
if(Vcb->Partitions[i].FspaceBitmap ==
phd->freedSpaceBitmap.extPosition) {
- KdPrint(("Warning: both FSpaceBitmaps have same location\n"));
+ UDFPrint(("Warning: both FSpaceBitmaps have same location\n"));
}
- KdPrint(("freedSpaceBitmap (part %d)\n", i));
+ UDFPrint(("freedSpaceBitmap (part %d)\n", i));
}
RC = UDFVerifyFreeSpaceBitmap(Vcb, i, phd, 0);
//Vcb->Modified = FALSE;
}
#ifdef UDF_DBG
if(!Found) {
- KdPrint(("Partition (%d) not found in partition map\n", (p->partitionNumber) ));
+ UDFPrint(("Partition (%d) not found in partition map\n", (p->partitionNumber) ));
} else {
- KdPrint(("Partition (%d:%d type %x) starts at physical %x, length %x\n",
+ UDFPrint(("Partition (%d:%d type %x) starts at physical %x, length %x\n",
p->partitionNumber, i-1, Vcb->Partitions[i-1].PartitionType,
Vcb->Partitions[i-1].PartitionRoot, Vcb->Partitions[i-1].PartitionLen));
}
uint32 vdsn;
uint16 ident;
- KdPrint(("UDF: Read VDS (%x - %x)\n", block, lastblock ));
+ UDFPrint(("UDF: Read VDS (%x - %x)\n", block, lastblock ));
// Read the main descriptor sequence
for (;(!done && block <= lastblock); block++)
{
// Process each descriptor (ISO 13346 3/8.3-8.4)
gd = (struct GenericDesc *)Buf;
vdsn = gd->volDescSeqNum;
- KdPrint(("LBA %x, Ident = %x, vdsn = %x\n", block, ident, vdsn ));
+ UDFPrint(("LBA %x, Ident = %x, vdsn = %x\n", block, ident, vdsn ));
switch (ident)
{
case TID_PRIMARY_VOL_DESC: // ISO 13346 3/10.1
vds[VDS_POS_VOL_DESC_PTR].block = block;
vds[VDS_POS_RECURSION_COUNTER].volDescSeqNum++;
if(vds[VDS_POS_RECURSION_COUNTER].volDescSeqNum > MAX_VDS_PARTS) {
- KdPrint(("too long multipart VDS -> abort\n"));
+ UDFPrint(("too long multipart VDS -> abort\n"));
return STATUS_DISK_CORRUPT_ERROR;
}
pVDP = (struct VolDescPtr*)Buf;
- KdPrint(("multipart VDS...\n"));
+ UDFPrint(("multipart VDS...\n"));
return UDFReadVDS(Vcb, pVDP->nextVolDescSeqExt.extLocation,
pVDP->nextVolDescSeqExt.extLocation + (pVDP->nextVolDescSeqExt.extLocation >> Vcb->BlockSizeBits),
vds, Buf);
{
ImpUseVolDesc* iuvd = (ImpUseVolDesc*)Buf;
ImpUseVolDescImpUse* iuvdiu = (ImpUseVolDescImpUse*)&(iuvd->impUse);
- KdPrint(("UDF: Imp Use Vol Desc:\n"));
- KdPrint((" volDescSeqNum = %x\n", iuvd->volDescSeqNum));
- KdPrint(("UDF: Imp Use Vol Desc Imp Use:\n"));
+ UDFPrint(("UDF: Imp Use Vol Desc:\n"));
+ UDFPrint((" volDescSeqNum = %x\n", iuvd->volDescSeqNum));
+ UDFPrint(("UDF: Imp Use Vol Desc Imp Use:\n"));
KdDump(iuvdiu, sizeof(ImpUseVolDescImpUse));
return STATUS_SUCCESS;
} // UDFLoadImpUseVolDesc()
int8* Buf
)
{
- KdPrint(("UDF: Unallocated Space Desc:\n"));
+ UDFPrint(("UDF: Unallocated Space Desc:\n"));
// UnallocatedSpaceDesc* usd = (UnallocatedSpaceDesc*)Buf;
return STATUS_SUCCESS;
} // UDFLoadImpUseVolDesc()
{
*root = fset->rootDirectoryICB.extLocation;
Vcb->SerialNumber = fset->descTag.tagSerialNum;
- KdPrint(("Rootdir at block=%x, partition=%d\n",
+ UDFPrint(("Rootdir at block=%x, partition=%d\n",
root->logicalBlockNum, root->partitionReferenceNum));
if(sysstream) {
*sysstream = fset->streamDirectoryICB.extLocation;
- KdPrint(("SysStream at block=%x, partition=%d\n",
+ UDFPrint(("SysStream at block=%x, partition=%d\n",
sysstream->logicalBlockNum, sysstream->partitionReferenceNum));
}
// Get current UDF revision
if(OS_SUCCESS(RC)) {
// Process the main & reserve sequences
// responsible for finding the PartitionDesc(s)
- KdPrint(("-----------------------------------\n"));
- KdPrint(("UDF: Main sequence:\n"));
+ UDFPrint(("-----------------------------------\n"));
+ UDFPrint(("UDF: Main sequence:\n"));
RC = UDFProcessSequence(DeviceObject, Vcb, main_s, main_e, fileset);
}
// Remenber bad sequence
UDFRememberBadSequence(Vcb, main_s, RC);
- KdPrint(("-----------------------------------\n"));
- KdPrint(("UDF: Main sequence failed.\n"));
- KdPrint(("UDF: Reserve sequence\n"));
+ UDFPrint(("-----------------------------------\n"));
+ UDFPrint(("UDF: Main sequence failed.\n"));
+ UDFPrint(("UDF: Reserve sequence\n"));
if(Vcb->LVid) MyFreePool__(Vcb->LVid);
Vcb->LVid = NULL;
}
if(OS_SUCCESS(RC2)) {
- KdPrint(("-----------------------------------\n"));
+ UDFPrint(("-----------------------------------\n"));
Vcb->VDS2_Len = reserve_e - reserve_s;
Vcb->VDS2 = reserve_s;
RC = STATUS_SUCCESS;
Vcb->LVid = NULL;*/
if(OS_SUCCESS(UDFVerifySequence(DeviceObject, Vcb, reserve_s, reserve_e, fileset)))
{
- KdPrint(("-----------------------------------\n"));
+ UDFPrint(("-----------------------------------\n"));
Vcb->VDS2_Len = reserve_e - reserve_s;
Vcb->VDS2 = reserve_s;
break;
} else {
- KdPrint(("UDF: Reserve sequence verification failed.\n"));
+ UDFPrint(("UDF: Reserve sequence verification failed.\n"));
switch(Vcb->PartitialDamagedVolumeAction) {
case UDF_PART_DAMAGED_RO:
- KdPrint(("UDF: Switch to r/o mode.\n"));
+ UDFPrint(("UDF: Switch to r/o mode.\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
break;
case UDF_PART_DAMAGED_NO:
- KdPrint(("UDF: Switch to raw mount mode, return UNRECOGNIZED_VOLUME.\n"));
+ UDFPrint(("UDF: Switch to raw mount mode, return UNRECOGNIZED_VOLUME.\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_RAW_DISK;
RC = STATUS_WRONG_VOLUME;
break;
case UDF_PART_DAMAGED_RW:
default:
- KdPrint(("UDF: Keep r/w mode for your own risk.\n"));
+ UDFPrint(("UDF: Keep r/w mode for your own risk.\n"));
break;
}
}
if(Vcb->SparingCount &&
(Vcb->NoFreeRelocationSpaceVolumeAction != UDF_PART_DAMAGED_RW)) {
- KdPrint(("UDF: No free Sparing Entries -> Switch to r/o mode.\n"));
+ UDFPrint(("UDF: No free Sparing Entries -> Switch to r/o mode.\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
}
if(i == sizeof(Vcb->Anchor)/sizeof(int)) {
- KdPrint(("No Anchor block found\n"));
+ UDFPrint(("No Anchor block found\n"));
RC = STATUS_UNRECOGNIZED_VOLUME;
#ifdef UDF_DBG
} else {
- KdPrint(("Using anchor in block %x\n", Vcb->Anchor[i]));
+ UDFPrint(("Using anchor in block %x\n", Vcb->Anchor[i]));
#endif // UDF_DBG
}
MyFreePool__(Buf);
Vcb->SparingCountFree = -1;
- KdPrint(("UDF: Sparable Part Map:\n"));
+ UDFPrint(("UDF: Sparable Part Map:\n"));
Vcb->SparingTableLength = PartMap->sizeSparingTable;
BC = (PartMap->sizeSparingTable >> Vcb->BlockSizeBits) + 1;
- KdPrint((" partitionMapType = %x\n", PartMap->partitionMapType));
- KdPrint((" partitionMapLength = %x\n", PartMap->partitionMapLength));
- KdPrint((" volSeqNum = %x\n", PartMap->volSeqNum));
- KdPrint((" partitionNum = %x\n", PartMap->partitionNum));
- KdPrint((" packetLength = %x\n", PartMap->packetLength));
- KdPrint((" numSparingTables = %x\n", PartMap->numSparingTables));
- KdPrint((" sizeSparingTable = %x\n", PartMap->sizeSparingTable));
+ UDFPrint((" partitionMapType = %x\n", PartMap->partitionMapType));
+ UDFPrint((" partitionMapLength = %x\n", PartMap->partitionMapLength));
+ UDFPrint((" volSeqNum = %x\n", PartMap->volSeqNum));
+ UDFPrint((" partitionNum = %x\n", PartMap->partitionNum));
+ UDFPrint((" packetLength = %x\n", PartMap->packetLength));
+ UDFPrint((" numSparingTables = %x\n", PartMap->numSparingTables));
+ UDFPrint((" sizeSparingTable = %x\n", PartMap->sizeSparingTable));
SparTable = (PSPARING_TABLE)MyAllocatePool__(NonPagedPool, BC*Vcb->BlockSize);
if(!SparTable) return STATUS_INSUFFICIENT_RESOURCES;
if(Vcb->SparingTable) {
SparTableLoc = ((uint32*)(PartMap+1))[i];
for(n=0; n<Vcb->SparingTableCount; n++) {
if(Vcb->SparingTableLoc[i] == SparTableLoc) {
- KdPrint((" already processed @%x\n",
+ UDFPrint((" already processed @%x\n",
SparTableLoc
));
continue;
Vcb->BlockSize-1)
>> Vcb->BlockSizeBits);
if(BC2 > BC) {
- KdPrint((" sizeSparingTable @%x too long: %x > %x\n",
+ UDFPrint((" sizeSparingTable @%x too long: %x > %x\n",
SparTableLoc, BC2, BC
));
continue;
UDFRegisterFsStructure(Vcb, SparTableLoc, BC2<<Vcb->BlockSizeBits);
if(!OS_SUCCESS(status)) {
- KdPrint((" Error reading sizeSparingTable @%x (%x)\n",
+ UDFPrint((" Error reading sizeSparingTable @%x (%x)\n",
SparTableLoc, BC2
));
continue;
merged = TRUE;
for(m=0; m<Vcb->SparingCount; m++) {
if(RelocMap[m].mappedLocation == NewRelocMap[n].mappedLocation) {
- KdPrint((" dup @%x (%x) vs @%x (%x)\n",
+ UDFPrint((" dup @%x (%x) vs @%x (%x)\n",
RelocMap[m].origLocation, RelocMap[m].mappedLocation,
NewRelocMap[m].origLocation, NewRelocMap[m].mappedLocation));
merged = FALSE;
(RelocMap[m].mappedLocation != NewRelocMap[n].mappedLocation) &&
(RelocMap[m].origLocation != SPARING_LOC_AVAILABLE) &&
(RelocMap[m].origLocation != SPARING_LOC_CORRUPTED)) {
- KdPrint((" conflict @%x (%x) vs @%x (%x)\n",
+ UDFPrint((" conflict @%x (%x) vs @%x (%x)\n",
RelocMap[m].origLocation, RelocMap[m].mappedLocation,
NewRelocMap[n].origLocation, NewRelocMap[n].mappedLocation));
merged = FALSE;
}
if(merged) {
RelocMap[Vcb->SparingCount] = NewRelocMap[n];
- KdPrint((" reloc %x -> %x\n",
+ UDFPrint((" reloc %x -> %x\n",
RelocMap[Vcb->SparingCount].origLocation, RelocMap[Vcb->SparingCount].mappedLocation));
Vcb->SparingCount++;
if(RelocMap[Vcb->SparingCount].origLocation == SPARING_LOC_AVAILABLE) {
Vcb->SparingCount += NewSize/sizeof(SPARING_ENTRY);
*/
if(Vcb->SparingTableCount >= MAX_SPARING_TABLE_LOCATIONS) {
- KdPrint((" too many Sparing Tables\n"));
+ UDFPrint((" too many Sparing Tables\n"));
break;
}
}
int8* Buf = NULL;
uint32 ReadBytes;
- KdPrint(("UDFGetDiskInfoAndVerify\n"));
+ UDFPrint(("UDFGetDiskInfoAndVerify\n"));
_SEH2_TRY {
if(!UDFFindAnchor(Vcb)) {
if(Vcb->FsDeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM) {
// check if this disc is mountable for CDFS
- KdPrint((" FILE_DEVICE_CD_ROM_FILE_SYSTEM\n"));
+ UDFPrint((" FILE_DEVICE_CD_ROM_FILE_SYSTEM\n"));
check_NSR:
NSRDesc = UDFFindVRS(Vcb);
if(!(NSRDesc & VRS_ISO9660_FOUND)) {
// no CDFS VRS found
- KdPrint(("UDFGetDiskInfoAndVerify: no CDFS VRS found\n"));
+ UDFPrint(("UDFGetDiskInfoAndVerify: no CDFS VRS found\n"));
if(!Vcb->TrackMap[Vcb->LastTrackNum].LastLba &&
!Vcb->TrackMap[Vcb->FirstTrackNum].LastLba) {
// such a stupid method of Audio-CD detection...
- KdPrint(("UDFGetDiskInfoAndVerify: set UDF_VCB_FLAGS_RAW_DISK\n"));
+ UDFPrint(("UDFGetDiskInfoAndVerify: set UDF_VCB_FLAGS_RAW_DISK\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_RAW_DISK;
}
}
try_return(RC = STATUS_UNRECOGNIZED_VOLUME);
RC = STATUS_UNRECOGNIZED_VOLUME;
if(!UDFCheckZeroBuf(Buf,0x10000)) {
- KdPrint(("UDFGetDiskInfoAndVerify: possible FS detected, remove UDF_VCB_FLAGS_RAW_DISK\n"));
+ UDFPrint(("UDFGetDiskInfoAndVerify: possible FS detected, remove UDF_VCB_FLAGS_RAW_DISK\n"));
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_RAW_DISK;
}
MyFreePool__(Buf);
RC = UDFLoadPartition(DeviceObject,Vcb,&fileset);
if(!OS_SUCCESS(RC)) {
if(RC == STATUS_UNRECOGNIZED_VOLUME) {
- KdPrint(("UDFGetDiskInfoAndVerify: check NSR presence\n"));
+ UDFPrint(("UDFGetDiskInfoAndVerify: check NSR presence\n"));
goto check_NSR;
}
try_return(RC);
// BOOLEAN FlushAndEject = FALSE;
- KdPrint((" UDFEjectReqWaiter: start\n"));
+ UDFPrint((" UDFEjectReqWaiter: start\n"));
uint8 supported_evt_classes = 0;
uint32 i, j;
uint8 evt_type;
if(UseEvent) {
supported_evt_classes = EventStat_Class_Media;
} else {
- KdPrint((" Eject Button ignored\n"));
+ UDFPrint((" Eject Button ignored\n"));
}
for(j=0; j<4; j++) {
- KdPrint((" Reading events... (0)\n"));
+ UDFPrint((" Reading events... (0)\n"));
if(supported_evt_classes) {
for(i=1; i<=EventRetStat_Class_Mask;i++) {
evt_type = (((UCHAR)1) << i);
KeSetEvent(WC->WaiterStopped, 0, FALSE);
MyFreePool__(WC);
WC = NULL;
- KdPrint((" UDFEjectReqWaiter: exit 3\n"));
+ UDFPrint((" UDFEjectReqWaiter: exit 3\n"));
return;
}
BM_FlushPriod = Vcb->BM_FlushPriod;
Error,sizeof(GET_LAST_ERROR_USER_OUT),
TRUE,NULL);
UDFReleaseResource(&(Vcb->IoResource));
- KdPrint(("SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
+ UDFPrint(("SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
Error->SenseKey, Error->AdditionalSenseCode, Error->AdditionalSenseCodeQualifier, Error->LastError));
// check for Long Write In Progress
if( ((Error->SenseKey == SCSI_SENSE_NOT_READY) &&
||
(Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL)) {
// we should forget about this disk...
- KdPrint((" LAST_WRITE %x\n", !!(Vcb->VCBFlags & UDF_VCB_LAST_WRITE)));
- KdPrint((" UDF_VCB_FLAGS_UNSAFE_IOCTL %x\n", !!(Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL)));
- KdPrint((" UDFEjectReqWaiter: Unexpected write-in-progress on !Modified volume\n"));
+ UDFPrint((" LAST_WRITE %x\n", !!(Vcb->VCBFlags & UDF_VCB_LAST_WRITE)));
+ UDFPrint((" UDF_VCB_FLAGS_UNSAFE_IOCTL %x\n", !!(Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL)));
+ UDFPrint((" UDFEjectReqWaiter: Unexpected write-in-progress on !Modified volume\n"));
//ASSERT(FALSE);
Vcb->ForgetVolume = TRUE;
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY | UDF_VCB_FLAGS_MEDIA_READ_ONLY;
!(WC->DevCap.Capabilities2 & DevCap_lock_state)) {
// probably bus reset or power failure occured
// re-lock tray
- KdPrint((" UDFEjectReqWaiter: Unexpected tray unlock encountered. Try to re-lock\n"));
+ UDFPrint((" UDFEjectReqWaiter: Unexpected tray unlock encountered. Try to re-lock\n"));
UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
VcbAcquired = TRUE;
AllFlushed = FALSE;
- KdPrint((" SkipCount=%x, SkipCountLimit=%x\n",
+ UDFPrint((" SkipCount=%x, SkipCountLimit=%x\n",
SkipCount,
Vcb->SkipCountLimit));
if( Tree_FlushPriod &&
(Tree_FlushPriod < Vcb->Tree_FlushTime)) {
- KdPrint((" Tree_FlushPriod %I64x, Vcb->Tree_FlushTime %I64x\n",
+ UDFPrint((" Tree_FlushPriod %I64x, Vcb->Tree_FlushTime %I64x\n",
Tree_FlushPriod,
Vcb->Tree_FlushTime));
VcbAcquired = TRUE;
}
- KdPrint(("UDF: Flushing Directory Tree....\n"));
+ UDFPrint(("UDF: Flushing Directory Tree....\n"));
if( BM_FlushPriod &&
(BM_FlushPriod < Vcb->BM_FlushTime)) {
- KdPrint((" full flush\n"));
+ UDFPrint((" full flush\n"));
flush_stat = UDFFlushADirectory(Vcb, Vcb->RootDirFCB->FileInfo, &IoStatus, UDF_FLUSH_FLAGS_BREAKABLE);
} else {
- KdPrint((" light flush\n"));
+ UDFPrint((" light flush\n"));
flush_stat = UDFFlushADirectory(Vcb, Vcb->RootDirFCB->FileInfo, &IoStatus, UDF_FLUSH_FLAGS_BREAKABLE | UDF_FLUSH_FLAGS_LITE);
}
if(flush_stat & UDF_FLUSH_FLAGS_INTERRUPTED)
if( BM_FlushPriod &&
(BM_FlushPriod < Vcb->BM_FlushTime)) {
- KdPrint((" BM_FlushPriod %I64x, Vcb->BM_FlushTime %I64x\n",
+ UDFPrint((" BM_FlushPriod %I64x, Vcb->BM_FlushTime %I64x\n",
BM_FlushPriod,
Vcb->BM_FlushTime));
UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr2, &(Vcb->VolIdent));
if(Vcb->VerifyOnWrite) {
- KdPrint(("UDF: Flushing cache for verify\n"));
+ UDFPrint(("UDF: Flushing cache for verify\n"));
//WCacheFlushAll__(&(Vcb->FastCache), Vcb);
WCacheFlushBlocks__(&(Vcb->FastCache), Vcb, 0, Vcb->LastLBA);
UDFVFlush(Vcb);
}
#ifdef UDF_DBG
- KdPrint(("UDF: Flushing Free Space Bitmap....\n"));
+ UDFPrint(("UDF: Flushing Free Space Bitmap....\n"));
// if(!OS_SUCCESS(UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr, &(Vcb->VolIdent))))
-// KdPrint(("Error updating VolIdent\n"));
+// UDFPrint(("Error updating VolIdent\n"));
if(!OS_SUCCESS(UDFUpdateVDS(Vcb, Vcb->VDS1, Vcb->VDS1 + Vcb->VDS1_Len, flags)))
- KdPrint(("Error updating Main VDS\n"));
+ UDFPrint(("Error updating Main VDS\n"));
if(!OS_SUCCESS(UDFUpdateVDS(Vcb, Vcb->VDS2, Vcb->VDS2 + Vcb->VDS2_Len, flags)))
- KdPrint(("Error updating Reserve VDS\n"));
+ UDFPrint(("Error updating Reserve VDS\n"));
#else
UDFUpdateVDS(Vcb, Vcb->VDS1, Vcb->VDS1 + Vcb->VDS1_Len, flags);
UDFUpdateVDS(Vcb, Vcb->VDS2, Vcb->VDS2 + Vcb->VDS2_Len, flags);
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA))
try_return(RC);
- KdPrint((" UDFEjectReqWaiter: check removable media\n"));
+ UDFPrint((" UDFEjectReqWaiter: check removable media\n"));
if(!WC->SoftEjectReq && SkipEject) {
try_return(RC);
}
if(!WC->SoftEjectReq) {
if(!UseEvent) {
- KdPrint((" Eject Button ignored\n"));
+ UDFPrint((" Eject Button ignored\n"));
try_return(RC);
}
// KeDelayExecutionThread(KernelMode, FALSE, &delay);
OSSTATUS RC;
- KdPrint((" Sync cache before GET_EVENT\n"));
+ UDFPrint((" Sync cache before GET_EVENT\n"));
RC = UDFSyncCache(Vcb);
if(RC == STATUS_INVALID_DEVICE_REQUEST) {
Vcb->VCBFlags |= UDF_VCB_FLAGS_NO_SYNC_CACHE;
if(RC != STATUS_SUCCESS &&
RC != STATUS_DATA_OVERRUN) {
if(RC == STATUS_NO_SUCH_DEVICE) {
- KdPrint((" Device loss\n"));
+ UDFPrint((" Device loss\n"));
goto device_failure;
}
if(RC == STATUS_NO_MEDIA_IN_DEVICE) {
- KdPrint((" Media loss\n"));
+ UDFPrint((" Media loss\n"));
goto media_loss;
}
}
- KdPrint((" Reading events...\n"));
+ UDFPrint((" Reading events...\n"));
if(supported_evt_classes) {
for(i=1; i<=EventRetStat_Class_Mask;i++) {
evt_type = (((UCHAR)1) << i);
continue;
}
if(RC == STATUS_NO_SUCH_DEVICE) {
- KdPrint((" Device loss (2)\n"));
+ UDFPrint((" Device loss (2)\n"));
goto device_failure;
}
if(!OS_SUCCESS(RC)) {
continue;
}
if( evt_type == EventStat_Class_Media ) {
- KdPrint((" EventStat_Class_Media:\n"));
+ UDFPrint((" EventStat_Class_Media:\n"));
if((WC->EjectReqBuffer.MediaChange.Header.Flags.Flags & EventRetStat_Class_Mask) !=
EventRetStat_Class_Media) {
continue;
if(RC == STATUS_SUCCESS ||
RC == STATUS_DATA_OVERRUN) {
- KdPrint((" Buggy GET_EVENT media presence flag %x\n",
+ UDFPrint((" Buggy GET_EVENT media presence flag %x\n",
WC->EjectReqBuffer.MediaChange.Byte1));
WC->EjectReqBuffer.MediaChange.Byte1.Flags |= EventStat_MediaStat_Present;
WC->EjectReqBuffer.MediaChange.Byte1.Flags &= ~EventStat_MediaStat_DoorOpen;
goto retry_media_presence_check;
}
media_loss:
- KdPrint((" Unexpected media loss. Check device status\n"));
+ UDFPrint((" Unexpected media loss. Check device status\n"));
UseEject = FALSE;
MediaLoss = TRUE;
} else
EventStat_MediaEvent_EjectReq ) {
continue;
}
- KdPrint((" eject requested\n"));
+ UDFPrint((" eject requested\n"));
WC->SoftEjectReq = TRUE;
break;
}
if( evt_type == EventStat_Class_ExternalReq ) {
- KdPrint((" EventStat_Class_ExternalReq:\n"));
+ UDFPrint((" EventStat_Class_ExternalReq:\n"));
if((WC->EjectReqBuffer.ExternalReq.Header.Flags.Flags & EventRetStat_Class_Mask) !=
EventRetStat_Class_ExternReq)
continue;
case EventStat_ExtrnReqEvent_KeyDown:
case EventStat_ExtrnReqEvent_KeyUp:
case EventStat_ExtrnReqEvent_ExtrnReq:
- KdPrint((" eject requested (%x)\n", WC->EjectReqBuffer.ExternalReq.Byte0.Flags));
+ UDFPrint((" eject requested (%x)\n", WC->EjectReqBuffer.ExternalReq.Byte0.Flags));
WC->SoftEjectReq = TRUE;
break;
}
}
} else {
- KdPrint((" Reading Media Event...\n"));
+ UDFPrint((" Reading Media Event...\n"));
((PGET_EVENT_USER_IN)(&(WC->EjectReqBuffer)))->Immed = TRUE;
((PGET_EVENT_USER_IN)(&(WC->EjectReqBuffer)))->EventClass = EventStat_Class_Media;
// Acquire Vcb resource
Vcb->SoftEjectReq = TRUE;
- KdPrint((" UDFEjectReqWaiter: ejecting...\n"));
+ UDFPrint((" UDFEjectReqWaiter: ejecting...\n"));
#ifdef UDF_DELAYED_CLOSE
UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
- KdPrint((" UDFEjectReqWaiter: set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
+ UDFPrint((" UDFEjectReqWaiter: set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_NO_DELAYED_CLOSE;
UDFReleaseResource(&(Vcb->VCBResource));
#endif //UDF_DELAYED_CLOSE
- KdPrint((" UDFEjectReqWaiter: UDFCloseAllSystemDelayedInDir\n"));
+ UDFPrint((" UDFEjectReqWaiter: UDFCloseAllSystemDelayedInDir\n"));
RC = UDFCloseAllSystemDelayedInDir(Vcb, Vcb->RootDirFCB->FileInfo);
ASSERT(OS_SUCCESS(RC));
#ifdef UDF_DELAYED_CLOSE
- KdPrint((" UDFEjectReqWaiter: UDFCloseAllDelayed\n"));
+ UDFPrint((" UDFEjectReqWaiter: UDFCloseAllDelayed\n"));
UDFCloseAllDelayed(Vcb);
//ASSERT(OS_SUCCESS(RC));
#endif //UDF_DELAYED_CLOSE
UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
- KdPrint((" UDFEjectReqWaiter: UDFDoDismountSequence\n"));
+ UDFPrint((" UDFEjectReqWaiter: UDFDoDismountSequence\n"));
UDFDoDismountSequence(Vcb, (PPREVENT_MEDIA_REMOVAL_USER_IN)&(WC->EjectReqBuffer), UseEject);
if (MediaLoss) {
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
Vcb->SoftEjectReq = FALSE;
UDFReleaseResource(&(Vcb->VCBResource));
- KdPrint((" UDFEjectReqWaiter: set WaiterStopped\n"));
+ UDFPrint((" UDFEjectReqWaiter: set WaiterStopped\n"));
KeSetEvent(WC->WaiterStopped, 0, FALSE);
MyFreePool__(WC);
WC = NULL;
- KdPrint((" UDFEjectReqWaiter: exit 1\n"));
+ UDFPrint((" UDFEjectReqWaiter: exit 1\n"));
return;
try_exit: NOTHING;
void
UDFStopEjectWaiter(PVCB Vcb) {
- KdPrint((" UDFStopEjectWaiter: try\n"));
+ UDFPrint((" UDFStopEjectWaiter: try\n"));
UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
_SEH2_TRY {
if(Vcb->EjectWaiter) {
- KdPrint((" UDFStopEjectWaiter: set flag\n"));
+ UDFPrint((" UDFStopEjectWaiter: set flag\n"));
KeSetEvent( &(Vcb->EjectWaiter->StopReq), 0, FALSE );
} else {
// return;
_SEH2_TRY {
if(Vcb->VCBFlags & UDF_VCB_FLAGS_STOP_WAITER_EVENT) {
- KdPrint((" UDFStopEjectWaiter: wait\n"));
+ UDFPrint((" UDFStopEjectWaiter: wait\n"));
KeWaitForSingleObject(&(Vcb->WaiterStopped), Executive, KernelMode, FALSE, NULL);
}
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_STOP_WAITER_EVENT;
BrutePoint();
} _SEH2_END;
ASSERT(!Vcb->EjectWaiter);
- KdPrint((" UDFStopEjectWaiter: exit\n"));
+ UDFPrint((" UDFStopEjectWaiter: exit\n"));
} // end UDFStopEjectWaiter()
// flush system cache
UDFFlushLogicalVolume(NULL, NULL, Vcb, 0);
- KdPrint(("UDFDoDismountSequence:\n"));
+ UDFPrint(("UDFDoDismountSequence:\n"));
delay.QuadPart = -1000000; // 0.1 sec
KeDelayExecutionThread(KernelMode, FALSE, &delay);
// unlock media, drop our own Locks
if(Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA) {
- KdPrint((" cleanup tray-lock (%d+2):\n", Vcb->MediaLockCount));
+ UDFPrint((" cleanup tray-lock (%d+2):\n", Vcb->MediaLockCount));
for(i=0; i<Vcb->MediaLockCount+2; i++) {
Buf->PreventMediaRemoval = FALSE;
UDFPhSendIOCTL(IOCTL_STORAGE_MEDIA_REMOVAL,
if(!UDFIsDvdMedia(Vcb)) {
// send speed limits to drive
- KdPrint((" Restore drive speed on dismount\n"));
+ UDFPrint((" Restore drive speed on dismount\n"));
Vcb->SpeedBuf.ReadSpeed = Vcb->MaxReadSpeed;
Vcb->SpeedBuf.WriteSpeed = Vcb->MaxWriteSpeed;
UDFPhSendIOCTL(IOCTL_CDRW_SET_SPEED,
memset(&CBuff,0,sizeof(CLOSE_TRK_SES_USER_IN));
// stop BG format
if(Vcb->MRWStatus) {
- KdPrint((" Stop background formatting\n"));
+ UDFPrint((" Stop background formatting\n"));
CBuff.Byte1.Flags = 0;//CloseTrkSes_Immed;
CBuff.Byte2.Flags = CloseTrkSes_Ses;
FALSE, NULL );
/* } else
if(Vcb->MediaClassEx == CdMediaClass_DVDRW) {
- KdPrint((" Close BG-formatted track\n"));
+ UDFPrint((" Close BG-formatted track\n"));
CBuff.Byte1.Flags = 0;//CloseTrkSes_Immed;
CBuff.Byte2.Flags = CloseTrkSes_Trk;
ExFreePool(Vcb->CDBurnerVolume.Buffer);
}
*/
- KdPrint((" set UnsafeIoctl\n"));
+ UDFPrint((" set UnsafeIoctl\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_UNSAFE_IOCTL;
return STATUS_SUCCESS;
BOOLEAN res_inited = FALSE;
if(VerifyCtx->VInited) {
- KdPrint(("Already inited\n"));
+ UDFPrint(("Already inited\n"));
return STATUS_SUCCESS;
}
_SEH2_TRY {
RtlZeroMemory(VerifyCtx, sizeof(UDF_VERIFY_CTX));
if(!Vcb->VerifyOnWrite) {
- KdPrint(("Verify is disabled\n"));
+ UDFPrint(("Verify is disabled\n"));
return STATUS_SUCCESS;
}
if(Vcb->CDR_Mode) {
- KdPrint(("Verify is not intended for CD/DVD-R\n"));
+ UDFPrint(("Verify is not intended for CD/DVD-R\n"));
return STATUS_SUCCESS;
}
if(!OS_SUCCESS(status = ExInitializeResourceLite(&(VerifyCtx->VerifyLock)))) {
if(VerifyCtx->StoredBitMap) {
RtlZeroMemory(VerifyCtx->StoredBitMap, i);
} else {
- KdPrint(("Can't alloc verify bitmap for %x blocks\n", Vcb->LastPossibleLBA));
+ UDFPrint(("Can't alloc verify bitmap for %x blocks\n", Vcb->LastPossibleLBA));
try_return(status = STATUS_INSUFFICIENT_RESOURCES);
}
InitializeListHead(&(VerifyCtx->vrfList));
ULONG w;
while(VerifyCtx->QueuedCount) {
- KdPrint(("UDFVWaitQueued: wait for completion (%d)\n", VerifyCtx->QueuedCount));
+ UDFPrint(("UDFVWaitQueued: wait for completion (%d)\n", VerifyCtx->QueuedCount));
w = InterlockedIncrement((PLONG)&(VerifyCtx->WaiterCount));
- KdPrint((" %d waiters\n", w));
+ UDFPrint((" %d waiters\n", w));
DbgWaitForSingleObject(&(VerifyCtx->vrfEvent), NULL);
if((w = InterlockedDecrement((PLONG)&(VerifyCtx->WaiterCount)))) {
- KdPrint((" still %d waiters, q %d\n", w, VerifyCtx->QueuedCount));
+ UDFPrint((" still %d waiters, q %d\n", w, VerifyCtx->QueuedCount));
if(!VerifyCtx->QueuedCount) {
- KdPrint((" pulse event\n", w));
+ UDFPrint((" pulse event\n", w));
KeSetEvent(&(VerifyCtx->vrfEvent), 0, FALSE);
}
}
return;
}
- KdPrint(("UDFVRelease: wait for completion\n"));
+ UDFPrint(("UDFVRelease: wait for completion\n"));
UDFVWaitQueued(VerifyCtx);
UDFAcquireResourceExclusive(&(VerifyCtx->VerifyLock), TRUE);
PUDF_VERIFY_CTX VerifyCtx = &Vcb->VerifyCtx;
PUDF_VERIFY_ITEM vItem;
- KdPrint(("v-add %x\n", LBA));
+ UDFPrint(("v-add %x\n", LBA));
vItem = (PUDF_VERIFY_ITEM)DbgAllocatePoolWithTag(PagedPool, sizeof(UDF_VERIFY_ITEM)+Vcb->BlockSize, 'bvWD');
if(!vItem)
PUDF_VERIFY_ITEM vItem
)
{
- KdPrint(("v-upd %x\n", vItem->lba));
+ UDFPrint(("v-upd %x\n", vItem->lba));
RtlCopyMemory(vItem+1, Buffer, Vcb->BlockSize);
vItem->crc = crc32((PUCHAR)Buffer, Vcb->BlockSize);
return;
PUDF_VERIFY_ITEM vItem
)
{
- KdPrint(("v-del %x\n", vItem->lba));
+ UDFPrint(("v-del %x\n", vItem->lba));
UDFClrBit(VerifyCtx->StoredBitMap, vItem->lba);
RemoveEntryList(&(vItem->vrfList));
VerifyCtx->ItemCount--;
if(!(Flags & PH_READ_VERIFY_CACHE)) {
crc = crc32((PUCHAR)Buffer+(vItem->lba - LBA)*Vcb->BlockSize, Vcb->BlockSize);
if(vItem->crc != crc) {
- KdPrint(("UDFVRead: stored %x != %x\n", vItem->crc, crc));
+ UDFPrint(("UDFVRead: stored %x != %x\n", vItem->crc, crc));
RtlCopyMemory((PUCHAR)Buffer+(vItem->lba - LBA)*Vcb->BlockSize, vItem->Buffer, Vcb->BlockSize);
status = STATUS_FT_WRITE_RECOVERY;
if(bm) {
RtlZeroMemory(bm, crc);
} else {
- KdPrint(("Can't alloc BSBM for %x blocks\n", Vcb->LastPossibleLBA));
+ UDFPrint(("Can't alloc BSBM for %x blocks\n", Vcb->LastPossibleLBA));
}
}
if(bm) {
UDFSetBit(bm, vItem->lba);
- KdPrint(("Set BB @ %#x\n", vItem->lba));
+ UDFPrint(("Set BB @ %#x\n", vItem->lba));
}
#ifdef _BROWSE_UDF_
bm = (uint32*)(Vcb->FSBM_Bitmap);
if(bm) {
UDFSetUsedBit(bm, vItem->lba);
- KdPrint(("Set BB @ %#x as used\n", vItem->lba));
+ UDFPrint(("Set BB @ %#x as used\n", vItem->lba));
}
#endif //_BROWSE_UDF_
} else {
// ok
}
} else {
- KdPrint(("UDFVRead: get cached @ %x\n", vItem->lba));
+ UDFPrint(("UDFVRead: get cached @ %x\n", vItem->lba));
RtlCopyMemory((PUCHAR)Buffer+(vItem->lba - LBA)*Vcb->BlockSize, vItem->Buffer, Vcb->BlockSize);
}
if(i >= n) {
WCacheEODirect__(&(Vcb->FastCache), Vcb);
} else {
for(i=0; i<VerifyReq->nReq; i++) {
- KdPrint(("!!! No more space for remap !!!\n"));
- KdPrint((" try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
+ UDFPrint(("!!! No more space for remap !!!\n"));
+ UDFPrint((" try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
UDFVRead(Vcb, VerifyReq->Buffer, VerifyReq->vr[i].BCount, VerifyReq->vr[i].lba,
PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER);
}
PH_TMP_BUFFER | PH_VCB_IN_RETLEN /*| PH_LOCK_CACHE*/);
WCacheEODirect__(&(Vcb->FastCache), Vcb);
} else {
- KdPrint(("!!! No more space for remap !!!\n"));
- KdPrint((" try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
+ UDFPrint(("!!! No more space for remap !!!\n"));
+ UDFPrint((" try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
RC = UDFVRead(Vcb, VerifyReq->Buffer, VerifyReq->vr[i].BCount, VerifyReq->vr[i].lba,
PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER);
}
DbgFreePool(VerifyReq->Buffer);
DbgFreePool(VerifyReq);
InterlockedDecrement((PLONG)&(Vcb->VerifyCtx.QueuedCount));
- KdPrint((" QueuedCount = %d\n", Vcb->VerifyCtx.QueuedCount));
- KdPrint((" Setting event...\n"));
+ UDFPrint((" QueuedCount = %d\n", Vcb->VerifyCtx.QueuedCount));
+ UDFPrint((" Setting event...\n"));
KeSetEvent(&(Vcb->VerifyCtx.vrfEvent), 0, FALSE);
return;
} // end UDFVWorkItem()
}
if(VerifyCtx->QueuedCount) {
if(Flags & UFD_VERIFY_FLAG_WAIT) {
- KdPrint((" wait for verify flush\n"));
+ UDFPrint((" wait for verify flush\n"));
goto wait;
}
- KdPrint((" verify flush already queued\n"));
+ UDFPrint((" verify flush already queued\n"));
return;
}
}
if(Flags & UFD_VERIFY_FLAG_WAIT) {
wait:
- KdPrint(("UDFVVerify: wait for completion\n"));
+ UDFPrint(("UDFVVerify: wait for completion\n"));
UDFVWaitQueued(VerifyCtx);
}
return;
}
- KdPrint(("UDFVFlush: wait for completion\n"));
+ UDFPrint(("UDFVFlush: wait for completion\n"));
UDFVWaitQueued(VerifyCtx);
UDFVVerify(Vcb, UFD_VERIFY_FLAG_FORCE);
- KdPrint(("UDFVFlush: wait for completion (2)\n"));
+ UDFPrint(("UDFVFlush: wait for completion (2)\n"));
UDFVWaitQueued(VerifyCtx);
} // end UDFVFlush()
// use sparing table for relocation
if(Vcb->SparingCountFree == (ULONG)-1) {
- KdPrint(("calculate free spare areas\n"));
+ UDFPrint(("calculate free spare areas\n"));
re_check:
- KdPrint(("verify spare area\n"));
+ UDFPrint(("verify spare area\n"));
Vcb->SparingCountFree = 0;
Map = Vcb->SparingTable;
for(i=0;i<max;i++,Map++) {
if(UDFCheckArea(Vcb, Map->mappedLocation, BS)) {
Vcb->SparingCountFree++;
} else {
- KdPrint(("initial check: bad spare block @ %x\n", Map->mappedLocation));
+ UDFPrint(("initial check: bad spare block @ %x\n", Map->mappedLocation));
Map->origLocation = SPARING_LOC_CORRUPTED;
Vcb->SparingTableModified = TRUE;
}
}
}
if(!Vcb->SparingCountFree) {
- KdPrint(("sparing table full\n"));
+ UDFPrint(("sparing table full\n"));
return STATUS_DISK_FULL;
}
if(Lba == (orig & ~(BS-1)) ) {
// already remapped
- KdPrint(("remap remapped: bad spare block @ %x\n", Map->mappedLocation));
+ UDFPrint(("remap remapped: bad spare block @ %x\n", Map->mappedLocation));
if(!verified) {
verified = TRUE;
goto re_check;
Map = Vcb->SparingTable;
for(i=0;i<max;i++,Map++) {
if(Map->origLocation == SPARING_LOC_AVAILABLE) {
- KdPrint(("remap %x -> %x\n", Lba, Map->mappedLocation));
+ UDFPrint(("remap %x -> %x\n", Lba, Map->mappedLocation));
Map->origLocation = Lba;
Vcb->SparingTableModified = TRUE;
Vcb->SparingCountFree--;
return STATUS_SUCCESS;
}
}
- KdPrint(("sparing table full\n"));
+ UDFPrint(("sparing table full\n"));
return STATUS_DISK_FULL;
}
return STATUS_UNSUCCESSFUL;
if(orig >= Lba &&
(orig+BS) <= (Lba+BCount)) {
// unmap
- KdPrint(("unmap %x -> %x\n", orig, Map->mappedLocation));
+ UDFPrint(("unmap %x -> %x\n", orig, Map->mappedLocation));
Map->origLocation = SPARING_LOC_AVAILABLE;
Vcb->SparingTableModified = TRUE;
Vcb->SparingCountFree++;
Ident))) return status;
if((FileEntry->descTag.tagIdent != TID_FILE_ENTRY) &&
(FileEntry->descTag.tagIdent != TID_EXTENDED_FILE_ENTRY)) {
- KdPrint((" Not a FileEntry (lbn=%x, tag=%x)\n", Icb->extLocation.logicalBlockNum, FileEntry->descTag.tagIdent));
+ UDFPrint((" Not a FileEntry (lbn=%x, tag=%x)\n", Icb->extLocation.logicalBlockNum, FileEntry->descTag.tagIdent));
return STATUS_FILE_CORRUPT_ERROR;
}
return STATUS_SUCCESS;
{
EXTENT_AD TmpExt;
- KdPrint((" UDFLoadExtInfo:\n"));
+ UDFPrint((" UDFLoadExtInfo:\n"));
FExtInfo->Mapping = UDFReadMappingFromXEntry(Vcb, fe_loc->extLocation.partitionReferenceNum,
(tag*)fe, &(FExtInfo->Offset), AExtInfo);
if(!(FExtInfo->Mapping)) {
FExtInfo->Mapping = UDFExtentToMapping(&TmpExt);
}
if(fe->descTag.tagIdent == TID_FILE_ENTRY) {
-// KdPrint(("Standard FileEntry\n"));
+// UDFPrint(("Standard FileEntry\n"));
FExtInfo->Length = fe->informationLength;
} else /*if(fe->descTag.tagIdent == TID_EXTENDED_FILE_ENTRY) */ {
FExtInfo->Length = ((PEXTENDED_FILE_ENTRY)fe)->informationLength;
}
- KdPrint((" FExtInfo->Length %x\n", FExtInfo->Length));
+ UDFPrint((" FExtInfo->Length %x\n", FExtInfo->Length));
ASSERT(FExtInfo->Length <= UDFGetExtentLength(FExtInfo->Mapping));
FExtInfo->Modified = FALSE;
dis = (domainIdentSuffix*)&(eID->identSuffix);
- KdPrint(("UDF: Entity Id:\n"));
- KdPrint(("flags: %x\n", eID->flags));
- KdPrint(("ident[0]: %x\n", eID->ident[0]));
- KdPrint(("ident[1]: %x\n", eID->ident[1]));
- KdPrint(("ident[2]: %x\n", eID->ident[2]));
- KdPrint(("ident[3]: %x\n", eID->ident[3]));
- KdPrint(("UDF: Entity Id Domain:\n"));
+ UDFPrint(("UDF: Entity Id:\n"));
+ UDFPrint(("flags: %x\n", eID->flags));
+ UDFPrint(("ident[0]: %x\n", eID->ident[0]));
+ UDFPrint(("ident[1]: %x\n", eID->ident[1]));
+ UDFPrint(("ident[2]: %x\n", eID->ident[2]));
+ UDFPrint(("ident[3]: %x\n", eID->ident[3]));
+ UDFPrint(("UDF: Entity Id Domain:\n"));
// Get current UDF revision
Vcb->CurrentUDFRev = max(dis->currentRev, Vcb->CurrentUDFRev);
- KdPrint(("Effective Revision: %x\n", Vcb->CurrentUDFRev));
+ UDFPrint(("Effective Revision: %x\n", Vcb->CurrentUDFRev));
// Get Read-Only flags
flags = dis->flags;
- KdPrint(("Flags: %x\n", flags));
+ UDFPrint(("Flags: %x\n", flags));
if((flags & ENTITYID_FLAGS_SOFT_RO) &&
(Vcb->CompatFlags & UDF_VCB_IC_SOFT_RO)) {
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_SOFT_RO;
- KdPrint((" Soft-RO\n"));
+ UDFPrint((" Soft-RO\n"));
}
if((flags & ENTITYID_FLAGS_HARD_RO) &&
(Vcb->CompatFlags & UDF_VCB_IC_HW_RO)) {
Vcb->VCBFlags |= UDF_VCB_FLAGS_MEDIA_READ_ONLY;
Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_HW_RO;
- KdPrint((" Hard-RO\n"));
+ UDFPrint((" Hard-RO\n"));
}
} // end UDFReadEntityID_Domain()
}
SDirInfo = Dloc->SDirInfo;
/* if(FreeSpace && SDirInfo) {
- KdPrint(("Unlink: SDirInfo should be NULL !!!\n"));
+ UDFPrint(("Unlink: SDirInfo should be NULL !!!\n"));
BrutePoint();
return STATUS_CANNOT_DELETE;
}*/
ValidateFileInfo(FileInfo);
if(FileInfo->OpenCount || FileInfo->RefCount) {
- KdPrint(("UDF: not all references are closed\n"));
- KdPrint((" Skipping cleanup\n"));
- KdPrint(("UDF: OpenCount = %x, RefCount = %x, LinkRefCount = %x\n",
+ UDFPrint(("UDF: not all references are closed\n"));
+ UDFPrint((" Skipping cleanup\n"));
+ UDFPrint(("UDF: OpenCount = %x, RefCount = %x, LinkRefCount = %x\n",
FileInfo->OpenCount,FileInfo->RefCount,FileInfo->Dloc->LinkRefCount));
return UDF_FREE_NOTHING;
}
if(FileInfo->Fcb) {
- KdPrint(("Operating System still has references to this file\n"));
- KdPrint((" Skipping cleanup\n"));
+ UDFPrint(("Operating System still has references to this file\n"));
+ UDFPrint((" Skipping cleanup\n"));
// BrutePoint();
return UDF_FREE_NOTHING;
}
// we can't delete modified file
// it should be closed & reopened (or flushed) before deletion
DirNdx = UDFDirIndex(hDirNdx,Index);
- KdPrint(("Cleanup Mod: %s%s%s%s%s%s\n",
+ UDFPrint(("Cleanup Mod: %s%s%s%s%s%s\n",
(Dloc->FE_Flags & UDF_FE_FLAG_FE_MODIFIED) ? "FE " : "",
(Dloc->DataLoc.Modified) ? "DataLoc " : "",
(Dloc->DataLoc.Flags & EXTENT_FLAG_PREALLOCATED) ? "Data-PreAlloc " : "",
if(DirNdx->FileInfo) {
if(!KeepDloc) {
BrutePoint();
- KdPrint(("UDF: Found not cleaned up reference.\n"));
- KdPrint((" Skipping cleanup (1)\n"));
+ UDFPrint(("UDF: Found not cleaned up reference.\n"));
+ UDFPrint((" Skipping cleanup (1)\n"));
// BrutePoint();
return UDF_FREE_NOTHING;
}
}
}
if(Dloc->SDirInfo) {
- KdPrint(("UDF: Found not cleaned up reference (SDir).\n"));
+ UDFPrint(("UDF: Found not cleaned up reference (SDir).\n"));
// (Update Child Objects - II)
if(Dloc->SDirInfo->ParentFile == FileInfo) {
// place (in parallel object)
if(!KeepDloc) {
BrutePoint();
- KdPrint((" Skipping cleanup\n"));
+ UDFPrint((" Skipping cleanup\n"));
return UDF_FREE_NOTHING;
}
if(!FileInfo) return STATUS_SUCCESS;
if(FileInfo->Index<2 && (FileInfo->ParentFile) && !UDFIsAStreamDir(FileInfo)) {
- KdPrint(("Closing Current or Parent Directory... :-\\\n"));
+ UDFPrint(("Closing Current or Parent Directory... :-\\\n"));
if(FileInfo->RefCount) {
UDFInterlockedDecrement((PLONG)&(FileInfo->RefCount));
ASSERT(FileInfo->Dloc);
#ifdef UDF_DBG
} else {
BrutePoint();
- KdPrint(("ERROR: Closing unreferenced file!\n"));
+ UDFPrint(("ERROR: Closing unreferenced file!\n"));
#endif // UDF_DBG
}
if(FileInfo->ParentFile->OpenCount) {
#ifdef UDF_DBG
} else {
BrutePoint();
- KdPrint(("ERROR: Closing unopened file!\n"));
+ UDFPrint(("ERROR: Closing unopened file!\n"));
#endif // UDF_DBG
}
return STATUS_SUCCESS;
#ifdef UDF_DBG
} else {
BrutePoint();
- KdPrint(("ERROR: Closing unreferenced file!\n"));
+ UDFPrint(("ERROR: Closing unreferenced file!\n"));
#endif // UDF_DBG
}
if(DirInfo) {
#ifdef UDF_DBG
} else {
BrutePoint();
- KdPrint(("ERROR: Closing unopened file!\n"));
+ UDFPrint(("ERROR: Closing unopened file!\n"));
#endif // UDF_DBG
}
}
// ASSERT(FileInfo->Dloc->FELoc.Mapping[0].extLocation);
PartNum = UDFGetPartNumByPhysLba(Vcb, FileInfo->Dloc->FELoc.Mapping[0].extLocation);
if(PartNum == (uint32)-1) {
- KdPrint((" Is DELETED ?\n"));
+ UDFPrint((" Is DELETED ?\n"));
if(DirInfo) {
PartNum = UDFGetPartNumByPhysLba(Vcb, DirInfo->Dloc->FELoc.Mapping[0].extLocation);
} else {
//ASSERT(FileInfo->Dloc->FELoc.Mapping[0].extLocation);
if(UDFIsAStreamDir(FileInfo)) {
if(!UDFIsSDirDeleted(FileInfo)) {
- KdPrint((" Not DELETED SDir\n"));
+ UDFPrint((" Not DELETED SDir\n"));
BrutePoint();
}
ASSERT(!FileInfo->Dloc->FELoc.Modified);
}
if(!OS_SUCCESS(status = UDFFlushFE(Vcb, FileInfo, PartNum))) {
- KdPrint(("Error flushing FE\n"));
+ UDFPrint(("Error flushing FE\n"));
//flush_recovery:
BrutePoint();
if(FileInfo->Index >= 2) {
PDIR_INDEX_ITEM DirNdx;
DirNdx = UDFDirIndex(UDFGetDirIndexByFileInfo(FileInfo), FileInfo->Index);
if(DirNdx) {
- KdPrint(("Recovery: mark as deleted & flush FI\n"));
+ UDFPrint(("Recovery: mark as deleted & flush FI\n"));
DirNdx->FI_Flags |= UDF_FI_FLAG_FI_MODIFIED;
DirNdx->FileCharacteristics |= FILE_DELETED;
FileInfo->FileIdent->fileCharacteristics |= FILE_DELETED;
}
// ... but FI must be updated (if any)
if(!OS_SUCCESS(status = UDFFlushFI(Vcb, FileInfo, PartNum))) {
- KdPrint(("Error flushing FI\n"));
+ UDFPrint(("Error flushing FI\n"));
return status;
}
#ifdef UDF_DBG
int8* OldInIcb = NULL;
PEXTENT_MAP NewMap;
- KdPrint(("UDFResizeFile__: FI %x, -> %I64x\n", FileInfo, NewLength));
+ UDFPrint(("UDFResizeFile__: FI %x, -> %I64x\n", FileInfo, NewLength));
ValidateFileInfo(FileInfo);
// ASSERT(FileInfo->RefCount >= 1);
if((NewLength >> Vcb->LBlockSizeBits) > Vcb->TotalAllocUnits) {
- KdPrint(("STATUS_DISK_FULL\n"));
+ UDFPrint(("STATUS_DISK_FULL\n"));
return STATUS_DISK_FULL;
}
if (NewLength == FileInfo->Dloc->DataLoc.Length) return STATUS_SUCCESS;
}
if((Vcb->LastTrackNum > 1) &&
(Vcb->LastLBA == Vcb->TrackMap[Vcb->LastTrackNum-1].LastLba)) {
- KdPrint(("Hardware Read-only volume\n"));
+ UDFPrint(("Hardware Read-only volume\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
}
len = (uint32)UDFGetFileSize(VatFileInfo);
if(Vcb->Partitions[PartNdx].PartitionType == UDF_VIRTUAL_MAP15) {
// load Vat 1.50 header
- KdPrint(("Load VAT 1.50\n"));
+ UDFPrint(("Load VAT 1.50\n"));
VirtualAllocationTable15* Buf;
if(((icbtag*)(VatFileInfo->Dloc->FileEntry+1))->fileType != UDF_FILE_TYPE_VAT15) {
status = STATUS_FILE_CORRUPT_ERROR;
} else
if(Vcb->Partitions[PartNdx].PartitionType == UDF_VIRTUAL_MAP20) {
// load Vat 2.00 header
- KdPrint(("Load VAT 2.00\n"));
+ UDFPrint(("Load VAT 2.00\n"));
VirtualAllocationTable20* Buf;
if(((icbtag*)(VatFileInfo->Dloc->FileEntry+1))->fileType != UDF_FILE_TYPE_VAT20) {
status = STATUS_FILE_CORRUPT_ERROR;
} else {
// unknown (or wrong) VAT format
- KdPrint(("unknown (or wrong) VAT format\n"));
+ UDFPrint(("unknown (or wrong) VAT format\n"));
status = STATUS_FILE_CORRUPT_ERROR;
goto err_vat_15;
}
}
#endif // UDF_DBG
retry_flush_FE:
- KdPrint((" FlushFE: %x\n", FileInfo->Dloc->FELoc.Mapping[0].extLocation));
+ UDFPrint((" FlushFE: %x\n", FileInfo->Dloc->FELoc.Mapping[0].extLocation));
#ifndef UDF_READ_ONLY_BUILD
UDFReTagDirectory(Vcb, FileInfo);
if(FileInfo->Dloc->DataLoc.Modified ||
ASSERT(PartNum != (uint32)(-1));
// prepare new AllocDescs for flushing...
if(!OS_SUCCESS(status = UDFBuildAllocDescs(Vcb, PartNum, FileInfo, &NewAllocDescs))) {
- KdPrint((" FlushFE: UDFBuildAllocDescs() faliled (%x)\n", status));
+ UDFPrint((" FlushFE: UDFBuildAllocDescs() faliled (%x)\n", status));
if(NewAllocDescs)
MyFreePool__(NewAllocDescs);
return status;
status = UDFWriteExtent(Vcb, &(FileInfo->Dloc->AllocLoc), 0, (uint32)(FileInfo->Dloc->AllocLoc.Length), FALSE, NewAllocDescs, &WrittenBytes);
MyFreePool__(NewAllocDescs);
if(!OS_SUCCESS(status)) {
- KdPrint((" FlushFE: UDFWriteExtent() faliled (%x)\n", status));
+ UDFPrint((" FlushFE: UDFWriteExtent() faliled (%x)\n", status));
return status;
}
#ifdef UDF_DBG
ASSERT(PartNum != (uint32)(-1));
ASSERT(!PartNum);
if(PartNum == (uint32)(-1) || PartNum == (uint32)(-2)) {
- KdPrint((" bad PartNum: %d\n", PartNum));
+ UDFPrint((" bad PartNum: %d\n", PartNum));
}
// update lengthAllocDescs in FE
UDFSetAllocDescLen(Vcb, FileInfo);
(uint32)(FileInfo->Dloc->FELoc.Length), FALSE,
(int8*)(FileInfo->Dloc->FileEntry), &WrittenBytes);
if(!OS_SUCCESS(status)) {
- KdPrint((" FlushFE: UDFWriteExtent(2) faliled (%x)\n", status));
+ UDFPrint((" FlushFE: UDFWriteExtent(2) faliled (%x)\n", status));
if(status == STATUS_DEVICE_DATA_ERROR) {
relocate_FE:
- KdPrint((" try to relocate\n"));
+ UDFPrint((" try to relocate\n"));
EXTENT_INFO _FEExtInfo;
// calculate the length required
// allocate block for FE
if(OS_SUCCESS(UDFAllocateFESpace(Vcb, FileInfo->ParentFile, PartNum, &_FEExtInfo, (uint32)(FileInfo->Dloc->FELoc.Length)) )) {
- KdPrint((" relocate %x -> %x\n",
+ UDFPrint((" relocate %x -> %x\n",
lba,
_FEExtInfo.Mapping[0].extLocation));
AllocMode = ((PFILE_ENTRY)(FileInfo->Dloc->FileEntry))->icbTag.flags & ICB_FLAG_ALLOC_MASK;
if(AllocMode == ICB_FLAG_AD_IN_ICB) {
- KdPrint((" IN-ICB data lost\n"));
+ UDFPrint((" IN-ICB data lost\n"));
FileInfo->Dloc->DataLoc.Mapping[0].extLocation = _FEExtInfo.Mapping[0].extLocation;
FileInfo->Dloc->DataLoc.Modified = TRUE;
} else {
PDIR_INDEX_ITEM DirNdx;
DirNdx = UDFDirIndex(UDFGetDirIndexByFileInfo(FileInfo), FileInfo->Index);
if(DirNdx) {
- KdPrint((" update reference in FI\n"));
+ UDFPrint((" update reference in FI\n"));
DirNdx->FileEntryLoc.logicalBlockNum =
FileInfo->FileIdent->icb.extLocation.logicalBlockNum =
UDFPhysLbaToPart(Vcb, PartNum, _FEExtInfo.Mapping[0].extLocation);
}
}
// this will update
- KdPrint((" retry flush...\n"));
+ UDFPrint((" retry flush...\n"));
goto retry_flush_FE;
}
}
ASSERT(FileInfo->FileIdent->fileCharacteristics & FILE_DELETED);
}
#endif // UDF_DBG
- KdPrint((" FlushFI: offs %x\n", (ULONG)(DirNdx->Offset)));
+ UDFPrint((" FlushFI: offs %x\n", (ULONG)(DirNdx->Offset)));
#ifndef UDF_READ_ONLY_BUILD
if((DirNdx->FI_Flags & UDF_FI_FLAG_FI_MODIFIED)) {
// flush FileIdent
ASSERT(FileInfo->Dloc->FELoc.Mapping[0].extLocation);
PartNum = UDFGetPartNumByPhysLba(Vcb, FileInfo->Dloc->FELoc.Mapping[0].extLocation);
if(PartNum == (uint32)-1) {
- KdPrint((" Is DELETED ?\n"));
+ UDFPrint((" Is DELETED ?\n"));
if(FileInfo->ParentFile) {
PartNum = UDFGetPartNumByPhysLba(Vcb, FileInfo->ParentFile->Dloc->FELoc.Mapping[0].extLocation);
} else {
if(UDFIsAStreamDir(FileInfo)) {
if(!UDFIsSDirDeleted(FileInfo)) {
- KdPrint((" Not DELETED SDir\n"));
+ UDFPrint((" Not DELETED SDir\n"));
BrutePoint();
}
ASSERT(!FileInfo->Dloc->FELoc.Modified);
}
// flush FE
if(!OS_SUCCESS(status = UDFFlushFE(Vcb, FileInfo, PartNum))) {
- KdPrint(("Error flushing FE\n"));
+ UDFPrint(("Error flushing FE\n"));
BrutePoint();
if(FlushFlags & UDF_FLUSH_FLAGS_LITE) {
- KdPrint((" flush pre-alloc\n"));
+ UDFPrint((" flush pre-alloc\n"));
FlushFlags &= ~UDF_FLUSH_FLAGS_LITE;
goto full_flush;
}
PDIR_INDEX_ITEM DirNdx;
DirNdx = UDFDirIndex(UDFGetDirIndexByFileInfo(FileInfo), FileInfo->Index);
if(DirNdx) {
- KdPrint(("Recovery: mark as deleted & flush FI\n"));
+ UDFPrint(("Recovery: mark as deleted & flush FI\n"));
DirNdx->FI_Flags |= UDF_FI_FLAG_FI_MODIFIED;
DirNdx->FileCharacteristics |= FILE_DELETED;
FileInfo->FileIdent->fileCharacteristics |= FILE_DELETED;
_SEH2_TRY {
RC = UDFReadSectors(Vcb, FALSE, Block, 1, FALSE, Buf, &ReadBytes);
if(!OS_SUCCESS(RC)) {
- KdPrint(("UDF: Block=%x, Location=%x: read failed\n", Block, Location));
+ UDFPrint(("UDF: Block=%x, Location=%x: read failed\n", Block, Location));
try_return(RC);
}
*Ident = PTag->tagIdent;
if(Location != PTag->tagLocation) {
- KdPrint(("UDF: location mismatch block %x, tag %x != %x\n",
+ UDFPrint(("UDF: location mismatch block %x, tag %x != %x\n",
Block, PTag->tagLocation, Location));
try_return(RC = STATUS_FILE_CORRUPT_ERROR);
}
checksum += (uint8)((i!=4) ? (*tb) : 0);
if(checksum != PTag->tagChecksum) {
- KdPrint(("UDF: tag checksum failed block %x\n", Block));
+ UDFPrint(("UDF: tag checksum failed block %x\n", Block));
try_return(RC = STATUS_CRC_ERROR);
}
// Verify the tag version
if((PTag->descVersion != 2) &&
(PTag->descVersion != 3)) {
- KdPrint(("UDF: Tag version 0x%04x != 0x0002 || 0x0003 block %x\n",
+ UDFPrint(("UDF: Tag version 0x%04x != 0x0002 || 0x0003 block %x\n",
(PTag->descVersion), Block));
try_return(RC = STATUS_FILE_CORRUPT_ERROR);
}
if(((PTag->descCRCLength) + sizeof(tag) > Vcb->BlockSize) ||
((PTag->descCRC) == UDFCrc((uint8*)Buf + sizeof(tag), PTag->descCRCLength)) ||
!(PTag->descCRC) ) {
- /* KdPrint(("Tag ID: %x, ver %x\t", PTag->tagIdent, PTag->descVersion ));
+ /* UDFPrint(("Tag ID: %x, ver %x\t", PTag->tagIdent, PTag->descVersion ));
if((i == TID_FILE_ENTRY) ||
(i == TID_EXTENDED_FILE_ENTRY)) {
- KdPrint(("StrategType: %x, ", Icb->strategyType ));
- KdPrint(("FileType: %x\t", Icb->fileType ));
+ UDFPrint(("StrategType: %x, ", Icb->strategyType ));
+ UDFPrint(("FileType: %x\t", Icb->fileType ));
}
- KdPrint(("\n"));*/
+ UDFPrint(("\n"));*/
try_return(RC = STATUS_SUCCESS);
}
- KdPrint(("UDF: Crc failure block %x: crc = %x, crclen = %x\n",
+ UDFPrint(("UDF: Crc failure block %x: crc = %x, crclen = %x\n",
Block, PTag->descCRC, PTag->descCRCLength));
RC = STATUS_CRC_ERROR;
uint16 PartNdx = (uint16)(Vcb->VatPartNdx);
uint16 PartNum = (uint16)(Lba ? UDFGetPartNumByPhysLba(Vcb, Lba) : UDFGetPartNumByPartNdx(Vcb, PartNdx));
if(PartNum != UDFGetPartNumByPartNdx(Vcb, PartNdx)) {
- KdPrint(("UDFUpdateVAT: Write to Write-Protected partition\n"));
+ UDFPrint(("UDFUpdateVAT: Write to Write-Protected partition\n"));
return STATUS_MEDIA_WRITE_PROTECTED;
}
// !!! NOTE !!!
#define PEXTENDED_IO_STACK_LOCATION PIO_STACK_LOCATION
+#define NDEBUG
#ifndef NDEBUG
#define UDF_DBG
#endif
))
+#if !defined(UDF_DBG) && !defined(PRINT_ALWAYS)
+#define UDFPrint(Args)
+#else
+#define UDFPrint(Args) KdPrint(Args)
+#endif
+#define UDFPrintErr(Args) KdPrint(Args)
+
//
#if !defined(UDF_DBG) && !defined(PRINT_ALWAYS)
HKEY hUdfRootKey;
LARGE_INTEGER delay;
-// KdPrint(("UDF: Entered " VER_STR_PRODUCT_NAME " UDF DriverEntry \n"));
-// KdPrint((KD_PREFIX "Build " VER_STR_PRODUCT "\n"));
+// UDFPrint(("UDF: Entered " VER_STR_PRODUCT_NAME " UDF DriverEntry \n"));
+// UDFPrint((KD_PREFIX "Build " VER_STR_PRODUCT "\n"));
_SEH2_TRY {
_SEH2_TRY {
CrNtInit(DriverObject, RegistryPath);
//PsGetVersion(&MajorVersion, &MinorVersion, &BuildNumber, NULL);
- KdPrint(("UDF: OS Version Major: %x, Minor: %x, Build number: %d\n",
+ UDFPrint(("UDF: OS Version Major: %x, Minor: %x, Build number: %d\n",
MajorVersion, MinorVersion, BuildNumber));
*/
#ifdef __REACTOS__
- KdPrint(("UDF Init: OS should be ReactOS\n"));
+ UDFPrint(("UDF Init: OS should be ReactOS\n"));
#endif
// initialize the global data structure
// initialize the mounted logical volume list head
InitializeListHead(&(UDFGlobalData.VCBQueue));
- KdPrint(("UDF: Init memory manager\n"));
+ UDFPrint(("UDF: Init memory manager\n"));
// Initialize internal memory management
if(!MyAllocInit()) {
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
RtlInitUnicodeString(&UDFGlobalData.UnicodeStrSDir, L":");
RtlInitUnicodeString(&UDFGlobalData.AclName, UDF_SN_NT_ACL);
- KdPrint(("UDF: Init delayed close queues\n"));
+ UDFPrint(("UDF: Init delayed close queues\n"));
#ifdef UDF_DELAYED_CLOSE
InitializeListHead( &UDFGlobalData.DelayedCloseQueue );
InitializeListHead( &UDFGlobalData.DirDelayedCloseQueue );
UDFGlobalData.DefaultZoneSizeInNumStructs=10;
- KdPrint(("UDF: Init zones\n"));
+ UDFPrint(("UDF: Init zones\n"));
if (!NT_SUCCESS(RC = UDFInitializeZones()))
try_return(RC);
- KdPrint(("UDF: Init pointers\n"));
+ UDFPrint(("UDF: Init pointers\n"));
// initialize the IRP major function table, and the fast I/O table
UDFInitializeFunctionPointers(DriverObject);
RtlInitUnicodeString(&DriverDeviceName, UDF_FS_NAME);
- KdPrint(("UDF: Create Driver dev obj\n"));
+ UDFPrint(("UDF: Create Driver dev obj\n"));
if (!NT_SUCCESS(RC = IoCreateDevice(
DriverObject, // our driver object
sizeof(UDFFS_DEV_EXTENSION), // don't need an extension for this object
RtlInitUnicodeString(&unicodeDeviceName, UDF_DOS_FS_NAME);
IoCreateSymbolicLink(&unicodeDeviceName, &DriverDeviceName);
- KdPrint(("UDF: Create CD dev obj\n"));
+ UDFPrint(("UDF: Create CD dev obj\n"));
if (!NT_SUCCESS(RC = UDFCreateFsDeviceObject(UDF_FS_NAME_CD,
DriverObject,
FILE_DEVICE_CD_ROM_FILE_SYSTEM,
try_return(RC);
}
#ifdef UDF_HDD_SUPPORT
- KdPrint(("UDF: Create HDD dev obj\n"));
+ UDFPrint(("UDF: Create HDD dev obj\n"));
if (!NT_SUCCESS(RC = UDFCreateFsDeviceObject(UDF_FS_NAME_HDD,
DriverObject,
FILE_DEVICE_DISK_FILE_SYSTEM,
*/
if (UDFGlobalData.UDFDeviceObject_CD) {
- KdPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for CD\n"));
+ UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for CD\n"));
IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_CD);
}
#ifdef UDF_HDD_SUPPORT
if (UDFGlobalData.UDFDeviceObject_HDD) {
- KdPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for HDD\n"));
+ UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for HDD\n"));
IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_HDD);
}
#endif // UDF_HDD_SUPPORT
FsRegistered = TRUE;
- KdPrint(("UDF: IoRegisterFsRegistrationChange()\n"));
+ UDFPrint(("UDF: IoRegisterFsRegistrationChange()\n"));
IoRegisterFsRegistrationChange( DriverObject, (PDRIVER_FS_NOTIFICATION)UDFFsNotification );
// delay.QuadPart = -10000000;
#if 0
if(!WinVer_IsNT) {
/*ExInitializeWorkItem(&RemountWorkQueueItem, UDFRemountAll, NULL);
- KdPrint(("UDFDriverEntry: create remount thread\n"));
+ UDFPrint(("UDFDriverEntry: create remount thread\n"));
ExQueueWorkItem(&RemountWorkQueueItem, DelayedWorkQueue);*/
for(CdRomNumber = 0;true;CdRomNumber++) {
sprintf(deviceNameBuffer, "\\Device\\CdRom%d", CdRomNumber);
- KdPrint(( "UDF: DriverEntry : dismount %s\n", deviceNameBuffer));
+ UDFPrint(( "UDF: DriverEntry : dismount %s\n", deviceNameBuffer));
RtlInitString(&deviceName, deviceNameBuffer);
RC = RtlAnsiStringToUnicodeString(&unicodeCdRomDeviceName, &deviceName, TRUE);
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
// we encountered an exception somewhere, eat it up
- KdPrint(("UDF: exception\n"));
+ UDFPrint(("UDF: exception\n"));
RC = _SEH2_GetExceptionCode();
} _SEH2_END;
} _SEH2_FINALLY {
// start unwinding if we were unsuccessful
if (!NT_SUCCESS(RC)) {
- KdPrint(("UDF: failed with status %x\n", RC));
+ UDFPrint(("UDF: failed with status %x\n", RC));
// Now, delete any device objects, etc. we may have created
/* if (UDFGlobalData.UDFDeviceObject) {
IoDeleteDevice(UDFGlobalData.UDFDeviceObject);
RtlInitUnicodeString(&DriverDeviceName, FsDeviceName);
*DeviceObject = NULL;
- KdPrint(("UDFCreateFsDeviceObject: create dev\n"));
+ UDFPrint(("UDFCreateFsDeviceObject: create dev\n"));
if (!NT_SUCCESS(RC = IoCreateDevice(
DriverObject, // our driver object
// register the driver with the I/O Manager, pretend as if this is
// a physical disk based FSD (or in order words, this FSD manages
// logical volumes residing on physical disk drives)
-/* KdPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem()\n"));
+/* UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem()\n"));
IoRegisterFileSystem(*DeviceObject);*/
return(RC);
} // end UDFCreateFsDeviceObject()
NULL,
NULL );
- KdPrint(("\n*** UDFDismountDevice: Create\n"));
+ UDFPrint(("\n*** UDFDismountDevice: Create\n"));
RC = ZwCreateFile( &NtFileHandle,
GENERIC_READ,
&ObjectAttributes,
if (!NT_SUCCESS(RC)) try_return(RC);
- KdPrint(("\n*** UDFDismountDevice: QueryVolInfo\n"));
+ UDFPrint(("\n*** UDFDismountDevice: QueryVolInfo\n"));
RC = ZwQueryVolumeInformationFile( NtFileHandle,
&IoStatus,
Buffer,
UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_DVDpRW) ||
UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_DVDRAM) )) try_return(STATUS_SUCCESS);
- KdPrint(("\n*** UDFDismountDevice: LockVolume\n"));
+ UDFPrint(("\n*** UDFDismountDevice: LockVolume\n"));
RC = ZwFsControlFile(NtFileHandle,
NULL,
NULL,
if (!NT_SUCCESS(RC)) try_return(RC);
- KdPrint(("\n*** UDFDismountDevice: DismountVolume\n"));
+ UDFPrint(("\n*** UDFDismountDevice: DismountVolume\n"));
RC = ZwFsControlFile(NtFileHandle,
NULL,
NULL,
if (!NT_SUCCESS(RC)) try_return(RC);
- KdPrint(("\n*** UDFDismountDevice: NotifyMediaChange\n"));
+ UDFPrint(("\n*** UDFDismountDevice: NotifyMediaChange\n"));
RC = ZwDeviceIoControlFile(NtFileHandle,
NULL,
NULL,
if (!NT_SUCCESS(RC)) try_return(RC);
- KdPrint(("\n*** UDFDismountDevice: UnlockVolume\n"));
+ UDFPrint(("\n*** UDFDismountDevice: UnlockVolume\n"));
RC = ZwFsControlFile(NtFileHandle,
NULL,
NULL,
NULL,
NULL);
- KdPrint(("\n*** UDFDismountDevice: Close\n"));
+ UDFPrint(("\n*** UDFDismountDevice: Close\n"));
ZwClose( NtFileHandle );
NtFileHandle = (HANDLE)-1;
- KdPrint(("\n*** UDFDismountDevice: Create 2\n"));
+ UDFPrint(("\n*** UDFDismountDevice: Create 2\n"));
RC = ZwCreateFile( &NtFileHandle,
GENERIC_READ,
&ObjectAttributes,
if (NtFileHandle != (HANDLE)-1) ZwClose( NtFileHandle );
} _SEH2_END;
- KdPrint(("\n*** UDFDismountDevice: RC=%x\n",RC));
+ UDFPrint(("\n*** UDFDismountDevice: RC=%x\n",RC));
return RC;
}
&& UDFGlobalData.UDFDeviceObject_HDD != DeviceObject
#endif // UDF_HDD_SUPPORT
) {
- KdPrint(("\n*** UDFFSNotification \n\n"));
+ UDFPrint(("\n*** UDFFSNotification \n\n"));
// Acquire GlobalDataResource
UDFAcquireResourceExclusive(&(UDFGlobalData.GlobalDataResource), TRUE);
FsNotification_ThreadId = (HANDLE)(-1);
} else {
- KdPrint(("\n*** recursive UDFFSNotification call,\n can't become top-level UDF FSD \n\n"));
+ UDFPrint(("\n*** recursive UDFFSNotification call,\n can't become top-level UDF FSD \n\n"));
}
// Release the global resource.
/* for(CdRomNumber = 0;true;CdRomNumber++) {
sprintf(deviceNameBuffer, "\\Device\\CdRom%d", CdRomNumber);
- KdPrint(( "UDF: UDFRemountAll : dismount %s\n", deviceNameBuffer));
+ UDFPrint(( "UDF: UDFRemountAll : dismount %s\n", deviceNameBuffer));
RtlInitString(&deviceName, deviceNameBuffer);
RC = RtlAnsiStringToUnicodeString(&unicodeCdRomDeviceName, &deviceName, TRUE);
// significant amount of work here deallocating stuff.
//
- KdPrint( ("UDF: Unloading!!\n") );
+ UDFPrint( ("UDF: Unloading!!\n") );
// prevent mount oparations
UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_BEING_UNLOADED;
// wait for all volumes to be dismounted
delay.QuadPart = 10*1000*1000*10;
while(TRUE) {
- KdPrint(("Poll...\n"));
+ UDFPrint(("Poll...\n"));
KeDelayExecutionThread(KernelMode, FALSE, &delay);
}
BOOLEAN Nop = TRUE;
BOOLEAN UnsafeIoctl = (Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL) ? TRUE : FALSE;
- KdPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
+ UDFPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
// Fail immediately if the volume is in the progress of being dismounted
// or has been marked invalid.
if (Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED) {
if ( (Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA) &&
!(Vcb->Vpb->RealDevice->Flags & DO_VERIFY_VOLUME) &&
(!(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) || UnsafeIoctl) ) {
- KdPrint(("UDFVerifyVCB: UnsafeIoctl=%d, locked=%d\n", UnsafeIoctl, (Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) ? 0 : 1));
+ UDFPrint(("UDFVerifyVCB: UnsafeIoctl=%d, locked=%d\n", UnsafeIoctl, (Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) ? 0 : 1));
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_UNSAFE_IOCTL;
RC = UDFTSendIOCTL( IOCTL_STORAGE_CHECK_VERIFY,
Vcb,
// Be safe about the count in case the driver didn't fill it in
if (Iosb.Information != sizeof(ULONG)) MediaChangeCount = 0;
- KdPrint((" MediaChangeCount %d -> %d\n", Vcb->MediaChangeCount, MediaChangeCount));
+ UDFPrint((" MediaChangeCount %d -> %d\n", Vcb->MediaChangeCount, MediaChangeCount));
// If the volume is now an empty device, or we have receieved a
// bare STATUS_VERIFY_REQUIRED (various hardware conditions such
(NT_SUCCESS(RC) && (Vcb->MediaChangeCount != MediaChangeCount)) ||
UnsafeIoctl) {
- KdPrint((" set DO_VERIFY_VOLUME\n"));
+ UDFPrint((" set DO_VERIFY_VOLUME\n"));
Vcb->Vpb->RealDevice->Flags |= DO_VERIFY_VOLUME;
// If the volume is not mounted and we got a media change count,
} else if (!NT_SUCCESS(RC)) {
// Vcb->Vpb->RealDevice->Flags |= DO_VERIFY_VOLUME;
- KdPrint((" UDFNormalizeAndRaiseStatus(%x)\n", RC));
+ UDFPrint((" UDFNormalizeAndRaiseStatus(%x)\n", RC));
UDFNormalizeAndRaiseStatus(IrpContext,RC);
ASSERT(Nop);
}
}
- KdPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
+ UDFPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
// The Vcb may be mounted but the underlying real device may need to be verified.
// If it does then we'll set the Iosb in the irp to be our real device
if (Vcb->Vpb->RealDevice->Flags & DO_VERIFY_VOLUME) {
- KdPrint((" DO_VERIFY_VOLUME -> IoSetHardErrorOrVerifyDevice()\n"));
+ UDFPrint((" DO_VERIFY_VOLUME -> IoSetHardErrorOrVerifyDevice()\n"));
IoSetHardErrorOrVerifyDevice( IrpContext->Irp,
Vcb->Vpb->RealDevice );
RC = STATUS_VERIFY_REQUIRED;
- KdPrint((" UDFRaiseStatus()\n"));
+ UDFPrint((" UDFRaiseStatus()\n"));
UDFRaiseStatus(IrpContext, RC);
ASSERT(Nop);
}
- KdPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
+ UDFPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
if (!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
- KdPrint((" !UDF_VCB_FLAGS_VOLUME_MOUNTED -> IoSetHardErrorOrVerifyDevice()\n"));
+ UDFPrint((" !UDF_VCB_FLAGS_VOLUME_MOUNTED -> IoSetHardErrorOrVerifyDevice()\n"));
Vcb->Vpb->RealDevice->Flags |= DO_VERIFY_VOLUME;
IoSetHardErrorOrVerifyDevice( IrpContext->Irp, Vcb->Vpb->RealDevice );
RC = STATUS_WRONG_VOLUME;
- KdPrint((" UDFRaiseStatus()\n"));
+ UDFPrint((" UDFRaiseStatus()\n"));
UDFRaiseStatus(IrpContext, RC);
// UDFRaiseStatus(IrpContext, STATUS_UNRECOGNIZED_VOLUME);
ASSERT(Nop);
}
if ((Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED)) {
- KdPrint((" UDF_VCB_FLAGS_BEING_DISMOUNTED\n"));
+ UDFPrint((" UDF_VCB_FLAGS_BEING_DISMOUNTED\n"));
RC = STATUS_FILE_INVALID;
UDFRaiseStatus( IrpContext, RC );
ASSERT(Nop);
}
- KdPrint(("UDFVerifyVcb: RC = %x\n", RC));
+ UDFPrint(("UDFVerifyVcb: RC = %x\n", RC));
return RC;
} // end UDFVerifyVcb()
// Update the real device in the IrpContext from the Vpb. There was no available
// file object when the IrpContext was created.
// IrpContext->RealDevice = Vpb->RealDevice;
- KdPrint(("UDFVerifyVolume:\n"));
+ UDFPrint(("UDFVerifyVolume:\n"));
// Acquire shared global access, the termination handler for the
// following try statement will free the access.
_SEH2_TRY {
- KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+ UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
// Check if the real device still needs to be verified. If it doesn't
// then obviously someone beat us here and already did the work
// so complete the verify irp with success. Otherwise reenable
// the real device and get to work.
if( !(Vpb->RealDevice->Flags & DO_VERIFY_VOLUME) &&
((Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) && !UnsafeIoctl) ) {
- KdPrint(("UDFVerifyVolume: STATUS_SUCCESS (1)\n"));
+ UDFPrint(("UDFVerifyVolume: STATUS_SUCCESS (1)\n"));
try_return(RC = STATUS_SUCCESS);
}
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_UNSAFE_IOCTL;
// If we will allow a raw mount then return WRONG_VOLUME to
// allow the volume to be mounted by raw.
if(FlagOn( IrpSp->Flags, SL_ALLOW_RAW_MOUNT )) {
- KdPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (1)\n"));
+ UDFPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (1)\n"));
RC = STATUS_WRONG_VOLUME;
}
if(UDFIsRawDevice(RC)) {
- KdPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (2)\n"));
+ UDFPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (2)\n"));
RC = STATUS_WRONG_VOLUME;
}
try_return( RC );
MediaChangeCount = 0;
}
- KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
- KdPrint(("UDFVerifyVolume: MediaChangeCount=%x, Vcb->MediaChangeCount=%x, UnsafeIoctl=%x\n",
+ UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+ UDFPrint(("UDFVerifyVolume: MediaChangeCount=%x, Vcb->MediaChangeCount=%x, UnsafeIoctl=%x\n",
MediaChangeCount, Vcb->MediaChangeCount, UnsafeIoctl));
// Verify that the device actually saw a change. If the driver does not
// support the MCC, then we must verify the volume in any case.
(Vcb->MediaChangeCount != MediaChangeCount) ||
UnsafeIoctl ) {
- KdPrint(("UDFVerifyVolume: compare\n"));
+ UDFPrint(("UDFVerifyVolume: compare\n"));
NewVcb = (PVCB)MyAllocatePool__(NonPagedPool,sizeof(VCB));
if(!NewVcb)
NewVcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY |
UDF_VCB_FLAGS_MEDIA_READ_ONLY;
// Compare physical parameters (phase 1)
- KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+ UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
RC = UDFCompareVcb(Vcb,NewVcb, TRUE);
if(!NT_SUCCESS(RC)) try_return(RC);
if((Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) &&
Vcb->MountPhErrorCount > MOUNT_ERR_THRESHOLD ) {
- KdPrint(("UDFVerifyVolume: it was very BAD volume. Do not perform Logical check\n"));
+ UDFPrint(("UDFVerifyVolume: it was very BAD volume. Do not perform Logical check\n"));
goto skip_logical_check;
}
// Initialize internal cache
UDFWCacheErrorHandler);
if(!NT_SUCCESS(RC)) try_return(RC);
- KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+ UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
RC = UDFGetDiskInfoAndVerify(NewVcb->TargetDeviceObject,NewVcb);
- KdPrint((" NewVcb->NSRDesc=%x\n", NewVcb->NSRDesc));
+ UDFPrint((" NewVcb->NSRDesc=%x\n", NewVcb->NSRDesc));
if(!NT_SUCCESS(RC)) {
if((Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) &&
(NewVcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) &&
!(NewVcb->NSRDesc & VRS_ISO9660_FOUND)) {
- KdPrint(("UDFVerifyVolume: both are RAW -> remount\n", Vcb->Modified));
+ UDFPrint(("UDFVerifyVolume: both are RAW -> remount\n", Vcb->Modified));
RC = STATUS_SUCCESS;
goto skip_logical_check;
}
NewVcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_MOUNTED;
// Compare logical parameters (phase 2)
- KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+ UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
RC = UDFCompareVcb(Vcb,NewVcb, FALSE);
if(!NT_SUCCESS(RC)) try_return(RC);
// We have unitialized WCache, so it is better to
}
- KdPrint(("UDFVerifyVolume: compared\n"));
- KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
+ UDFPrint(("UDFVerifyVolume: compared\n"));
+ UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_LOCKED)) {
- KdPrint(("UDFVerifyVolume: set UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
+ UDFPrint(("UDFVerifyVolume: set UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_MOUNTED;
Vcb->SoftEjectReq = FALSE;
}
// If we got the wrong volume, mark the Vcb as not mounted.
if(RC == STATUS_WRONG_VOLUME) {
- KdPrint(("UDFVerifyVolume: clear UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
+ UDFPrint(("UDFVerifyVolume: clear UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
Vcb->WriteSecurity = FALSE;
// ASSERT(!(Vcb->EjectWaiter));
if(NT_SUCCESS(RC) &&
(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)){
BOOLEAN CacheInitialized = FALSE;
- KdPrint((" !!! VerifyVolume - QUICK REMOUNT !!!\n"));
+ UDFPrint((" !!! VerifyVolume - QUICK REMOUNT !!!\n"));
// Initialize internal cache
CacheInitialized = WCacheIsInitialized__(&(Vcb->FastCache));
if(!CacheInitialized) {
if(!Vcb->CDR_Mode) {
if((Vcb->TargetDeviceObject->DeviceType == FILE_DEVICE_DISK) ||
CdrwMediaClassEx_IsRAM(Vcb->MediaClassEx)) {
- KdPrint(("UDFMountVolume: RAM mode\n"));
+ UDFPrint(("UDFMountVolume: RAM mode\n"));
Mode = WCACHE_MODE_RAM;
} else {
- KdPrint(("UDFMountVolume: RW mode\n"));
+ UDFPrint(("UDFMountVolume: RW mode\n"));
Mode = WCACHE_MODE_RW;
}
/* if(FsDeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM) {
Vcb->WriteSecurity = FALSE;
Vcb->UseExtendedFE = FALSE;
}
- KdPrint(("UDFVerifyVolume: try start EjectWaiter\n"));
+ UDFPrint(("UDFVerifyVolume: try start EjectWaiter\n"));
RC = UDFStartEjectWaiter(Vcb);
if(!NT_SUCCESS(RC)) {
- KdPrint(("UDFVerifyVolume: start EjectWaiter failed\n"));
+ UDFPrint(("UDFVerifyVolume: start EjectWaiter failed\n"));
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
Vcb->WriteSecurity = FALSE;
}
if(NewVcb) {
// Release internal cache
- KdPrint(("UDFVerifyVolume: delete NewVcb\n"));
+ UDFPrint(("UDFVerifyVolume: delete NewVcb\n"));
WCacheFlushAll__(&(NewVcb->FastCache),NewVcb);
WCacheRelease__(&(NewVcb->FastCache));
Irp->IoStatus.Status = RC;
IoCompleteRequest(Irp,IO_DISK_INCREMENT);
- KdPrint(("UDFVerifyVolume: RC = %x\n", RC));
+ UDFPrint(("UDFVerifyVolume: RC = %x\n", RC));
return RC;
} // end UDFVerifyVolume ()
NTSTATUS RC = STATUS_SUCCESS;
PIO_STACK_LOCATION IrpSp;
- KdPrint(("UDFPerformVerify:\n"));
+ UDFPrint(("UDFPerformVerify:\n"));
if(!IrpContext) return STATUS_INVALID_PARAMETER;
if(!Irp) return STATUS_INVALID_PARAMETER;
Vcb = (PVCB)IrpSp->DeviceObject->DeviceExtension;
- KdPrint(("UDFPerformVerify: check\n"));
+ UDFPrint(("UDFPerformVerify: check\n"));
// Check if the volume still thinks it needs to be verified,
// if it doesn't then we can skip doing a verify because someone
// else beat us to it.
(Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED)) &&
(Vcb->VCBOpenCount <= UDF_RESIDUAL_REFERENCE) )
{
- KdPrint(("UDFPerformVerify: UDFCheckForDismount\n"));
+ UDFPrint(("UDFPerformVerify: UDFCheckForDismount\n"));
UDFAcquireResourceExclusive(&(UDFGlobalData.GlobalDataResource), TRUE);
UDFCheckForDismount( IrpContext, Vcb, FALSE );
UDFReleaseResource(&(UDFGlobalData.GlobalDataResource));
(IrpSp->FileObject->RelatedFileObject == NULL) &&
((RC == STATUS_SUCCESS) || (RC == STATUS_WRONG_VOLUME)) ) {
- KdPrint(("UDFPerformVerify: IO_REMOUNT\n"));
+ UDFPrint(("UDFPerformVerify: IO_REMOUNT\n"));
Irp->IoStatus.Information = IO_REMOUNT;
// for a popup.
} else if ((Irp != NULL) && !NT_SUCCESS( RC )) {
- KdPrint(("UDFPerformVerify: check IoIsErrorUserInduced\n"));
+ UDFPrint(("UDFPerformVerify: check IoIsErrorUserInduced\n"));
// Fill in the device object if required.
if (IoIsErrorUserInduced( RC ) ) {
IoSetHardErrorOrVerifyDevice( Irp, DeviceToVerify );
}
- KdPrint(("UDFPerformVerify: UDFNormalizeAndRaiseStatus\n"));
+ UDFPrint(("UDFPerformVerify: UDFNormalizeAndRaiseStatus\n"));
UDFNormalizeAndRaiseStatus( IrpContext, RC );
}
}
RC = UDFExceptionHandler( IrpContext, Irp);
} _SEH2_END;
- KdPrint(("UDFPerformVerify: RC = %x\n", RC));
+ UDFPrint(("UDFPerformVerify: RC = %x\n", RC));
return RC;
BOOLEAN VcbAcquired;
ULONG ResidualReferenceCount;
- KdPrint(("UDFCheckForDismount:\n"));
+ UDFPrint(("UDFCheckForDismount:\n"));
if(!Vcb) return FALSE;
// GlobalDataResource is already acquired
BOOLEAN FinalReference;
- KdPrint(("UDFDismountVcb:\n"));
+ UDFPrint(("UDFDismountVcb:\n"));
// We should only take this path once.
ASSERT( !(Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED) );
UDF_FILE_INFO RootFileInfo;
BOOLEAN SimpleLogicalCheck = FALSE;
- KdPrint(("UDFCompareVcb:\n"));
+ UDFPrint(("UDFCompareVcb:\n"));
if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_BEING_UNLOADED) {
- KdPrint((" WRONG_VOLUME\n"));
+ UDFPrint((" WRONG_VOLUME\n"));
return STATUS_WRONG_VOLUME;
}
// compare physical parameters
if(PhysicalOnly) {
- KdPrint((" PhysicalOnly\n"));
+ UDFPrint((" PhysicalOnly\n"));
if(VCB_NE(FirstLBA) ||
VCB_NE(LastLBA) ||
VCB_NE(FirstTrackNum) ||
// VCB_NE(xxx) ||
VCB_NE(LastSession) ) {
- KdPrint((" WRONG_VOLUME (2)\n"));
+ UDFPrint((" WRONG_VOLUME (2)\n"));
return STATUS_WRONG_VOLUME;
}
// Note, MRWStatus can change while media is mounted (stoppped/in-progress/complete)
// We can compare only (Vcb->MRWStatus == 0) values
if((OldVcb->MRWStatus == 0) != (NewVcb->MRWStatus == 0)) {
- KdPrint((" WRONG_VOLUME (4), missmatch MRW status\n"));
+ UDFPrint((" WRONG_VOLUME (4), missmatch MRW status\n"));
}
for(uint32 i=OldVcb->FirstTrackNum; i<=OldVcb->LastTrackNum; i++) {
if(VCB_NE(TrackMap[i].FirstLba) ||
VCB_NE(TrackMap[i].TrackParam) ||
VCB_NE(TrackMap[i].DataParam) ||
VCB_NE(TrackMap[i].NWA_V) ) {
- KdPrint((" WRONG_VOLUME (3), missmatch trk %d\n", i));
+ UDFPrint((" WRONG_VOLUME (3), missmatch trk %d\n", i));
return STATUS_WRONG_VOLUME;
}
}
- KdPrint((" Vcb compare Ok\n"));
+ UDFPrint((" Vcb compare Ok\n"));
return STATUS_SUCCESS;
}
// Now, we hope, that nobody changed media.
// We shall make simplified logical structure check
if(OldVcb->Modified) {
- KdPrint((" Vcb SIMPLE compare on !!!MODIFIED!!! volume\n"));
+ UDFPrint((" Vcb SIMPLE compare on !!!MODIFIED!!! volume\n"));
ASSERT(FALSE);
SimpleLogicalCheck = TRUE;
}
// compare logical structure
if(!SimpleLogicalCheck && (OldVcb->InitVatCount != NewVcb->InitVatCount)) {
- KdPrint((" InitVatCount %d != %d \n", OldVcb->InitVatCount, NewVcb->InitVatCount));
+ UDFPrint((" InitVatCount %d != %d \n", OldVcb->InitVatCount, NewVcb->InitVatCount));
return STATUS_WRONG_VOLUME;
}
// Compare volume creation time
if(OldVcb->VolCreationTime != NewVcb->VolCreationTime) {
- KdPrint((" VolCreationTime %I64x != %I64x \n", OldVcb->VolCreationTime, NewVcb->VolCreationTime));
+ UDFPrint((" VolCreationTime %I64x != %I64x \n", OldVcb->VolCreationTime, NewVcb->VolCreationTime));
return STATUS_WRONG_VOLUME;
}
// Compare serial numbers
if(OldVcb->SerialNumber != NewVcb->SerialNumber) {
- KdPrint((" SerialNumber %x != %x \n", OldVcb->SerialNumber, NewVcb->SerialNumber));
+ UDFPrint((" SerialNumber %x != %x \n", OldVcb->SerialNumber, NewVcb->SerialNumber));
return STATUS_WRONG_VOLUME;
}
// Compare volume idents
if(!SimpleLogicalCheck &&
RtlCompareUnicodeString(&(OldVcb->VolIdent),&(NewVcb->VolIdent),FALSE)) {
- KdPrint((" VolIdent missmatch \n"));
+ UDFPrint((" VolIdent missmatch \n"));
return STATUS_WRONG_VOLUME;
}
if(SimpleLogicalCheck) {
// do not touch RootDir. It can be partially recorded
- KdPrint((" SimpleLogicalCheck Ok\n"));
+ UDFPrint((" SimpleLogicalCheck Ok\n"));
return STATUS_SUCCESS;
}
RC = UDFOpenRootFile__(NewVcb, &(NewVcb->RootLbAddr), &RootFileInfo);
if(!NT_SUCCESS(RC)) {
- KdPrint((" Can't open root file, status %x\n", RC));
+ UDFPrint((" Can't open root file, status %x\n", RC));
UDFCleanUpFile__(NewVcb, &RootFileInfo);
return STATUS_WRONG_VOLUME;
}
// perform exhaustive check
if(!(OldVcb->RootDirFCB)) {
- KdPrint((" !(OldVcb->RootDirFCB)\n"));
+ UDFPrint((" !(OldVcb->RootDirFCB)\n"));
wr_vol:
UDFCloseFile__(NewVcb, &RootFileInfo);
UDFCleanUpFile__(NewVcb, &RootFileInfo);
}
if(!UDFCompareFileInfo(&RootFileInfo, OldVcb->RootDirFCB->FileInfo)) {
- KdPrint((" !UDFCompareFileInfo\n"));
+ UDFPrint((" !UDFCompareFileInfo\n"));
goto wr_vol;
}
UDFCloseFile__(NewVcb, &RootFileInfo);
UDFCleanUpFile__(NewVcb, &RootFileInfo);
- KdPrint(("UDFCompareVcb: Ok\n"));
+ UDFPrint(("UDFCompareVcb: Ok\n"));
return STATUS_SUCCESS;
#undef VCB_NE
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
- KdPrint(("UDFQueryVolInfo: \n"));
+ UDFPrint(("UDFQueryVolInfo: \n"));
FsRtlEnterFileSystem();
ASSERT(DeviceObject);
_SEH2_TRY {
- KdPrint(("UDFCommonQueryVolInfo: \n"));
+ UDFPrint(("UDFCommonQueryVolInfo: \n"));
ASSERT(PtrIrpContext);
ASSERT(Irp);
PAGED_CODE();
- KdPrint((" UDFQueryFsVolumeInfo: \n"));
+ UDFPrint((" UDFQueryFsVolumeInfo: \n"));
// Fill in the data from the Vcb.
Buffer->VolumeCreationTime.QuadPart = Vcb->VolCreationTime;
Buffer->VolumeSerialNumber = Vcb->PhSerialNumber;
- KdPrint((" SN %x\n", Vcb->PhSerialNumber));
+ UDFPrint((" SN %x\n", Vcb->PhSerialNumber));
Buffer->SupportsObjects = FALSE;
{
PAGED_CODE();
- KdPrint((" UDFQueryFsSizeInfo: \n"));
+ UDFPrint((" UDFQueryFsSizeInfo: \n"));
// Fill in the output buffer.
if(Vcb->BitmapModified) {
Vcb->TotalAllocUnits =
if(!Buffer->BytesPerSector)
Buffer->BytesPerSector = 2048;
- KdPrint((" Space: Total %I64x, Free %I64x\n",
+ UDFPrint((" Space: Total %I64x, Free %I64x\n",
Buffer->TotalAllocationUnits.QuadPart,
Buffer->AvailableAllocationUnits.QuadPart));
{
PAGED_CODE();
- KdPrint((" UDFQueryFsFullSizeInfo: \n"));
+ UDFPrint((" UDFQueryFsFullSizeInfo: \n"));
// Fill in the output buffer.
if(Vcb->BitmapModified) {
Vcb->TotalAllocUnits =
if(!Buffer->BytesPerSector)
Buffer->BytesPerSector = 2048;
- KdPrint((" Space: Total %I64x, Free %I64x\n",
+ UDFPrint((" Space: Total %I64x, Free %I64x\n",
Buffer->TotalAllocationUnits.QuadPart,
Buffer->ActualAvailableAllocationUnits.QuadPart));
{
PAGED_CODE();
- KdPrint((" UDFQueryFsDeviceInfo: \n"));
+ UDFPrint((" UDFQueryFsDeviceInfo: \n"));
// Update the output buffer.
if (Vcb->TargetDeviceObject->DeviceType != FILE_DEVICE_CD_ROM && Vcb->TargetDeviceObject->DeviceType != FILE_DEVICE_DVD)
{
Buffer->Characteristics = Vcb->TargetDeviceObject->Characteristics;
}
Buffer->DeviceType = Vcb->TargetDeviceObject->DeviceType;
- KdPrint((" Characteristics %x, DeviceType %x\n", Buffer->Characteristics, Buffer->DeviceType));
+ UDFPrint((" Characteristics %x, DeviceType %x\n", Buffer->Characteristics, Buffer->DeviceType));
// Adjust the length variable
*Length -= sizeof( FILE_FS_DEVICE_INFORMATION );
return STATUS_SUCCESS;
ULONG FsTypeTitleLen;
PAGED_CODE();
- KdPrint((" UDFQueryFsAttributeInfo: \n"));
+ UDFPrint((" UDFQueryFsAttributeInfo: \n"));
// Fill out the fixed portion of the buffer.
Buffer->FileSystemAttributes = FILE_CASE_SENSITIVE_SEARCH |
FILE_CASE_PRESERVED_NAMES |
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
- KdPrint(("UDFSetVolInfo: \n"));
+ UDFPrint(("UDFSetVolInfo: \n"));
FsRtlEnterFileSystem();
ASSERT(DeviceObject);
_SEH2_TRY {
- KdPrint(("UDFCommonSetVolInfo: \n"));
+ UDFPrint(("UDFCommonSetVolInfo: \n"));
ASSERT(PtrIrpContext);
ASSERT(Irp);
ASSERT(Ccb);
if(Ccb && Ccb->Fcb && (Ccb->Fcb->NodeIdentifier.NodeType != UDF_NODE_TYPE_VCB)) {
- KdPrint((" Can't change Label on Non-volume object\n"));
+ UDFPrint((" Can't change Label on Non-volume object\n"));
try_return(RC = STATUS_ACCESS_DENIED);
}
// Reference our input parameters to make things easier
if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
- KdPrint((" Can't change Label on blank volume ;)\n"));
+ UDFPrint((" Can't change Label on blank volume ;)\n"));
try_return(RC = STATUS_ACCESS_DENIED);
}
{
PAGED_CODE();
- KdPrint((" UDFSetLabelInfo: \n"));
+ UDFPrint((" UDFSetLabelInfo: \n"));
if(Buffer->VolumeLabelLength > UDF_VOL_LABEL_LEN*sizeof(WCHAR)) {
// Too long Volume Label... NT doesn't like it
- KdPrint((" UDFSetLabelInfo: STATUS_INVALID_VOLUME_LABEL\n"));
+ UDFPrint((" UDFSetLabelInfo: STATUS_INVALID_VOLUME_LABEL\n"));
return STATUS_INVALID_VOLUME_LABEL;
}
Vcb->VolIdent.Buffer[Buffer->VolumeLabelLength/sizeof(WCHAR)] = 0;
UDFSetModified(Vcb);
- KdPrint((" UDFSetLabelInfo: OK\n"));
+ UDFPrint((" UDFSetLabelInfo: OK\n"));
return STATUS_SUCCESS;
} // end UDFSetLabelInfo ()
switch((ULONG)TopIrp) {
case FSRTL_FSP_TOP_LEVEL_IRP:
- KdPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n"));
+ UDFPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n"));
break;
case FSRTL_CACHE_TOP_LEVEL_IRP:
- KdPrint((" FSRTL_CACHE_TOP_LEVEL_IRP\n"));
+ UDFPrint((" FSRTL_CACHE_TOP_LEVEL_IRP\n"));
break;
case FSRTL_MOD_WRITE_TOP_LEVEL_IRP:
- KdPrint((" FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
+ UDFPrint((" FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
break;
case FSRTL_FAST_IO_TOP_LEVEL_IRP:
- KdPrint((" FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
+ UDFPrint((" FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
BrutePoint();
break;
case NULL:
- KdPrint((" NULL TOP_LEVEL_IRP\n"));
+ UDFPrint((" NULL TOP_LEVEL_IRP\n"));
break;
default:
if(TopIrp == Irp) {
- KdPrint((" TOP_LEVEL_IRP\n"));
+ UDFPrint((" TOP_LEVEL_IRP\n"));
} else {
- KdPrint((" RECURSIVE_IRP, TOP = %x\n", TopIrp));
+ UDFPrint((" RECURSIVE_IRP, TOP = %x\n", TopIrp));
}
break;
}
PagingIo = (Irp->Flags & IRP_PAGING_IO) ? TRUE : FALSE;
NonBufferedIo = (Irp->Flags & IRP_NOCACHE) ? TRUE : FALSE;
SynchronousIo = (FileObject->Flags & FO_SYNCHRONOUS_IO) ? TRUE : FALSE;
- KdPrint((" Flags: %s; %s; %s; %s; Irp(W): %8.8x\n",
+ UDFPrint((" Flags: %s; %s; %s; %s; Irp(W): %8.8x\n",
CanWait ? "Wt" : "nw", PagingIo ? "Pg" : "np",
NonBufferedIo ? "NBuf" : "buff", SynchronousIo ? "Snc" : "Asc",
Irp->Flags));
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)) {
try_return(RC = STATUS_INVALID_USER_BUFFER);
// Indicate, that volume contents can change after this operation
// This flag will force VerifyVolume in future
- KdPrint((" set UnsafeIoctl\n"));
+ UDFPrint((" set UnsafeIoctl\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_UNSAFE_IOCTL;
// Make sure, that volume will never be quick-remounted
// It is very important for ChkUdf utility.
// Cache Manager and/or the VMM does not want us to perform
// the write at this time. Post the request.
PtrIrpContext->IrpContextFlags |= UDF_IRP_CONTEXT_DEFERRED_WRITE;
- KdPrint(("UDFCommonWrite: Defer write\n"));
+ UDFPrint(("UDFCommonWrite: Defer write\n"));
MmPrint((" CcDeferWrite()\n"));
CcDeferWrite(FileObject, UDFDeferredWriteCallBack, PtrIrpContext, Irp, WriteLength, IsThisADeferredWrite);
try_return(RC = STATUS_PENDING);
NtReqFcb->CommonFCBHeader.AllocationSize.LowPart &= ~(PAGE_SIZE-1);
}
- KdPrint(("UDFCommonWrite: Set size %x (alloc size %x)\n", ByteOffset.LowPart + TruncatedLength, NtReqFcb->CommonFCBHeader.AllocationSize.LowPart));
+ UDFPrint(("UDFCommonWrite: Set size %x (alloc size %x)\n", ByteOffset.LowPart + TruncatedLength, NtReqFcb->CommonFCBHeader.AllocationSize.LowPart));
if (CcIsFileCached(FileObject)) {
if(ExtendFS) {
MmPrint((" CcSetFileSizes()\n"));
if (!FileObject->PrivateCacheMap) {
// This is the first cached I/O operation. You must ensure
// that the FCB Common FCB Header contains valid sizes at this time
- KdPrint(("UDFCommonWrite: Init system cache\n"));
+ UDFPrint(("UDFCommonWrite: Init system cache\n"));
MmPrint((" CcInitializeCacheMap()\n"));
CcInitializeCacheMap(FileObject, (PCC_FILE_SIZES)(&(NtReqFcb->CommonFCBHeader.AllocationSize)),
FALSE, // We will not utilize pin access for this file
#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;
}
} else
{}
/* if((TopIrp != Irp)) {
- KdPrint(("(TopIrp != Irp) => CanWait\n"));
+ UDFPrint(("(TopIrp != Irp) => CanWait\n"));
CanWait = TRUE;
} else*/
#endif
}
// Successful check will cause WCache lock
if(!CanWait && UDFIsFileCached__(Vcb, Fcb->FileInfo, ByteOffset.QuadPart, TruncatedLength, TRUE)) {
- KdPrint(("UDFCommonWrite: Cached => CanWait\n"));
+ UDFPrint(("UDFCommonWrite: Cached => CanWait\n"));
CacheLocked = TRUE;
CanWait = TRUE;
}
// Send the request to lower level drivers
if(!CanWait) {
- KdPrint(("UDFCommonWrite: Post physical write %x bytes at %x\n", TruncatedLength, ByteOffset.LowPart));
+ UDFPrint(("UDFCommonWrite: Post physical write %x bytes at %x\n", TruncatedLength, ByteOffset.LowPart));
try_return(RC = STATUS_PENDING);
}
} // can we complete the IRP ?
} _SEH2_END; // end of "__finally" processing
- KdPrint(("\n"));
+ UDFPrint(("\n"));
return(RC);
} // end UDFCommonWrite()
IN PVOID Context2 // Should be Irp
)
{
- KdPrint(("UDFDeferredWriteCallBack\n"));
+ UDFPrint(("UDFDeferredWriteCallBack\n"));
// We should typically simply post the request to our internal
// queue of posted requests (just as we would if the original write
// could not be completed because the caller could not block).