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
This commit is contained in:
Pierre Schweitzer 2017-06-03 20:09:21 +00:00
parent 9b036de80b
commit c3265cc215
40 changed files with 1299 additions and 1291 deletions

View file

@ -243,7 +243,7 @@ UDFFileDirInfoToNT(
NTSTATUS status;
PtrUDFNTRequiredFCB NtReqFcb;
KdPrint(("@=%#x, FileDirNdx %x\n", &Vcb, FileDirNdx));
UDFPrint(("@=%#x, FileDirNdx %x\n", &Vcb, FileDirNdx));
ASSERT((ULONG)NTFileInfo > 0x1000);
RtlZeroMemory(NTFileInfo, sizeof(FILE_BOTH_DIR_INFORMATION));
@ -252,13 +252,13 @@ UDFFileDirInfoToNT(
DosName.MaximumLength = sizeof(NTFileInfo->ShortName); // 12*sizeof(WCHAR)
_SEH2_TRY {
KdPrint((" DirInfoToNT: %*.*S\n", FileDirNdx->FName.Length/sizeof(WCHAR), FileDirNdx->FName.Length/sizeof(WCHAR), FileDirNdx->FName));
UDFPrint((" DirInfoToNT: %*.*S\n", FileDirNdx->FName.Length/sizeof(WCHAR), FileDirNdx->FName.Length/sizeof(WCHAR), FileDirNdx->FName));
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
KdPrint((" DirInfoToNT: exception when printing file name\n"));
UDFPrint((" DirInfoToNT: exception when printing file name\n"));
} _SEH2_END;
if(FileDirNdx->FileInfo) {
KdPrint((" FileInfo\n"));
UDFPrint((" FileInfo\n"));
// validate FileInfo
ValidateFileInfo(FileDirNdx->FileInfo);
if(UDFGetFileLinkCount(FileDirNdx->FileInfo) > 1)
@ -267,7 +267,7 @@ UDFFileDirInfoToNT(
// read required sizes from Fcb (if any) if file is not linked
// otherwise we should read them from FileEntry
if(FileDirNdx->FileInfo->Fcb) {
KdPrint((" Fcb\n"));
UDFPrint((" Fcb\n"));
NtReqFcb = FileDirNdx->FileInfo->Fcb->NTRequiredFCB;
NTFileInfo->CreationTime.QuadPart = NtReqFcb->CreationTime.QuadPart;
NTFileInfo->LastWriteTime.QuadPart = NtReqFcb->LastWriteTime.QuadPart;
@ -279,7 +279,7 @@ UDFFileDirInfoToNT(
NTFileInfo->EndOfFile.QuadPart = NtReqFcb->CommonFCBHeader.FileSize.QuadPart;*/
NTFileInfo->EndOfFile.QuadPart = FileDirNdx->FileSize;
if(FileDirNdx->FI_Flags & UDF_FI_FLAG_SYS_ATTR) {
KdPrint((" SYS_ATTR\n"));
UDFPrint((" SYS_ATTR\n"));
NTFileInfo->FileAttributes = FileDirNdx->SysAttr;
goto get_name_only;
}
@ -294,7 +294,7 @@ UDFFileDirInfoToNT(
(FileDirNdx->FI_Flags & UDF_FI_FLAG_LINKED)) {
LONG_AD feloc;
KdPrint((" !SYS_ATTR\n"));
UDFPrint((" !SYS_ATTR\n"));
FileEntry = (PFILE_ENTRY)MyAllocatePool__(NonPagedPool, Vcb->LBlockSize);
if(!FileEntry) return STATUS_INSUFFICIENT_RESOURCES;
@ -302,14 +302,14 @@ UDFFileDirInfoToNT(
feloc.extLocation = FileDirNdx->FileEntryLoc;
if(!NT_SUCCESS(status = UDFReadFileEntry(Vcb, &feloc, FileEntry, &Ident))) {
KdPrint((" !UDFReadFileEntry\n"));
UDFPrint((" !UDFReadFileEntry\n"));
MyFreePool__(FileEntry);
FileEntry = NULL;
goto get_name_only;
}
ReadSizes = TRUE;
} else {
KdPrint((" FileDirNdx\n"));
UDFPrint((" FileDirNdx\n"));
NTFileInfo->CreationTime.QuadPart = FileDirNdx->CreationTime;
NTFileInfo->LastWriteTime.QuadPart = FileDirNdx->LastWriteTime;
NTFileInfo->LastAccessTime.QuadPart = FileDirNdx->LastAccessTime;
@ -325,11 +325,11 @@ UDFFileDirInfoToNT(
if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK)
goto get_name_only;
KdPrint((" direct\n"));
UDFPrint((" direct\n"));
if(FileEntry->descTag.tagIdent == TID_FILE_ENTRY) {
KdPrint((" TID_FILE_ENTRY\n"));
UDFPrint((" TID_FILE_ENTRY\n"));
if(ReadSizes) {
KdPrint((" ReadSizes\n"));
UDFPrint((" ReadSizes\n"));
// Times
FileDirNdx->CreationTime = NTFileInfo->CreationTime.QuadPart =
FileDirNdx->LastWriteTime = NTFileInfo->LastWriteTime.QuadPart = UDFTimeToNT(&(FileEntry->modificationTime));
@ -339,7 +339,7 @@ UDFFileDirInfoToNT(
FileDirNdx->FileSize =
NTFileInfo->EndOfFile.QuadPart =
FileEntry->informationLength;
KdPrint((" informationLength=%I64x, lengthAllocDescs=%I64x\n",
UDFPrint((" informationLength=%I64x, lengthAllocDescs=%I64x\n",
FileEntry->informationLength,
FileEntry->lengthAllocDescs
));
@ -351,9 +351,9 @@ UDFFileDirInfoToNT(
// NTFileInfo->EaSize = 0;//FileEntry->lengthExtendedAttr;
} else if(FileEntry->descTag.tagIdent == TID_EXTENDED_FILE_ENTRY) {
ExFileEntry = (PEXTENDED_FILE_ENTRY)FileEntry;
KdPrint((" PEXTENDED_FILE_ENTRY\n"));
UDFPrint((" PEXTENDED_FILE_ENTRY\n"));
if(ReadSizes) {
KdPrint((" ReadSizes\n"));
UDFPrint((" ReadSizes\n"));
// Times
FileDirNdx->CreationTime = NTFileInfo->CreationTime.QuadPart = UDFTimeToNT(&(ExFileEntry->createTime));
FileDirNdx->LastWriteTime = NTFileInfo->LastWriteTime.QuadPart = UDFTimeToNT(&(ExFileEntry->modificationTime));
@ -363,7 +363,7 @@ UDFFileDirInfoToNT(
FileDirNdx->FileSize =
NTFileInfo->EndOfFile.QuadPart =
ExFileEntry->informationLength;
KdPrint((" informationLength=%I64x, lengthAllocDescs=%I64x\n",
UDFPrint((" informationLength=%I64x, lengthAllocDescs=%I64x\n",
FileEntry->informationLength,
FileEntry->lengthAllocDescs
));
@ -374,13 +374,13 @@ UDFFileDirInfoToNT(
}
// NTFileInfo->EaSize = 0;//ExFileEntry->lengthExtendedAttr;
} else {
KdPrint((" ???\n"));
UDFPrint((" ???\n"));
goto get_name_only;
}
get_attr_only:
KdPrint((" get_attr"));
UDFPrint((" get_attr"));
// do some substitutions
if(!FileDirNdx->CreationTime) {
FileDirNdx->CreationTime = NTFileInfo->CreationTime.QuadPart = Vcb->VolCreationTime;
@ -405,20 +405,20 @@ get_name_only:
NTFileInfo->FileNameLength = UdfName.Length;
RtlCopyMemory((PCHAR)&(NTFileInfo->FileName), (PCHAR)(UdfName.Buffer), UdfName.MaximumLength);
if(!(FileDirNdx->FI_Flags & UDF_FI_FLAG_DOS)) {
KdPrint((" !UDF_FI_FLAG_DOS"));
UDFPrint((" !UDF_FI_FLAG_DOS"));
UDFDOSName(Vcb, &DosName, &UdfName,
(FileDirNdx->FI_Flags & UDF_FI_FLAG_KEEP_NAME) ? TRUE : FALSE);
NTFileInfo->ShortNameLength = (UCHAR)DosName.Length;
}
// report zero EOF & AllocSize for Dirs
if(FileDirNdx->FileCharacteristics & FILE_DIRECTORY) {
KdPrint((" FILE_DIRECTORY"));
UDFPrint((" FILE_DIRECTORY"));
NTFileInfo->AllocationSize.QuadPart =
NTFileInfo->EndOfFile.QuadPart = 0;
}
KdPrint((" AllocationSize=%I64x, NTFileInfo->EndOfFile=%I64x", NTFileInfo->AllocationSize.QuadPart, NTFileInfo->EndOfFile.QuadPart));
UDFPrint((" AllocationSize=%I64x, NTFileInfo->EndOfFile=%I64x", NTFileInfo->AllocationSize.QuadPart, NTFileInfo->EndOfFile.QuadPart));
// free tmp buffer (if any)
KdPrint(("\n"));
UDFPrint(("\n"));
if(FileEntry && !FileDirNdx->FileInfo)
MyFreePool__(FileEntry);
return STATUS_SUCCESS;

View file

@ -116,13 +116,13 @@ UDFPhReadSynchronous(
#if !defined(LIBUDF) && !defined(LIBUDFFMT)
NTSTATUS RC;
// KdPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0xb,Offset>>0xb));
// UDFPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0xb,Offset>>0xb));
LONG HiOffs = (ULONG)(Offset >> 32);
RC = SetFilePointer(DeviceObject->h,(ULONG)Offset,&HiOffs,FILE_BEGIN);
if(RC == INVALID_SET_FILE_POINTER) {
if(GetLastError() != NO_ERROR) {
KdPrint(("UDFPhReadSynchronous: error %x\n", GetLastError()));
UDFPrint(("UDFPhReadSynchronous: error %x\n", GetLastError()));
return STATUS_END_OF_FILE;
}
}
@ -167,7 +167,7 @@ UDFPhWriteSynchronous(
RC = SetFilePointer(DeviceObject->h,(ULONG)Offset,&HiOffs,FILE_BEGIN);
if(RC == INVALID_SET_FILE_POINTER) {
if(GetLastError() != NO_ERROR) {
KdPrint(("UDFPhWriteSynchronous: error %x\n", GetLastError()));
UDFPrint(("UDFPhWriteSynchronous: error %x\n", GetLastError()));
return STATUS_END_OF_FILE;
}
}
@ -180,7 +180,7 @@ UDFPhWriteSynchronous(
if(!RC ||
!(*WrittenBytes)) {
RC = GetLastError();
KdPrint(("UDFPhWriteSynchronous: EOF, error %x\n", RC));
UDFPrint(("UDFPhWriteSynchronous: EOF, error %x\n", RC));
RC = STATUS_END_OF_FILE;
} else {
RC = STATUS_SUCCESS;
@ -426,7 +426,7 @@ my_retrieve_vol_type(
#ifndef CDRW_W32
if(wcslen(fn) == 2 && fn[1] == ':') {
ULONG DevType = GetDriveTypeW(fn);
KdPrint((" DevType %x\n", DevType));
UDFPrint((" DevType %x\n", DevType));
switch(DevType) {
case DRIVE_CDROM:
Vcb->PhDeviceType = FILE_DEVICE_CD_ROM;
@ -500,18 +500,18 @@ my_open(
#ifndef NT_NATIVE_MODE
swprintf(deviceNameBuffer, L"%ws\\", fn);
KdPrint(("my_open: %S\n", fn));
UDFPrint(("my_open: %S\n", fn));
i = sizeof(FSNameBuffer)/sizeof(FSNameBuffer[0]);
if(GetVolumeInformationW(deviceNameBuffer, NULL, 0,
&returned, &returned, &returned, FSNameBuffer, i)) {
KdPrint(("my_open: FS: %S\n", FSNameBuffer));
UDFPrint(("my_open: FS: %S\n", FSNameBuffer));
if(!wcscmp(FSNameBuffer, L"Unknown")) {
retry++;
}
} else {
KdPrint(("my_open: FS: ???\n"));
UDFPrint(("my_open: FS: ???\n"));
}
KdPrint(("my_open: retry %d times\n", retry));
UDFPrint(("my_open: retry %d times\n", retry));
#endif //NT_NATIVE_MODE
@ -532,7 +532,7 @@ my_open(
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING, NULL);
if(h != ((HANDLE)-1)) {
KdPrint((" opened i=%x\n", i));
UDFPrint((" opened i=%x\n", i));
}
}
}
@ -558,7 +558,7 @@ my_open(
NULL,
0);
if(!NT_SUCCESS(RC)) {
KdPrint((" opened i2=%x\n", i));
UDFPrint((" opened i2=%x\n", i));
h = ((HANDLE)-1);
}
}
@ -580,22 +580,22 @@ my_open(
if(retry < MAX_INVALIDATE_VOLUME_RETRY) {
retry++;
if(!Privilege(SE_TCB_NAME, TRUE)) {
KdPrint(("SE_TCB privilege not held\n"));
UDFPrint(("SE_TCB privilege not held\n"));
} else
if(DeviceIoControl(h,FSCTL_INVALIDATE_VOLUMES,&h,sizeof(h),NULL,0,&returned,NULL) ) {
KdPrint((" FSCTL_INVALIDATE_VOLUMES ok, status %x\n", GetLastError()));
UDFPrint((" FSCTL_INVALIDATE_VOLUMES ok, status %x\n", GetLastError()));
CloseHandle(h);
continue;
} else {
//#ifndef CDRW_W32
KdPrint((" FSCTL_INVALIDATE_VOLUMES failed, error %x\n", GetLastError()));
UDFPrint((" FSCTL_INVALIDATE_VOLUMES failed, error %x\n", GetLastError()));
RC = GetLastError();
if(DeviceIoControl(h,IOCTL_UDF_INVALIDATE_VOLUMES,&h,sizeof(h),NULL,0,&returned,NULL) ) {
KdPrint((" IOCTL_UDF_INVALIDATE_VOLUMES ok, status %x\n", GetLastError()));
UDFPrint((" IOCTL_UDF_INVALIDATE_VOLUMES ok, status %x\n", GetLastError()));
CloseHandle(h);
continue;
}
KdPrint((" IOCTL_UDF_INVALIDATE_VOLUMES, error %x\n", GetLastError()));
UDFPrint((" IOCTL_UDF_INVALIDATE_VOLUMES, error %x\n", GetLastError()));
//#endif //CDRW_W32
}
UserPrint(("can't lock volume, retry\n"));
@ -614,11 +614,11 @@ my_open(
}
//#ifndef CDRW_W32
if(!DeviceIoControl(h,FSCTL_ALLOW_EXTENDED_DASD_IO,NULL,0,NULL,0,&returned,NULL)) {
KdPrint(("Warning: can't allow extended DASD i/o\n"));
UDFPrint(("Warning: can't allow extended DASD i/o\n"));
}
//#endif //CDRW_W32
KdPrint((" opened, h=%x\n", h));
UDFPrint((" opened, h=%x\n", h));
return h;
}
RC = GetLastError();
@ -647,7 +647,7 @@ my_open(
#endif //NT_NATIVE_MODE
if(h != ((HANDLE)-1)) {
KdPrint((" opened R/O, h=%x\n", h));
UDFPrint((" opened R/O, h=%x\n", h));
#ifndef CDRW_W32
my_retrieve_vol_type(Vcb, fn);
#else
@ -660,7 +660,7 @@ my_open(
if(retry < MAX_INVALIDATE_VOLUME_RETRY) {
retry++;
if(!Privilege(SE_TCB_NAME, TRUE)) {
KdPrint(("SE_TCB privilege not held\n"));
UDFPrint(("SE_TCB privilege not held\n"));
} else
if(DeviceIoControl(h,FSCTL_INVALIDATE_VOLUMES,&h,sizeof(h),NULL,0,&returned,NULL) ) {
CloseHandle(h);
@ -744,7 +744,7 @@ try_as_file:
return NULL;
#endif //CDRW_W32
}
KdPrint((" opened as file, h=%x\n", h));
UDFPrint((" opened as file, h=%x\n", h));
break;
} while(TRUE);

View file

@ -305,7 +305,7 @@ _getopt_internal(
if (ambig && !exact) {
if (o->opterr) {
KdPrint(("%ws: option `%s' is ambiguous\n",
UDFPrint(("%ws: option `%s' is ambiguous\n",
argv[0], argv[o->optind]));
}
o->nextchar += my_strlen (o->nextchar);
@ -326,12 +326,12 @@ _getopt_internal(
if (o->opterr) {
if (argv[o->optind - 1][1] == '-') {
/* --option */
KdPrint((
UDFPrint((
"%ws: option `--%ws' doesn't allow an argument\n",
argv[0], pfound->name));
} else {
/* +option or -option */
KdPrint((
UDFPrint((
"%ws: option `%c%ws' doesn't allow an argument\n",
argv[0], argv[o->optind - 1][0], pfound->name));
}
@ -346,7 +346,7 @@ _getopt_internal(
o->optarg = argv[(o->optind)++];
} else {
if (o->opterr)
KdPrint(("%ws: option `%ws' requires an argument\n",
UDFPrint(("%ws: option `%ws' requires an argument\n",
argv[0], argv[o->optind - 1]));
o->nextchar += my_strlen (o->nextchar);
return optstring[0] == ':' ? ':' : BAD_OPTION;
@ -372,11 +372,11 @@ _getopt_internal(
{
if (argv[o->optind][1] == '-') {
/* --option */
KdPrint(("%ws: unrecognized option `--%ws'\n",
UDFPrint(("%ws: unrecognized option `--%ws'\n",
argv[0], o->nextchar));
} else {
/* +option or -option */
KdPrint(("%ws: unrecognized option `%c%ws'\n",
UDFPrint(("%ws: unrecognized option `%c%ws'\n",
argv[0], argv[o->optind][0], o->nextchar));
}
}
@ -400,7 +400,7 @@ _getopt_internal(
{
if (o->opterr)
{
KdPrint(("%ws: illegal option -- %c\n", argv[0], c));
UDFPrint(("%ws: illegal option -- %c\n", argv[0], c));
}
o->optopt = c;
return BAD_OPTION;
@ -432,7 +432,7 @@ _getopt_internal(
{
if (o->opterr)
{
KdPrint(("%ws: option requires an argument -- %c\n",
UDFPrint(("%ws: option requires an argument -- %c\n",
argv[0], c));
}
o->optopt = c;

View file

@ -67,14 +67,14 @@ MyAllocDumpDescr(
BOOLEAN Used;
Used = (Allocs[i].Len & MY_HEAP_FLAG_USED) ? TRUE : FALSE;
KdPrint(("block %x \t%s addr %x len %x \t", i, Used ? "used" : "free", Allocs[i].Addr, (Allocs[i].Len) & MY_HEAP_FLAG_LEN_MASK));
UDFPrint(("block %x \t%s addr %x len %x \t", i, Used ? "used" : "free", Allocs[i].Addr, (Allocs[i].Len) & MY_HEAP_FLAG_LEN_MASK));
#ifdef MY_HEAP_TRACK_OWNERS
KdPrint(("src %x \t line %d \t", Allocs[i].Src, Allocs[i].Line));
UDFPrint(("src %x \t line %d \t", Allocs[i].Src, Allocs[i].Line));
#endif
#ifdef MY_HEAP_TRACK_REF
KdPrint(("%s%s", Used ? " " : "-", Allocs[i].Tag ? Allocs[i].Tag : ""));
UDFPrint(("%s%s", Used ? " " : "-", Allocs[i].Tag ? Allocs[i].Tag : ""));
#endif
KdPrint(("\n"));
UDFPrint(("\n"));
}
//#define CHECK_ALLOC_FRAMES
@ -103,20 +103,20 @@ MyAllocDumpFrame(
#endif //DUMP_MEM_FRAMES
return;
KdPrint(("Dumping frame %x\n",Frame));
KdPrint(("FirstFree %x LastUsed %x ", FrameList[Frame].FirstFree, FrameList[Frame].LastUsed));
KdPrint(("Type %x\n", FrameList[Frame].Type));
UDFPrint(("Dumping frame %x\n",Frame));
UDFPrint(("FirstFree %x LastUsed %x ", FrameList[Frame].FirstFree, FrameList[Frame].LastUsed));
UDFPrint(("Type %x\n", FrameList[Frame].Type));
if(Allocs) {
for(i=0;i< (MY_HEAP_MAX_BLOCKS/*-1*/);i++) {
Used = (Allocs[i].Len & MY_HEAP_FLAG_USED) ? TRUE : FALSE;
KdPrint(("block %x \t%s addr %x len %x \t", i, Used ? "used" : "free", Allocs[i].Addr, (Allocs[i].Len) & MY_HEAP_FLAG_LEN_MASK));
UDFPrint(("block %x \t%s addr %x len %x \t", i, Used ? "used" : "free", Allocs[i].Addr, (Allocs[i].Len) & MY_HEAP_FLAG_LEN_MASK));
#ifdef MY_HEAP_TRACK_OWNERS
KdPrint(("src %x \t line %d \t", Allocs[i].Src, Allocs[i].Line));
UDFPrint(("src %x \t line %d \t", Allocs[i].Src, Allocs[i].Line));
#endif
#ifdef MY_HEAP_TRACK_REF
KdPrint(("%s%s", Used ? " " : "-", Allocs[i].Tag ? Allocs[i].Tag : ""));
UDFPrint(("%s%s", Used ? " " : "-", Allocs[i].Tag ? Allocs[i].Tag : ""));
#endif
KdPrint(("\n"));
UDFPrint(("\n"));
if(!(Allocs[i].Len) && !(Allocs[i].Addr)) {
break;
}
@ -124,7 +124,7 @@ MyAllocDumpFrame(
k += ((Allocs[i].Len) & MY_HEAP_FLAG_LEN_MASK);
}
}
KdPrint((" Wasted %x bytes from %x\n", MY_HEAP_FRAME_SIZE - k, MY_HEAP_FRAME_SIZE));
UDFPrint((" Wasted %x bytes from %x\n", MY_HEAP_FRAME_SIZE - k, MY_HEAP_FRAME_SIZE));
} // end MyAllocDumpFrame()
VOID
@ -140,12 +140,12 @@ MyAllocDumpFrames(
}
}
KdPrint(("\n"));
UDFPrint(("\n"));
for(i=0;i<MY_HEAP_MAX_FRAMES; i++) {
if(FrameList[i].Frame) {
KdPrint(("Addr %x ", FrameList[i].Frame));
KdPrint(("Type %x\n" , FrameList[i].Type));
UDFPrint(("Addr %x ", FrameList[i].Frame));
UDFPrint(("Type %x\n" , FrameList[i].Type));
}
}
@ -166,9 +166,9 @@ MyAllocCheck(
addr = Allocs[i].Addr;
if( len != (Allocs[i+1].Addr - addr) ) {
if(Allocs[i+1].Addr) {
KdPrint(("ERROR! Memory block aliasing\n"));
KdPrint(("block %x, frame %x\n", i, Frame));
KdPrint(("block descriptor %x\n", &(Allocs[i]) ));
UDFPrint(("ERROR! Memory block aliasing\n"));
UDFPrint(("block %x, frame %x\n", i, Frame));
UDFPrint(("block descriptor %x\n", &(Allocs[i]) ));
BrutePoint();
MyAllocDumpFrame(Frame);
}
@ -291,7 +291,7 @@ MyAllocatePoolInFrame(
Allocs->Tag = Tag;
#endif //MY_HEAP_TRACK_REF
// KdPrint(( "Mem: Allocated %x at addr %x\n", size, (ULONG)addr ));
// UDFPrint(( "Mem: Allocated %x at addr %x\n", size, (ULONG)addr ));
// this will set IntegrityTag to zero
*((PULONG)addr) = 0x00000000;
#ifdef MY_HEAP_CHECK_BOUNDS
@ -320,7 +320,7 @@ MyFindMemDescByAddr(
Allocs = FrameList[Frame].Frame;
// i = FrameList[Frame].LastUsed >> 1;
// KdPrint(("Mem: Freeing %x\n", (ULONG)addr)); DEADDA7A
// UDFPrint(("Mem: Freeing %x\n", (ULONG)addr)); DEADDA7A
// for(i=0;i<MY_HEAP_MAX_BLOCKS;i++) {
left = 0;
right = FrameList[Frame].LastUsed;
@ -364,7 +364,7 @@ MyFreePoolInFrame(
pc = 0;
i = MyFindMemDescByAddr(Frame, addr);
if(i < 0) {
KdPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!! ;( \n", addr));
UDFPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!! ;( \n", addr));
MyAllocDumpFrame(Frame);
BrutePoint();
return;
@ -451,7 +451,7 @@ MyResizePoolInFrame(
Allocs = FrameList[Frame].Frame;
i = MyFindMemDescByAddr(Frame, addr);
if(i < 0) {
KdPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!! ;( \n", addr));
UDFPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!! ;( \n", addr));
MyAllocDumpFrame(Frame);
BrutePoint();
return FALSE;
@ -553,7 +553,7 @@ MyAllocInitFrame(
Allocs = (PMEM_ALLOC_DESC)DbgAllocatePool(NonPagedPool, sizeof(MEM_ALLOC_DESC)*(MY_HEAP_MAX_BLOCKS+1));
if(!Allocs) {
KdPrint(("Insufficient resources to allocate frame descriptor\n"));
UDFPrint(("Insufficient resources to allocate frame descriptor\n"));
FrameList[Frame].Frame = NULL;
MyAllocDumpFrames();
BrutePoint();
@ -563,7 +563,7 @@ MyAllocInitFrame(
// alloc heap
Allocs[0].Addr = (ULONG)DbgAllocatePool((POOL_TYPE)Type, MY_HEAP_FRAME_SIZE);
if(!Allocs[0].Addr) {
KdPrint(("Insufficient resources to allocate frame\n"));
UDFPrint(("Insufficient resources to allocate frame\n"));
DbgFreePool(Allocs);
FrameList[Frame].Frame = NULL;
MyAllocDumpFrames();
@ -625,7 +625,7 @@ MyAllocatePool(
ULONG i;
ULONG addr;
// KdPrint(("MemFrames: %x\n",FrameCount));
// UDFPrint(("MemFrames: %x\n",FrameCount));
if(!size || (size > MY_HEAP_FRAME_SIZE)) return NULL;
@ -650,8 +650,8 @@ MyAllocatePool(
#ifdef UDF_DBG
// if(addr >= (ULONG)BreakAddr && addr < sizeof(UDF_FILE_INFO) + (ULONG)BreakAddr) {
// if(addr<=(ULONG)BreakAddr && addr+sizeof(UDF_FILE_INFO) > (ULONG)BreakAddr) {
// KdPrint(("ERROR !!! Allocating in examined block\n"));
// KdPrint(("addr %x\n", addr));
// UDFPrint(("ERROR !!! Allocating in examined block\n"));
// UDFPrint(("addr %x\n", addr));
// MyAllocDumpFrame(i);
// BrutePoint();
// }
@ -683,8 +683,8 @@ MyAllocatePool(
#ifdef UDF_DBG
// if(addr >= (ULONG)BreakAddr && addr < sizeof(UDF_FILE_INFO) + (ULONG)BreakAddr) {
// if(addr<=(ULONG)BreakAddr && addr+sizeof(UDF_FILE_INFO) > (ULONG)BreakAddr) {
// KdPrint(("ERROR !!! Allocating in examined block\n"));
// KdPrint(("addr %x\n", addr));
// UDFPrint(("ERROR !!! Allocating in examined block\n"));
// UDFPrint(("addr %x\n", addr));
// MyAllocDumpFrame(i);
// BrutePoint();
// }
@ -730,13 +730,13 @@ MyFreePool(
{
LONG i;
// KdPrint(("MemFrames: %x\n",FrameCount));
// UDFPrint(("MemFrames: %x\n",FrameCount));
LockMemoryManager();
i = MyFindFrameByAddr(addr);
if(i < 0) {
UnlockMemoryManager();
KdPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!! ;( \n", addr));
UDFPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!! ;( \n", addr));
BrutePoint();
return;
}
@ -744,8 +744,8 @@ MyFreePool(
#ifdef UDF_DBG
// BreakAddr <= addr < BreakAddr + sizeof(UDF_FILE_INFO)
// if((ULONG)addr >= (ULONG)BreakAddr && (ULONG)addr < sizeof(UDF_FILE_INFO) + (ULONG)BreakAddr) {
// KdPrint(("Deallocating in examined block\n"));
// KdPrint(("addr %x\n", addr));
// UDFPrint(("Deallocating in examined block\n"));
// UDFPrint(("addr %x\n", addr));
// MyAllocDumpFrame(i);
// BrutePoint();
// BreakAddr = NULL;
@ -786,7 +786,7 @@ MyReallocPool(
PCHAR Tag;
#endif
// KdPrint(("MemFrames: %x\n",FrameCount));
// UDFPrint(("MemFrames: %x\n",FrameCount));
(*NewBuff) = addr;
if(OldLength == NewLength) return OldLength;
@ -799,7 +799,7 @@ MyReallocPool(
i = MyFindFrameByAddr(addr);
if(i < 0) {
UnlockMemoryManager();
KdPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!! ;( \n", addr));
UDFPrint(("Mem: <<<*** WARNING ***>>> Double deallocation at %x !!! ;( \n", addr));
BrutePoint();
return 0;
}
@ -864,7 +864,7 @@ MyFindMemDescByRangeInFrame(
Allocs = FrameList[Frame].Frame;
// i = FrameList[Frame].LastUsed >> 1;
// KdPrint(("Mem: Freeing %x\n", (ULONG)addr)); DEADDA7A
// UDFPrint(("Mem: Freeing %x\n", (ULONG)addr)); DEADDA7A
// for(i=0;i<MY_HEAP_MAX_BLOCKS;i++) {
left = 0;
right = FrameList[Frame].LastUsed;
@ -907,7 +907,7 @@ MyFindMemBaseByAddr(
Frame = MyFindFrameByAddr(addr);
if(Frame < 0) {
UnlockMemoryManager();
KdPrint(("Mem: <<<*** WARNING ***>>> Unknown base for %x !!! ;( \n", addr));
UDFPrint(("Mem: <<<*** WARNING ***>>> Unknown base for %x !!! ;( \n", addr));
BrutePoint();
return -1;
}

View file

@ -27,7 +27,7 @@ UDFClrModified(
IN PVCB Vcb
)
{
KdPrint(("ClrModified\n"));
UDFPrint(("ClrModified\n"));
UDFInterlockedDecrement((PLONG)&(Vcb->Modified));
} // end UDFClrModified()

File diff suppressed because it is too large Load diff

View file

@ -19,7 +19,7 @@ RegTGetKeyHandle(
UNICODE_STRING NameString;
NTSTATUS status;
//KdPrint(("RegTGetKeyHandle: h=%x, %S\n", hRootKey, KeyName));
//UDFPrint(("RegTGetKeyHandle: h=%x, %S\n", hRootKey, KeyName));
RtlInitUnicodeString(&NameString, KeyName);
@ -38,7 +38,7 @@ RegTGetKeyHandle(
);
if(!NT_SUCCESS(status)) {
//KdPrint((" status %x\n", status));
//UDFPrint((" status %x\n", status));
*hKey = NULL;
}
@ -135,7 +135,7 @@ RegTGetDwordValue(
#ifndef WIN_32_MODE
/*
KdPrint(("h=%x|%S, %S (%x)\n",
UDFPrint(("h=%x|%S, %S (%x)\n",
hRootKey, RegistryPath, Name, *pUlong));
*/
len = sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(ULONG) + 0x20;
@ -160,9 +160,9 @@ RegTGetDwordValue(
ValInfo->DataLength == sizeof(ULONG)) {
RtlCopyMemory(pUlong, ValInfo->Data, sizeof(ULONG));
retval = TRUE;
//KdPrint((" -> %x\n",*pUlong));
//UDFPrint((" -> %x\n",*pUlong));
} else {
//KdPrint((" err %x\n",status));
//UDFPrint((" err %x\n",status));
}
MyFreePool__(ValInfo);

View file

@ -58,7 +58,7 @@ OSSTATUS __fastcall WCacheDecodeFlags(IN PW_CACHE Cache,
#define USE_WC_PRINT
#ifdef USE_WC_PRINT
#define WcPrint KdPrint
#define WcPrint UDFPrint
#else
#define WcPrint(x) {;}
#endif
@ -182,41 +182,41 @@ WCacheInit__(
_SEH2_TRY {
// check input parameters
if(Mode == WCACHE_MODE_R) {
KdPrint(("Disable Async-Write for WORM media\n"));
UDFPrint(("Disable Async-Write for WORM media\n"));
WriteProcAsync = NULL;
}
if((MaxBlocks % PacketSize) || !MaxBlocks) {
KdPrint(("Total number of sectors must be packet-size-aligned\n"));
UDFPrint(("Total number of sectors must be packet-size-aligned\n"));
try_return(RC = STATUS_INVALID_PARAMETER);
}
if(BlocksPerFrame % PacketSize) {
KdPrint(("Number of sectors per Frame must be packet-size-aligned\n"));
UDFPrint(("Number of sectors per Frame must be packet-size-aligned\n"));
try_return(RC = STATUS_INVALID_PARAMETER);
}
if(!ReadProc) {
KdPrint(("Read routine pointer must be valid\n"));
UDFPrint(("Read routine pointer must be valid\n"));
try_return(RC = STATUS_INVALID_PARAMETER);
}
if(FirstLba >= LastLba) {
KdPrint(("Invalid cached area parameters: (%x - %x)\n",FirstLba, LastLba));
UDFPrint(("Invalid cached area parameters: (%x - %x)\n",FirstLba, LastLba));
try_return(RC = STATUS_INVALID_PARAMETER);
}
if(!MaxFrames) {
KdPrint(("Total frame number must be non-zero\n",FirstLba, LastLba));
UDFPrint(("Total frame number must be non-zero\n",FirstLba, LastLba));
try_return(RC = STATUS_INVALID_PARAMETER);
}
if(Mode > WCACHE_MODE_MAX) {
KdPrint(("Invalid media mode. Should be 0-%x\n",WCACHE_MODE_MAX));
UDFPrint(("Invalid media mode. Should be 0-%x\n",WCACHE_MODE_MAX));
try_return(RC = STATUS_INVALID_PARAMETER);
}
if(FramesToKeepFree >= MaxFrames/2) {
KdPrint(("Invalid FramesToKeepFree (%x). Should be Less or equal to MaxFrames/2 (%x)\n", FramesToKeepFree, MaxFrames/2));
UDFPrint(("Invalid FramesToKeepFree (%x). Should be Less or equal to MaxFrames/2 (%x)\n", FramesToKeepFree, MaxFrames/2));
try_return(RC = STATUS_INVALID_PARAMETER);
}
// check 'features'
if(!WriteProc) {
KdPrint(("Write routine not specified\n"));
KdPrint(("Read-only mode enabled\n"));
UDFPrint(("Write routine not specified\n"));
UDFPrint(("Read-only mode enabled\n"));
}
MaxBlocks = max(MaxBlocks, BlocksPerFrame*3);
// initialize required structures
@ -224,22 +224,22 @@ WCacheInit__(
// avoid system crashes caused by pool fragmentation
if(!(Cache->FrameList =
(PW_CACHE_FRAME)MyAllocatePoolTag__(NonPagedPool, l1 = (((LastLba >> BlocksPerFrameSh)+1)*sizeof(W_CACHE_FRAME)), MEM_WCFRM_TAG) )) {
KdPrint(("Cache init err 1\n"));
UDFPrint(("Cache init err 1\n"));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
if(!(Cache->CachedBlocksList =
(PULONG)MyAllocatePoolTag__(NonPagedPool, l2 = ((MaxBlocks+2)*sizeof(lba_t)), MEM_WCFRM_TAG) )) {
KdPrint(("Cache init err 2\n"));
UDFPrint(("Cache init err 2\n"));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
if(!(Cache->CachedModifiedBlocksList =
(PULONG)MyAllocatePoolTag__(NonPagedPool, l2, MEM_WCFRM_TAG) )) {
KdPrint(("Cache init err 3\n"));
UDFPrint(("Cache init err 3\n"));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
if(!(Cache->CachedFramesList =
(PULONG)MyAllocatePoolTag__(NonPagedPool, l3 = ((MaxFrames+2)*sizeof(lba_t)), MEM_WCFRM_TAG) )) {
KdPrint(("Cache init err 4\n"));
UDFPrint(("Cache init err 4\n"));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
RtlZeroMemory(Cache->FrameList, l1);
@ -278,21 +278,21 @@ WCacheInit__(
// init permanent tmp buffers
if(!(Cache->tmp_buff =
(PCHAR)MyAllocatePoolTag__(NonPagedPool, PacketSize*BlockSize, MEM_WCFRM_TAG))) {
KdPrint(("Cache init err 5.W\n"));
UDFPrint(("Cache init err 5.W\n"));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
if(!(Cache->tmp_buff_r =
(PCHAR)MyAllocatePoolTag__(NonPagedPool, PacketSize*BlockSize, MEM_WCFRM_TAG))) {
KdPrint(("Cache init err 5.R\n"));
UDFPrint(("Cache init err 5.R\n"));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
if(!(Cache->reloc_tab =
(PULONG)MyAllocatePoolTag__(NonPagedPool, Cache->PacketSize*sizeof(ULONG), MEM_WCFRM_TAG))) {
KdPrint(("Cache init err 6\n"));
UDFPrint(("Cache init err 6\n"));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
if(!OS_SUCCESS(RC = ExInitializeResourceLite(&(Cache->WCacheLock)))) {
KdPrint(("Cache init err (res)\n"));
UDFPrint(("Cache init err (res)\n"));
try_return(RC);
}
res_init_flags |= WCLOCK_RES;
@ -1402,7 +1402,7 @@ Try_Another_Frame:
if(!Cache->FrameCount || !Cache->BlockCount) {
//ASSERT(!Cache->FrameCount);
if(Cache->FrameCount) {
KdPrint(("ASSERT: Cache->FrameCount = %d, when 0 is expected\n", Cache->FrameCount));
UDFPrint(("ASSERT: Cache->FrameCount = %d, when 0 is expected\n", Cache->FrameCount));
}
ASSERT(!Cache->BlockCount);
if(!Cache->FrameCount)
@ -1435,7 +1435,7 @@ Try_Another_Frame:
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
KdPrint(("Hmm...\n"));
UDFPrint(("Hmm...\n"));
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
@ -1701,7 +1701,7 @@ Try_Another_Frame:
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
KdPrint(("Hmm...\n"));
UDFPrint(("Hmm...\n"));
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
@ -1784,7 +1784,7 @@ WCachePurgeAllRAM(
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
KdPrint(("Hmm...\n"));
UDFPrint(("Hmm...\n"));
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
@ -1832,7 +1832,7 @@ WCacheFlushAllRAM(
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
KdPrint(("Hmm...\n"));
UDFPrint(("Hmm...\n"));
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
@ -2172,7 +2172,7 @@ WCacheReadBlocks__(
*ReadBytes += BS*n;
}
// } else {
// KdPrint(("Unaligned\n"));
// UDFPrint(("Unaligned\n"));
}
// read non-cached extent (if any)
// firstable, we'll get total number of sectors to read
@ -2309,7 +2309,7 @@ WCacheWriteBlocks__(
WcPrint(("WC:W %x (%x)\n", Lba, BCount));
*WrittenBytes = 0;
// KdPrint(("BCount:%x\n",BCount));
// UDFPrint(("BCount:%x\n",BCount));
// check if we try to read too much data
if(BCount >= Cache->MaxBlocks) {
i = 0;
@ -2318,7 +2318,7 @@ WCacheWriteBlocks__(
goto EO_WCache_W2;
}
while(TRUE) {
// KdPrint((" BCount:%x\n",BCount));
// UDFPrint((" BCount:%x\n",BCount));
status = WCacheWriteBlocks__(Cache, Context, Buffer + (i<<BSh), Lba, min(PS,BCount), &_WrittenBytes, FALSE);
(*WrittenBytes) += _WrittenBytes;
BCount -= PS;
@ -2387,7 +2387,7 @@ WCacheWriteBlocks__(
}
Cache->FrameList[frame].UpdateCount++;
// KdPrint((" BCount:%x\n",BCount));
// UDFPrint((" BCount:%x\n",BCount));
while(BCount) {
if(i >= Cache->BlocksPerFrame) {
frame++;
@ -2407,7 +2407,7 @@ WCacheWriteBlocks__(
while(BCount &&
(i < Cache->BlocksPerFrame) &&
(addr = (PCHAR)WCacheSectorAddr(block_array, i)) ) {
// KdPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",addr, Buffer, BS, BCount));
// UDFPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",addr, Buffer, BS, BCount));
block_type = Cache->CheckUsedProc(Context, Lba+saved_BC-BCount);
if(Cache->NoWriteBB &&
/*WCacheGetBadFlag(block_array,i)*/
@ -2434,7 +2434,7 @@ WCacheWriteBlocks__(
status = STATUS_INSUFFICIENT_RESOURCES;
goto EO_WCache_W;
}
// KdPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",block_array[i].Sector, Buffer, BS, BCount));
// UDFPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",block_array[i].Sector, Buffer, BS, BCount));
DbgCopyMemory(block_array[i].Sector, Buffer, BS);
WCacheSetModFlag(block_array, i);
i++;
@ -2495,7 +2495,7 @@ WCacheWriteBlocks__(
status = STATUS_INSUFFICIENT_RESOURCES;
goto EO_WCache_W;
}
// KdPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",block_array[i].Sector, Buffer, BS, BCount));
// UDFPrint(("addr:%x:Buffer:%x:BS:%x:BCount:%x\n",block_array[i].Sector, Buffer, BS, BCount));
DbgCopyMemory(block_array[i].Sector, Buffer, BS);
WCacheSetModFlag(block_array, i);
i++;
@ -2910,7 +2910,7 @@ WCacheFlushBlocks__(
// check if we try to access beyond cached area
if((Lba < Cache->FirstLba) ||
(Lba+BCount-1 > Cache->LastLba)) {
KdPrint(("LBA %#x (%x) is beyond cacheable area\n", Lba, BCount));
UDFPrint(("LBA %#x (%x) is beyond cacheable area\n", Lba, BCount));
BrutePoint();
status = STATUS_INVALID_PARAMETER;
goto EO_WCache_F;
@ -2972,7 +2972,7 @@ WCacheDirect__(
// check if we try to access beyond cached area
if((Lba < Cache->FirstLba) ||
(Lba > Cache->LastLba)) {
KdPrint(("LBA %#x is beyond cacheable area\n", Lba));
UDFPrint(("LBA %#x is beyond cacheable area\n", Lba));
BrutePoint();
status = STATUS_INVALID_PARAMETER;
goto EO_WCache_D;
@ -3057,7 +3057,7 @@ WCacheDirect__(
ASSERT(block_type & WCACHE_BLOCK_USED);
#else
if(!(block_type & WCACHE_BLOCK_USED)) {
KdPrint(("LBA %#x is not marked as used\n", Lba));
UDFPrint(("LBA %#x is not marked as used\n", Lba));
}
#endif
if(Modified &&
@ -3533,7 +3533,7 @@ WCacheDiscardBlocks__(
ExAcquireResourceExclusiveLite(&(Cache->WCacheLock), TRUE);
KdPrint((" Discard req: %x@%x\n",BCount, ReqLba));
UDFPrint((" Discard req: %x@%x\n",BCount, ReqLba));
List = Cache->CachedBlocksList;
if(!List) {
@ -3609,7 +3609,7 @@ WCacheDecodeFlags(
{
//ULONG OldFlags;
if(Flags & ~WCACHE_VALID_FLAGS) {
KdPrint(("Invalid flags: %x\n", Flags & ~WCACHE_VALID_FLAGS));
UDFPrint(("Invalid flags: %x\n", Flags & ~WCACHE_VALID_FLAGS));
return STATUS_INVALID_PARAMETER;
}
Cache->CacheWholePacket = (Flags & WCACHE_CACHE_WHOLE_PACKET) ? TRUE : FALSE;

View file

@ -63,7 +63,7 @@ UDFCleanup(
Irp->IoStatus.Information = 0;
if(UDFGlobalData.AutoFormatCount == IoGetCurrentIrpStackLocation(Irp)->FileObject) {
KdPrint(("Deregister Autoformat\n"));
UDFPrint(("Deregister Autoformat\n"));
UDFGlobalData.AutoFormatCount = NULL;
}

View file

@ -567,7 +567,7 @@ UDFCleanUpFcbChain(
NtReqFcb->CommonFCBHeader.Resource =
NtReqFcb->CommonFCBHeader.PagingIoResource = NULL;
UDFDeassignAcl(NtReqFcb, AutoInherited);
KdPrint(("UDFReleaseNtReqFCB: %x\n", NtReqFcb));
UDFPrint(("UDFReleaseNtReqFCB: %x\n", NtReqFcb));
#ifdef DBG
// NtReqFcb->FileObject->FsContext2 = NULL;
// ASSERT(NtReqFcb->FileObject);
@ -816,7 +816,7 @@ UDFBuildTreeItemsList(
PUDF_FILE_INFO SDirInfo;
ULONG i;
KdPrint((" UDFBuildTreeItemsList():\n"));
UDFPrint((" UDFBuildTreeItemsList():\n"));
if(!(*PassedList) || !(*FoundList)) {
(*PassedList) = (PUDF_FILE_INFO*)
@ -935,7 +935,7 @@ UDFCloseAllXXXDelayedInDir(
_SEH2_TRY {
KdPrint((" UDFCloseAllXXXDelayedInDir(): Acquire DelayedCloseResource\n"));
UDFPrint((" UDFCloseAllXXXDelayedInDir(): Acquire DelayedCloseResource\n"));
// Acquire DelayedCloseResource
UDFAcquireResourceExclusive(&(UDFGlobalData.DelayedCloseResource), TRUE);
ResAcq = TRUE;
@ -948,7 +948,7 @@ UDFCloseAllXXXDelayedInDir(
&PassedList, &PassedListSize, &FoundList, &FoundListSize);
if(!NT_SUCCESS(RC)) {
KdPrint((" UDFBuildTreeItemsList(): error %x\n", RC));
UDFPrint((" UDFBuildTreeItemsList(): error %x\n", RC));
try_return(RC);
}
@ -959,7 +959,7 @@ UDFCloseAllXXXDelayedInDir(
// build array of referenced pointers
ListPtrArray = (PFE_LIST_ENTRY*)(MyAllocatePool__(NonPagedPool, FoundListSize*sizeof(PFE_LIST_ENTRY)));
if(!ListPtrArray) {
KdPrint((" Can't alloc ListPtrArray for %x items\n", FoundListSize));
UDFPrint((" Can't alloc ListPtrArray for %x items\n", FoundListSize));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
@ -971,7 +971,7 @@ UDFCloseAllXXXDelayedInDir(
if(!CurFileInfo->ListPtr) {
CurFileInfo->ListPtr = (PFE_LIST_ENTRY)(MyAllocatePool__(NonPagedPool, sizeof(FE_LIST_ENTRY)));
if(!CurFileInfo->ListPtr) {
KdPrint((" Can't alloc ListPtrEntry for items %x\n", i));
UDFPrint((" Can't alloc ListPtrEntry for items %x\n", i));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
CurFileInfo->ListPtr->FileInfo = CurFileInfo;

View file

@ -584,7 +584,7 @@ UDFCommonCreate(
}
#endif //UDF_READ_ONLY_BUILD
KdPrint((" ShareAccess %x, DesiredAccess %x\n", ShareAccess, DesiredAccess));
UDFPrint((" ShareAccess %x, DesiredAccess %x\n", ShareAccess, DesiredAccess));
/*
if(!(ShareAccess & (FILE_SHARE_WRITE | FILE_SHARE_DELETE)) &&
!(DesiredAccess & (FILE_GENERIC_WRITE & ~SYNCHRONIZE)) &&
@ -592,12 +592,12 @@ UDFCommonCreate(
*/
if(!(DesiredAccess & ((GENERIC_WRITE | FILE_GENERIC_WRITE) & ~(SYNCHRONIZE | READ_CONTROL))) &&
(ShareAccess & FILE_SHARE_READ) ) {
KdPrint((" R/O volume open\n"));
UDFPrint((" R/O volume open\n"));
} else {
KdPrint((" R/W volume open\n"));
UDFPrint((" R/W volume open\n"));
if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) {
KdPrint((" media-ro\n"));
UDFPrint((" media-ro\n"));
try_return(RC = STATUS_MEDIA_WRITE_PROTECTED);
}
}
@ -613,7 +613,7 @@ UDFCommonCreate(
// As soon as OpenVolume flushes the volume
// we should complete all pending requests (Close)
KdPrint((" set UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
UDFPrint((" set UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
PtrIrpContext->IrpContextFlags |= UDF_IRP_CONTEXT_FLUSH2_REQUIRED;
/*
@ -642,12 +642,12 @@ UDFCommonCreate(
if ((Vcb->VCBHandleCount) &&
!(ShareAccess & FILE_SHARE_READ)) {
// Sharing violation
KdPrint((" !FILE_SHARE_READ + open handles (%d)\n", Vcb->VCBHandleCount));
UDFPrint((" !FILE_SHARE_READ + open handles (%d)\n", Vcb->VCBHandleCount));
try_return(RC = STATUS_SHARING_VIOLATION);
}
if(PtrIrpContext->IrpContextFlags & UDF_IRP_CONTEXT_FLUSH2_REQUIRED) {
KdPrint((" perform flush\n"));
UDFPrint((" perform flush\n"));
PtrIrpContext->IrpContextFlags &= ~UDF_IRP_CONTEXT_FLUSH2_REQUIRED;
UDFInterlockedIncrement((PLONG)&(Vcb->VCBOpenCount));
@ -669,7 +669,7 @@ UDFCommonCreate(
if((ShareAccess & FILE_SHARE_READ) &&
((Vcb->VCBOpenCount - UDF_RESIDUAL_REFERENCE) != (Vcb->VCBOpenCountRO))) {
KdPrint((" FILE_SHARE_READ + R/W handles: %d(%d) -> STATUS_SHARING_VIOLATION ?\n",
UDFPrint((" FILE_SHARE_READ + R/W handles: %d(%d) -> STATUS_SHARING_VIOLATION ?\n",
Vcb->VCBOpenCount - UDF_RESIDUAL_REFERENCE,
Vcb->VCBOpenCountRO));
/* we shall not check it here, let System do it in IoCheckShareAccess() */
@ -678,13 +678,13 @@ UDFCommonCreate(
}
// Lock the volume
if(!(ShareAccess & FILE_SHARE_READ)) {
KdPrint((" set Lock\n"));
UDFPrint((" set Lock\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_LOCKED;
Vcb->VolumeLockFileObject = PtrNewFileObject;
UndoLock = TRUE;
} else
if(DesiredAccess & ((GENERIC_WRITE | FILE_GENERIC_WRITE) & ~(SYNCHRONIZE | READ_CONTROL))) {
KdPrint((" set UDF_IRP_CONTEXT_FLUSH_REQUIRED\n"));
UDFPrint((" set UDF_IRP_CONTEXT_FLUSH_REQUIRED\n"));
PtrIrpContext->IrpContextFlags |= UDF_IRP_CONTEXT_FLUSH_REQUIRED;
}
}
@ -765,7 +765,7 @@ op_vol_accs_dnd:
PUNICODE_STRING TmpPath;
LONGLONG Id;
KdPrint((" open by File ID\n"));
UDFPrint((" open by File ID\n"));
if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
ReturnedInformation = 0;
AdPrint((" Can't open by FileID on blank volume ;)\n"));
@ -809,7 +809,7 @@ op_vol_accs_dnd:
// This implies a "relative" open i.e. relative to the directory
// represented by the related file object ...
KdPrint((" PtrRelatedFileObject %x, FCB %x\n", PtrRelatedFileObject, PtrRelatedFCB));
UDFPrint((" PtrRelatedFileObject %x, FCB %x\n", PtrRelatedFileObject, PtrRelatedFCB));
// Note: The only purpose FSD implementations ever have for
// the related file object is to determine whether this
// is a relative open or not. At all other times (including
@ -880,7 +880,7 @@ op_vol_accs_dnd:
// ****************
// The suplied path-name must be an absolute path-name i.e.
// starting at the root of the file system tree
KdPrint((" Absolute open\n"));
UDFPrint((" Absolute open\n"));
ASSERT(TargetObjectName.Buffer);
if (!TargetObjectName.Length || TargetObjectName.Buffer[0] != L'\\') {
AdPrint((" Wrong target name (1)\n"));
@ -2325,7 +2325,7 @@ UDFFirstOpenFile(
(PtrUDFNTRequiredFCB)MyAllocatePool__(NonPagedPool, UDFQuadAlign(sizeof(UDFNTRequiredFCB))) ) )
return STATUS_INSUFFICIENT_RESOURCES;
KdPrint(("UDFAllocateNtReqFCB: %x\n", (*PtrNewFcb)->NTRequiredFCB));
UDFPrint(("UDFAllocateNtReqFCB: %x\n", (*PtrNewFcb)->NTRequiredFCB));
RtlZeroMemory((*PtrNewFcb)->NTRequiredFCB, UDFQuadAlign(sizeof(UDFNTRequiredFCB)));
(*PtrNewFcb)->FileInfo->Dloc->CommonFcb = (*PtrNewFcb)->NTRequiredFCB;
Linked = FALSE;

View file

@ -171,7 +171,7 @@ UDFCommonDeviceControl(
PCHAR CdbData;
PCHAR ModeSelectData;
KdPrint(("UDFCommonDeviceControl\n"));
UDFPrint(("UDFCommonDeviceControl\n"));
_SEH2_TRY {
// First, get a pointer to the current I/O stack location
@ -197,14 +197,14 @@ UDFCommonDeviceControl(
case IOCTL_UDF_REGISTER_AUTOFORMAT:
break;
default:
KdPrint(("UDFCommonDeviceControl: STATUS_INVALID_PARAMETER %x for FsDevObj\n", IoControlCode));
UDFPrint(("UDFCommonDeviceControl: STATUS_INVALID_PARAMETER %x for FsDevObj\n", IoControlCode));
CompleteIrp = TRUE;
try_return(RC = STATUS_INVALID_PARAMETER);
}
} else {
Ccb = (PtrUDFCCB)(FileObject->FsContext2);
if(!Ccb) {
KdPrint((" !Ccb\n"));
UDFPrint((" !Ccb\n"));
goto ioctl_do_default;
}
ASSERT(Ccb);
@ -225,7 +225,7 @@ UDFCommonDeviceControl(
case IOCTL_UDF_SET_FILE_ALLOCATION_MODE:
break;
default:
KdPrint(("UDFCommonDeviceControl: STATUS_INVALID_PARAMETER %x for File/Dir Obj\n", IoControlCode));
UDFPrint(("UDFCommonDeviceControl: STATUS_INVALID_PARAMETER %x for File/Dir Obj\n", IoControlCode));
try_return(RC = STATUS_INVALID_PARAMETER);
}
}
@ -323,7 +323,7 @@ UDFCommonDeviceControl(
AcquiredVcb = TRUE;
}
KdPrint(("UDF Irp %x, ctx %x, DevIoCtl %x\n", Irp, PtrIrpContext, IoControlCode));
UDFPrint(("UDF Irp %x, ctx %x, DevIoCtl %x\n", Irp, PtrIrpContext, IoControlCode));
// We may wish to allow only volume open operations.
switch (IoControlCode) {
@ -349,7 +349,7 @@ UDFCommonDeviceControl(
ScsiCommand = Cdb->CDB6.OperationCode;
if(ScsiCommand == SCSIOP_WRITE_CD) {
KdPrint(("Write10, LBA %2.2x%2.2x%2.2x%2.2x\n",
UDFPrint(("Write10, LBA %2.2x%2.2x%2.2x%2.2x\n",
Cdb->WRITE_CD.LBA[0],
Cdb->WRITE_CD.LBA[1],
Cdb->WRITE_CD.LBA[2],
@ -357,7 +357,7 @@ UDFCommonDeviceControl(
));
} else
if(ScsiCommand == SCSIOP_WRITE12) {
KdPrint(("Write12, LBA %2.2x%2.2x%2.2x%2.2x\n",
UDFPrint(("Write12, LBA %2.2x%2.2x%2.2x%2.2x\n",
Cdb->CDB12READWRITE.LBA[0],
Cdb->CDB12READWRITE.LBA[1],
Cdb->CDB12READWRITE.LBA[2],
@ -374,7 +374,7 @@ UDFCommonDeviceControl(
case MODE_PAGE_MRW2:
case MODE_PAGE_WRITE_PARAMS:
case MODE_PAGE_MRW:
KdPrint(("Unsafe MODE_SELECT_6 via pass-through (%2.2x)\n", ModeSelectData[0]));
UDFPrint(("Unsafe MODE_SELECT_6 via pass-through (%2.2x)\n", ModeSelectData[0]));
goto unsafe_direct_scsi_cmd;
}
break; }
@ -386,7 +386,7 @@ UDFCommonDeviceControl(
case MODE_PAGE_MRW2:
case MODE_PAGE_WRITE_PARAMS:
case MODE_PAGE_MRW:
KdPrint(("Unsafe MODE_SELECT_10 via pass-through (%2.2x)\n", ModeSelectData[0]));
UDFPrint(("Unsafe MODE_SELECT_10 via pass-through (%2.2x)\n", ModeSelectData[0]));
goto unsafe_direct_scsi_cmd;
}
break; }
@ -401,12 +401,12 @@ UDFCommonDeviceControl(
case SCSIOP_BLANK:
case SCSIOP_WRITE12:
case SCSIOP_SET_STREAMING:
KdPrint(("UDF Direct media modification via pass-through (%2.2x)\n", ScsiCommand));
UDFPrint(("UDF Direct media modification via pass-through (%2.2x)\n", ScsiCommand));
unsafe_direct_scsi_cmd:
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED))
goto ioctl_do_default;
KdPrint(("Forget this volume\n"));
UDFPrint(("Forget this volume\n"));
// Acquire Vcb resource (Shared -> Exclusive)
UDFInterlockedIncrement((PLONG)&(Vcb->VCBOpenCount));
UDFReleaseResource(&(Vcb->VCBResource));
@ -447,7 +447,7 @@ unsafe_direct_scsi_cmd:
// some CD-recording libraries
Vcb->SerialNumber--;
KdPrint(("Forgotten\n"));
UDFPrint(("Forgotten\n"));
goto notify_media_change;
@ -455,7 +455,7 @@ unsafe_direct_scsi_cmd:
case SCSIOP_DOORLOCK:
case SCSIOP_DOORUNLOCK:
case SCSIOP_MEDIUM_REMOVAL:
KdPrint(("UDF Medium/Tray control IOCTL via pass-through\n"));
UDFPrint(("UDF Medium/Tray control IOCTL via pass-through\n"));
}
goto ioctl_do_default;
@ -473,7 +473,7 @@ notify_media_change:
case IOCTL_UDF_REGISTER_AUTOFORMAT: {
KdPrint(("UDF Register Autoformat\n"));
UDFPrint(("UDF Register Autoformat\n"));
if(UDFGlobalData.AutoFormatCount) {
RC = STATUS_SHARING_VIOLATION;
} else {
@ -487,7 +487,7 @@ notify_media_change:
case IOCTL_UDF_DISABLE_DRIVER: {
KdPrint(("UDF Disable driver\n"));
UDFPrint(("UDF Disable driver\n"));
IoUnregisterFileSystem(UDFGlobalData.UDFDeviceObject);
// Now, delete any device objects, etc. we may have created
if (UDFGlobalData.UDFDeviceObject) {
@ -513,7 +513,7 @@ notify_media_change:
break;
}
case IOCTL_UDF_INVALIDATE_VOLUMES: {
KdPrint(("UDF Invaidate volume\n"));
UDFPrint(("UDF Invaidate volume\n"));
if(AcquiredVcb) {
UDFReleaseResource(&(Vcb->VCBResource));
AcquiredVcb = FALSE;
@ -594,13 +594,13 @@ notify_media_change:
//case FSCTL_GET_RETRIEVAL_POINTERS
case IOCTL_UDF_GET_RETRIEVAL_POINTERS: {
KdPrint(("UDF: Get Retrieval Pointers\n"));
UDFPrint(("UDF: Get Retrieval Pointers\n"));
RC = UDFGetRetrievalPointers( PtrIrpContext, Irp, 0 );
CompleteIrp = TRUE;
break;
}
case IOCTL_UDF_GET_SPEC_RETRIEVAL_POINTERS: {
KdPrint(("UDF: Get Spec Retrieval Pointers\n"));
UDFPrint(("UDF: Get Spec Retrieval Pointers\n"));
PUDF_GET_SPEC_RETRIEVAL_POINTERS_IN SpecRetrPointer;
SpecRetrPointer = (PUDF_GET_SPEC_RETRIEVAL_POINTERS_IN)(Irp->AssociatedIrp.SystemBuffer);
RC = UDFGetRetrievalPointers( PtrIrpContext, Irp, SpecRetrPointer->Special );
@ -608,14 +608,14 @@ notify_media_change:
break;
}
case IOCTL_UDF_GET_FILE_ALLOCATION_MODE: {
KdPrint(("UDF: Get File Alloc mode (from ICB)\n"));
UDFPrint(("UDF: Get File Alloc mode (from ICB)\n"));
RC = UDFGetFileAllocModeFromICB( PtrIrpContext, Irp );
CompleteIrp = TRUE;
break;
}
#ifndef UDF_READ_ONLY_BUILD
case IOCTL_UDF_SET_FILE_ALLOCATION_MODE: {
KdPrint(("UDF: Set File Alloc mode\n"));
UDFPrint(("UDF: Set File Alloc mode\n"));
RC = UDFSetFileAllocModeFromICB( PtrIrpContext, Irp );
CompleteIrp = TRUE;
break;
@ -650,24 +650,24 @@ notify_media_change:
PUDF_GET_VERSION_OUT udf_ver;
KdPrint(("UDFUserFsCtrlRequest: IOCTL_UDF_GET_VERSION\n"));
UDFPrint(("UDFUserFsCtrlRequest: IOCTL_UDF_GET_VERSION\n"));
Irp->IoStatus.Information = 0;
CompleteIrp = TRUE;
if(!IrpSp->Parameters.DeviceIoControl.OutputBufferLength) {
KdPrint(("!OutputBufferLength\n"));
UDFPrint(("!OutputBufferLength\n"));
try_return(RC = STATUS_SUCCESS);
}
// Check the size of the output buffer.
if(IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(UDF_GET_VERSION_OUT)) {
KdPrint(("OutputBufferLength < %x\n", sizeof(UDF_GET_VERSION_OUT)));
UDFPrint(("OutputBufferLength < %x\n", sizeof(UDF_GET_VERSION_OUT)));
try_return(RC = STATUS_BUFFER_TOO_SMALL);
}
udf_ver = (PUDF_GET_VERSION_OUT)(Irp->AssociatedIrp.SystemBuffer);
if(!udf_ver) {
KdPrint(("!udf_ver\n"));
UDFPrint(("!udf_ver\n"));
try_return(RC = STATUS_INVALID_USER_BUFFER);
}
@ -685,23 +685,23 @@ notify_media_change:
(Vcb->CompatFlags & UDF_VCB_IC_DIRTY_RO))
||
(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) ) {
KdPrint((" UDF_USER_FS_FLAGS_RO\n"));
UDFPrint((" UDF_USER_FS_FLAGS_RO\n"));
udf_ver->FSFlags |= UDF_USER_FS_FLAGS_RO;
}
if(Vcb->VCBFlags & UDF_VCB_FLAGS_OUR_DEVICE_DRIVER) {
KdPrint((" UDF_USER_FS_FLAGS_OUR_DRIVER\n"));
UDFPrint((" UDF_USER_FS_FLAGS_OUR_DRIVER\n"));
udf_ver->FSFlags |= UDF_USER_FS_FLAGS_OUR_DRIVER;
}
if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
KdPrint((" UDF_USER_FS_FLAGS_RAW\n"));
UDFPrint((" UDF_USER_FS_FLAGS_RAW\n"));
udf_ver->FSFlags |= UDF_USER_FS_FLAGS_RAW;
}
if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) {
KdPrint((" UDF_USER_FS_FLAGS_MEDIA_RO\n"));
UDFPrint((" UDF_USER_FS_FLAGS_MEDIA_RO\n"));
udf_ver->FSFlags |= UDF_USER_FS_FLAGS_MEDIA_RO;
}
if(Vcb->FP_disc) {
KdPrint((" UDF_USER_FS_FLAGS_FP\n"));
UDFPrint((" UDF_USER_FS_FLAGS_FP\n"));
udf_ver->FSFlags |= UDF_USER_FS_FLAGS_FP;
}
udf_ver->FSCompatFlags = Vcb->CompatFlags;
@ -718,24 +718,24 @@ notify_media_change:
PUDF_SET_OPTIONS_IN udf_opt;
BOOLEAN PrevVerifyOnWrite;
KdPrint(("UDF: IOCTL_UDF_SET_OPTIONS\n"));
UDFPrint(("UDF: IOCTL_UDF_SET_OPTIONS\n"));
Irp->IoStatus.Information = 0;
CompleteIrp = TRUE;
if(IrpSp->Parameters.DeviceIoControl.InputBufferLength < sizeof(UDF_SET_OPTIONS_IN)) {
KdPrint(("InputBufferLength < %x\n", sizeof(UDF_SET_OPTIONS_IN)));
UDFPrint(("InputBufferLength < %x\n", sizeof(UDF_SET_OPTIONS_IN)));
try_return(RC = STATUS_BUFFER_TOO_SMALL);
}
udf_opt = (PUDF_SET_OPTIONS_IN)(Irp->AssociatedIrp.SystemBuffer);
if(!udf_opt) {
KdPrint(("!udf_opt\n"));
UDFPrint(("!udf_opt\n"));
try_return(RC = STATUS_INVALID_USER_BUFFER);
}
if((udf_opt->header.Flags & UDF_SET_OPTIONS_FLAG_MASK) != UDF_SET_OPTIONS_FLAG_TEMPORARY) {
KdPrint(("invalid opt target\n"));
UDFPrint(("invalid opt target\n"));
try_return(RC = STATUS_INVALID_PARAMETER);
}
@ -772,19 +772,19 @@ notify_media_change:
PUDF_GET_OPTIONS_VERSION_OUT udf_opt_ver;
KdPrint(("UDF: IOCTL_UDF_GET_OPTIONS_VERSION\n"));
UDFPrint(("UDF: IOCTL_UDF_GET_OPTIONS_VERSION\n"));
Irp->IoStatus.Information = 0;
CompleteIrp = TRUE;
if(IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(UDF_GET_OPTIONS_VERSION_OUT)) {
KdPrint(("OutputBufferLength < %x\n", sizeof(UDF_GET_OPTIONS_VERSION_OUT)));
UDFPrint(("OutputBufferLength < %x\n", sizeof(UDF_GET_OPTIONS_VERSION_OUT)));
try_return(RC = STATUS_BUFFER_TOO_SMALL);
}
udf_opt_ver = (PUDF_GET_OPTIONS_VERSION_OUT)(Irp->AssociatedIrp.SystemBuffer);
if(!udf_opt_ver) {
KdPrint(("!udf_opt-ver\n"));
UDFPrint(("!udf_opt-ver\n"));
try_return(RC = STATUS_INVALID_USER_BUFFER);
}
/*
@ -803,14 +803,14 @@ notify_media_change:
#endif //0
case IOCTL_CDRW_RESET_DRIVER:
KdPrint(("UDF: IOCTL_CDRW_RESET_DRIVER\n"));
UDFPrint(("UDF: IOCTL_CDRW_RESET_DRIVER\n"));
Vcb->MediaLockCount = 0;
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_MEDIA_LOCKED;
goto ioctl_do_default;
case FSCTL_ALLOW_EXTENDED_DASD_IO:
KdPrint(("UDFUserFsCtrlRequest: FSCTL_ALLOW_EXTENDED_DASD_IO\n"));
UDFPrint(("UDFUserFsCtrlRequest: FSCTL_ALLOW_EXTENDED_DASD_IO\n"));
// DASD i/o is always permitted
// So, no-op this call
RC = STATUS_SUCCESS;
@ -822,7 +822,7 @@ notify_media_change:
case FSCTL_IS_VOLUME_DIRTY:
KdPrint(("UDFUserFsCtrlRequest: FSCTL_IS_VOLUME_DIRTY\n"));
UDFPrint(("UDFUserFsCtrlRequest: FSCTL_IS_VOLUME_DIRTY\n"));
// DASD i/o is always permitted
// So, no-op this call
RC = UDFIsVolumeDirty(PtrIrpContext, Irp);
@ -833,18 +833,18 @@ notify_media_change:
case IOCTL_DISK_EJECT_MEDIA:
case IOCTL_CDROM_EJECT_MEDIA: {
KdPrint(("UDF Reset/Eject request\n"));
UDFPrint(("UDF Reset/Eject request\n"));
// PPREVENT_MEDIA_REMOVAL_USER_IN Buf;
if(Vcb->EjectWaiter) {
KdPrint((" Vcb->EjectWaiter present\n"));
UDFPrint((" Vcb->EjectWaiter present\n"));
Irp->IoStatus.Information = 0;
Vcb->EjectWaiter->SoftEjectReq = TRUE;
Vcb->SoftEjectReq = TRUE;
CompleteIrp = TRUE;
try_return(RC = STATUS_SUCCESS);
}
KdPrint((" !Vcb->EjectWaiter\n"));
UDFPrint((" !Vcb->EjectWaiter\n"));
goto ioctl_do_default;
/*
Buf = (PPREVENT_MEDIA_REMOVAL_USER_IN)MyAllocatePool__(NonPagedPool, sizeof(PREVENT_MEDIA_REMOVAL_USER_IN));
@ -869,7 +869,7 @@ notify_media_change:
}
case IOCTL_CDROM_DISK_TYPE: {
KdPrint(("UDF Cdrom Disk Type\n"));
UDFPrint(("UDF Cdrom Disk Type\n"));
CompleteIrp = TRUE;
// Verify the Vcb in this case to detect if the volume has changed.
Irp->IoStatus.Information = 0;
@ -900,15 +900,15 @@ notify_media_change:
case IOCTL_STORAGE_MEDIA_REMOVAL:
case IOCTL_DISK_MEDIA_REMOVAL:
case IOCTL_CDROM_MEDIA_REMOVAL: {
KdPrint(("UDF Lock/Unlock\n"));
UDFPrint(("UDF Lock/Unlock\n"));
PPREVENT_MEDIA_REMOVAL_USER_IN buffer; // user supplied buffer
buffer = (PPREVENT_MEDIA_REMOVAL_USER_IN)(Irp->AssociatedIrp.SystemBuffer);
if(!buffer) {
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
KdPrint(("!mounted\n"));
UDFPrint(("!mounted\n"));
goto ioctl_do_default;
}
KdPrint(("abort\n"));
UDFPrint(("abort\n"));
CompleteIrp = TRUE;
Irp->IoStatus.Information = 0;
UnsafeIoctl = FALSE;
@ -918,9 +918,9 @@ notify_media_change:
if(!buffer->PreventMediaRemoval &&
!Vcb->MediaLockCount) {
KdPrint(("!locked + unlock req\n"));
UDFPrint(("!locked + unlock req\n"));
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
KdPrint(("!mounted\n"));
UDFPrint(("!mounted\n"));
goto ioctl_do_default;
}
#if 0
@ -954,40 +954,40 @@ notify_media_change:
// just ignore
#endif
ignore_lock:
KdPrint(("ignore lock/unlock\n"));
UDFPrint(("ignore lock/unlock\n"));
CompleteIrp = TRUE;
Irp->IoStatus.Information = 0;
RC = STATUS_SUCCESS;
break;
}
if(buffer->PreventMediaRemoval) {
KdPrint(("lock req\n"));
UDFPrint(("lock req\n"));
Vcb->MediaLockCount++;
Vcb->VCBFlags |= UDF_VCB_FLAGS_MEDIA_LOCKED;
UnsafeIoctl = FALSE;
} else {
KdPrint(("unlock req\n"));
UDFPrint(("unlock req\n"));
if(Vcb->MediaLockCount) {
KdPrint(("lock count %d\n", Vcb->MediaLockCount));
UDFPrint(("lock count %d\n", Vcb->MediaLockCount));
UnsafeIoctl = FALSE;
Vcb->MediaLockCount--;
}
}
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
KdPrint(("!mounted\n"));
UDFPrint(("!mounted\n"));
goto ioctl_do_default;
}
goto ignore_lock;
}
default:
KdPrint(("default processing Irp %x, ctx %x, DevIoCtl %x\n", Irp, PtrIrpContext, IoControlCode));
UDFPrint(("default processing Irp %x, ctx %x, DevIoCtl %x\n", Irp, PtrIrpContext, IoControlCode));
ioctl_do_default:
// make sure volume is Sync'ed BEFORE sending unsafe IOCTL
if(Vcb && UnsafeIoctl) {
UDFFlushLogicalVolume(NULL, NULL, Vcb, 0);
KdPrint((" sync'ed\n"));
UDFPrint((" sync'ed\n"));
}
// Invoke the lower level driver in the chain.
//PtrNextIoStackLocation = IoGetNextIrpStackLocation(Irp);
@ -1007,7 +1007,7 @@ ioctl_do_default:
}
if(Vcb && UnsafeIoctl) {
KdPrint((" set UnsafeIoctl\n"));
UDFPrint((" set UnsafeIoctl\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_UNSAFE_IOCTL;
}
@ -1026,7 +1026,7 @@ try_exit: NOTHING;
if (!_SEH2_AbnormalTermination() &&
CompleteIrp) {
KdPrint((" complete Irp %x, ctx %x, status %x, iolen %x\n",
UDFPrint((" complete Irp %x, ctx %x, status %x, iolen %x\n",
Irp, PtrIrpContext, RC, Irp->IoStatus.Information));
Irp->IoStatus.Status = RC;
// complete the IRP
@ -1065,9 +1065,9 @@ UDFDevIoctlCompletion(
ULONG IoControlCode = 0;*/
PtrUDFIrpContext PtrIrpContext = (PtrUDFIrpContext)Context;
KdPrint(("UDFDevIoctlCompletion Irp %x, ctx %x\n", Irp, Context));
UDFPrint(("UDFDevIoctlCompletion Irp %x, ctx %x\n", Irp, Context));
if (Irp->PendingReturned) {
KdPrint((" IoMarkIrpPending\n"));
UDFPrint((" IoMarkIrpPending\n"));
IoMarkIrpPending(Irp);
}
@ -1111,7 +1111,7 @@ VOID *BufferPointer)
ULONG LengthOfMatchedName = 0;
WCHAR *NameToBeMatched = RequestBuffer->FilePathName;
KdPrint(("UDFHandleQueryPath\n"));
UDFPrint(("UDFHandleQueryPath\n"));
// So here we are. Simply check the name supplied.
// We can use whatever algorithm we like to determine whether the
// sent in name is acceptable.
@ -1142,7 +1142,7 @@ UDFGetFileAllocModeFromICB(
PtrUDFCCB Ccb;
PUDF_GET_FILE_ALLOCATION_MODE_OUT OutputBuffer;
KdPrint(("UDFGetFileAllocModeFromICB\n"));
UDFPrint(("UDFGetFileAllocModeFromICB\n"));
// Decode the file object, the only type of opens we accept are
// user volume opens.
@ -1181,7 +1181,7 @@ UDFSetFileAllocModeFromICB(
NTSTATUS RC;
UCHAR AllocMode;
KdPrint(("UDFSetFileAllocModeFromICB\n"));
UDFPrint(("UDFSetFileAllocModeFromICB\n"));
Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
Fcb = Ccb->Fcb;

View file

@ -256,7 +256,7 @@ UDFQueryDirectory(
// do some pre-init...
SearchPattern.Buffer = NULL;
KdPrint(("UDFQueryDirectory: @=%#x\n", &PtrIrpContext));
UDFPrint(("UDFQueryDirectory: @=%#x\n", &PtrIrpContext));
#define CanBe8dot3 (FNM_Flags & UDF_FNM_FLAG_CAN_BE_8D3)
#define IgnoreCase (FNM_Flags & UDF_FNM_FLAG_IGNORE_CASE)
@ -589,7 +589,7 @@ try_exit: NOTHING;
} else {
#ifdef UDF_DBG
if(!NT_SUCCESS(RC)) {
KdPrint((" Not found\n"));
UDFPrint((" Not found\n"));
}
#endif // UDF_DBG
// Remember to update the CurrentByteOffset field in the CCB if required.
@ -700,7 +700,7 @@ UDFNotifyChangeDirectory(
BOOLEAN AcquiredFCB = FALSE;
PEXTENDED_IO_STACK_LOCATION pStackLocation = (PEXTENDED_IO_STACK_LOCATION) IrpSp;
KdPrint(("UDFNotifyChangeDirectory\n"));
UDFPrint(("UDFNotifyChangeDirectory\n"));
_SEH2_TRY {

View file

@ -51,7 +51,7 @@ THREAD_REC_BLOCK DLDThreadAcquireChain[DLD_MAX_REC_LEVEL];
VOID DLDInit(ULONG MaxThrdCount /// Maximum supported number of threads
) {
if (KeNumberProcessors>1) {
KdPrint(("Deadlock Detector is designed for uniprocessor machines only!\n"));
UDFPrint(("Deadlock Detector is designed for uniprocessor machines only!\n"));
BrutePoint();
}
DLDpTimeout.QuadPart = -40000000I64;
@ -84,7 +84,7 @@ PTHREAD_STRUCT DLDAllocFindThread(ULONG ThreadId) {
// Not found. Allocate new one.
if (i == MaxThreadCount) {
if (FirstEmpty == -1) {
KdPrint(("Not enough table entries. Try to increase MaxThrdCount on next build"));
UDFPrint(("Not enough table entries. Try to increase MaxThrdCount on next build"));
BrutePoint();
}
i = FirstEmpty;
@ -127,18 +127,18 @@ BOOLEAN DLDProcessThread(PTHREAD_STRUCT ThrdOwner,
if (ThrdOwner == ThrdStruct) {
// ERESOURCE wait cycle. Deadlock detected.
KdPrint(("DLD: *********DEADLOCK DETECTED*********\n"));
KdPrint(("Thread %x holding resource %x\n",ThrdOwner->ThreadId,Resource));
UDFPrint(("DLD: *********DEADLOCK DETECTED*********\n"));
UDFPrint(("Thread %x holding resource %x\n",ThrdOwner->ThreadId,Resource));
return TRUE;
}
for (int i=RecLevel+1;i<DLD_MAX_REC_LEVEL;i++) {
if (DLDThreadAcquireChain[i].Thread->ThreadId == ThrdOwner->ThreadId) {
// ERESOURCE wait cycle. Deadlock detected.
KdPrint(("DLD: *********DEADLOCK DETECTED*********\n"));
KdPrint(("Thread %x holding resource %x\n",ThrdOwner->ThreadId,Resource));
UDFPrint(("DLD: *********DEADLOCK DETECTED*********\n"));
UDFPrint(("Thread %x holding resource %x\n",ThrdOwner->ThreadId,Resource));
for (int j=RecLevel+1;j<=i;j++) {
KdPrint((" awaited by thread %x at (BugCheckId:%x:Line:%d) holding resource %x\n",
UDFPrint((" awaited by thread %x at (BugCheckId:%x:Line:%d) holding resource %x\n",
DLDThreadAcquireChain[i].Thread->ThreadId,
DLDThreadAcquireChain[i].Thread->BugCheckId,
DLDThreadAcquireChain[i].Thread->Line,
@ -154,7 +154,7 @@ BOOLEAN DLDProcessThread(PTHREAD_STRUCT ThrdOwner,
// Find resource, awaited by thread
if (ThrdOwner->WaitingResource) {
if (DLDProcessResource(ThrdOwner->WaitingResource, ThrdStruct,RecLevel)) {
KdPrint((" awaited by thread %x at (BugCheckId:%x:Line:%d) holding resource %x\n",
UDFPrint((" awaited by thread %x at (BugCheckId:%x:Line:%d) holding resource %x\n",
ThrdOwner->ThreadId,
ThrdOwner->BugCheckId,
ThrdOwner->Line,
@ -239,7 +239,7 @@ VOID DLDpWaitForResource(
ResourceWaitCount = 0;
if (DLDProcessResource(Resource, ThrdStruct,DLD_MAX_REC_LEVEL)) {
KdPrint((" which thread %x has tried to acquire at (BugCheckId:%x:Line:%d)\n",
UDFPrint((" which thread %x has tried to acquire at (BugCheckId:%x:Line:%d)\n",
ThrdStruct->ThreadId,
ThrdStruct->BugCheckId,
ThrdStruct->Line

View file

@ -43,7 +43,7 @@ UDFAsyncCompletionRoutine(
IN PVOID Contxt
)
{
KdPrint(("UDFAsyncCompletionRoutine ctx=%x\n", Contxt));
UDFPrint(("UDFAsyncCompletionRoutine ctx=%x\n", Contxt));
PUDF_PH_CALL_CONTEXT Context = (PUDF_PH_CALL_CONTEXT)Contxt;
PMDL Mdl, NextMdl;
@ -85,7 +85,7 @@ UDFSyncCompletionRoutine(
IN PVOID Contxt
)
{
KdPrint(("UDFSyncCompletionRoutine ctx=%x\n", Contxt));
UDFPrint(("UDFSyncCompletionRoutine ctx=%x\n", Contxt));
PUDF_PH_CALL_CONTEXT Context = (PUDF_PH_CALL_CONTEXT)Contxt;
Context->IosbToUse = Irp->IoStatus;
@ -102,7 +102,7 @@ UDFSyncCompletionRoutine2(
IN PVOID Contxt
)
{
KdPrint(("UDFSyncCompletionRoutine2\n"));
UDFPrint(("UDFSyncCompletionRoutine2\n"));
PKEVENT SyncEvent = (PKEVENT)Contxt;
KeSetEvent( SyncEvent, 0, FALSE );
@ -160,8 +160,8 @@ UDFPhReadSynchronous(
KeQuerySystemTime((PLARGE_INTEGER)&IoEnterTime);
#endif //MEASURE_IO_PERFORMANCE
KdPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0xb,Offset>>0xb));
// KdPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0x9,Offset>>0x9));
UDFPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0xb,Offset>>0xb));
// UDFPrint(("UDFPhRead: Length: %x Lba: %lx\n",Length>>0x9,Offset>>0x9));
ROffset.QuadPart = Offset;
(*ReadBytes) = 0;
@ -175,12 +175,12 @@ UDFPhReadSynchronous(
IoBuf = DbgAllocatePoolWithTag(NonPagedPool, Length, 'bNWD');
}
if (!IoBuf) {
KdPrint((" !IoBuf\n"));
UDFPrint((" !IoBuf\n"));
return STATUS_INSUFFICIENT_RESOURCES;
}
Context = (PUDF_PH_CALL_CONTEXT)MyAllocatePool__( NonPagedPool, sizeof(UDF_PH_CALL_CONTEXT) );
if (!Context) {
KdPrint((" !Context\n"));
UDFPrint((" !Context\n"));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
// Create notification event object to be used to signal the request completion.
@ -190,7 +190,7 @@ UDFPhReadSynchronous(
irp = IoBuildAsynchronousFsdRequest(IRP_MJ_READ, DeviceObject, IoBuf,
Length, &ROffset, &(Context->IosbToUse) );
if (!irp) {
KdPrint((" !irp Async\n"));
UDFPrint((" !irp Async\n"));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
MmPrint((" Alloc async Irp MDL=%x, ctx=%x\n", irp->MdlAddress, Context));
@ -200,7 +200,7 @@ UDFPhReadSynchronous(
irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ, DeviceObject, IoBuf,
Length, &ROffset, &(Context->event), &(Context->IosbToUse) );
if (!irp) {
KdPrint((" !irp Sync\n"));
UDFPrint((" !irp Sync\n"));
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
}
MmPrint((" Alloc Irp MDL=%x, ctx=%x\n", irp->MdlAddress, Context));
@ -228,7 +228,7 @@ UDFPhReadSynchronous(
if(NT_SUCCESS(RC)) {
/*
for(i=0; i<(*ReadBytes); i+=2048) {
KdPrint(("IOCRC %8.8x R %x\n", crc32((PUCHAR)Buffer+i, 2048), (ULONG)((Offset+i)/2048) ));
UDFPrint(("IOCRC %8.8x R %x\n", crc32((PUCHAR)Buffer+i, 2048), (ULONG)((Offset+i)/2048) ));
}
*/
#ifdef _BROWSE_UDF_
@ -250,7 +250,7 @@ try_exit: NOTHING;
dtm = (ULONG)(((IoExitTime-IoEnterTime)/10)%1000);
PerfPrint(("\nUDFPhReadSynchronous() exit: %08X, after %d.%4.4d msec.\n", RC, dt, dtm));
#else
KdPrint(("UDFPhReadSynchronous() exit: %08X\n", RC));
UDFPrint(("UDFPhReadSynchronous() exit: %08X\n", RC));
#endif //MEASURE_IO_PERFORMANCE
return(RC);
@ -311,7 +311,7 @@ UDFPhWriteSynchronous(
ULONG Lba = (ULONG)(Offset>>0xb);
// ASSERT(!(Lba & (32-1)));
PerfPrint(("UDFPhWrite: Length: %x Lba: %lx\n",Length>>0xb,Lba));
// KdPrint(("UDFPhWrite: Length: %x Lba: %lx\n",Length>>0x9,Offset>>0x9));
// UDFPrint(("UDFPhWrite: Length: %x Lba: %lx\n",Length>>0x9,Offset>>0x9));
#endif //DBG
#ifdef DBG
@ -367,7 +367,7 @@ UDFPhWriteSynchronous(
RC = IoCallDriver(DeviceObject, irp);
/*
for(i=0; i<Length; i+=2048) {
KdPrint(("IOCRC %8.8x W %x\n", crc32((PUCHAR)Buffer+i, 2048), (ULONG)((Offset+i)/2048) ));
UDFPrint(("IOCRC %8.8x W %x\n", crc32((PUCHAR)Buffer+i, 2048), (ULONG)((Offset+i)/2048) ));
}
*/
#ifdef _BROWSE_UDF_
@ -395,7 +395,7 @@ try_exit: NOTHING;
// if(IoBuf) ExFreePool(IoBuf);
// if(IoBuf && !(Flags & PH_TMP_BUFFER)) DbgFreePool(IoBuf);
if(!NT_SUCCESS(RC)) {
KdPrint(("WriteError\n"));
UDFPrint(("WriteError\n"));
}
#ifdef MEASURE_IO_PERFORMANCE
@ -411,7 +411,7 @@ try_exit: NOTHING;
dtm = (ULONG)(((IoExitTime-IoEnterTime)/10)%1000);
PerfPrint(("\nUDFPhWriteSynchronous() exit: %08X, after %d.%4.4d msec.\n", RC, dt, dtm));
#else
KdPrint(("nUDFPhWriteSynchronous() exit: %08X\n", RC));
UDFPrint(("nUDFPhWriteSynchronous() exit: %08X\n", RC));
#endif //MEASURE_IO_PERFORMANCE
return(RC);
@ -524,7 +524,7 @@ UDFPhSendIOCTL(
PUDF_PH_CALL_CONTEXT Context;
LARGE_INTEGER timeout;
KdPrint(("UDFPhDevIOCTL: Code %8x \n",IoControlCode));
UDFPrint(("UDFPhDevIOCTL: Code %8x \n",IoControlCode));
Context = (PUDF_PH_CALL_CONTEXT)MyAllocatePool__( NonPagedPool, sizeof(UDF_PH_CALL_CONTEXT) );
if (!Context) return STATUS_INSUFFICIENT_RESOURCES;
@ -540,7 +540,7 @@ UDFPhSendIOCTL(
MmPrint((" Alloc Irp MDL=%x, ctx=%x\n", irp->MdlAddress, Context));
/*
if (KeGetCurrentIrql() > PASSIVE_LEVEL) {
KdPrint(("Setting completion routine\n"));
UDFPrint(("Setting completion routine\n"));
IoSetCompletionRoutine( irp, &UDFSyncCompletionRoutine,
Context, TRUE, TRUE, TRUE );
}
@ -553,15 +553,15 @@ UDFPhSendIOCTL(
if (RC == STATUS_PENDING) {
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
KdPrint(("Enter wait state on evt %x\n", Context));
UDFPrint(("Enter wait state on evt %x\n", Context));
if (KeGetCurrentIrql() > PASSIVE_LEVEL) {
timeout.QuadPart = -1000;
KdPrint(("waiting, TO=%I64d\n", timeout.QuadPart));
UDFPrint(("waiting, TO=%I64d\n", timeout.QuadPart));
RC = DbgWaitForSingleObject(&(Context->event), &timeout);
while(RC == STATUS_TIMEOUT) {
timeout.QuadPart *= 2;
KdPrint(("waiting, TO=%I64d\n", timeout.QuadPart));
UDFPrint(("waiting, TO=%I64d\n", timeout.QuadPart));
RC = DbgWaitForSingleObject(&(Context->event), &timeout);
}
@ -571,12 +571,12 @@ UDFPhSendIOCTL(
if ((RC = Context->IosbToUse.Status) == STATUS_DATA_OVERRUN) {
RC = STATUS_SUCCESS;
}
KdPrint(("Exit wait state on evt %x, status %8.8x\n", Context, RC));
UDFPrint(("Exit wait state on evt %x, status %8.8x\n", Context, RC));
/* if(Iosb) {
(*Iosb) = Context->IosbToUse;
}*/
} else {
KdPrint(("No wait completion on evt %x\n", Context));
UDFPrint(("No wait completion on evt %x\n", Context));
/* if(Iosb) {
(*Iosb) = irp->IoStatus;
}*/

View file

@ -121,7 +121,7 @@ UDFIsFastIoPossible(
{
if( !(Fcb->Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED) /*||
!FsRtlOplockIsFastIoPossible(&(Fcb->Oplock))*/ ) {
KdPrint((" FastIoIsNotPossible\n"));
UDFPrint((" FastIoIsNotPossible\n"));
return FastIoIsNotPossible;
}
/*
@ -132,10 +132,10 @@ UDFIsFastIoPossible(
}
*/
if(FsRtlAreThereCurrentFileLocks(&(Fcb->NTRequiredFCB->FileLock)) ) {
KdPrint((" FastIoIsQuestionable\n"));
UDFPrint((" FastIoIsQuestionable\n"));
return FastIoIsQuestionable;
}
KdPrint((" FastIoIsPossible\n"));
UDFPrint((" FastIoIsPossible\n"));
return FastIoIsPossible;
} // end UDFIsFastIoPossible()
@ -175,7 +175,7 @@ UDFFastIoQueryBasicInfo(
FsRtlEnterFileSystem();
KdPrint(("UDFFastIo \n"));
UDFPrint(("UDFFastIo \n"));
// if the file is already opended we can satisfy this request
// immediately 'cause all the data we need must be cached
_SEH2_TRY {
@ -265,7 +265,7 @@ UDFFastIoQueryStdInfo(
FsRtlEnterFileSystem();
KdPrint(("UDFFastIo \n"));
UDFPrint(("UDFFastIo \n"));
// if the file is already opended we can satisfy this request
// immediately 'cause all the data we need must be cached
_SEH2_TRY {
@ -616,7 +616,7 @@ UDFFastIoQueryNetInfo(
FsRtlEnterFileSystem();
KdPrint(("UDFFastIo \n"));
UDFPrint(("UDFFastIo \n"));
// if the file is already opended we can satisfy this request
// immediately 'cause all the data we need must be cached
_SEH2_TRY {

View file

@ -139,26 +139,26 @@ UDFCommonFileInfo(
TopIrp = IoGetTopLevelIrp();
switch((ULONG)TopIrp) {
case FSRTL_FSP_TOP_LEVEL_IRP:
KdPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n"));
break;
case FSRTL_CACHE_TOP_LEVEL_IRP:
KdPrint((" FSRTL_CACHE_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_CACHE_TOP_LEVEL_IRP\n"));
break;
case FSRTL_MOD_WRITE_TOP_LEVEL_IRP:
KdPrint((" FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
break;
case FSRTL_FAST_IO_TOP_LEVEL_IRP:
KdPrint((" FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
BrutePoint()
break;
case NULL:
KdPrint((" NULL TOP_LEVEL_IRP\n"));
UDFPrint((" NULL TOP_LEVEL_IRP\n"));
break;
default:
if(TopIrp == Irp) {
KdPrint((" TOP_LEVEL_IRP\n"));
UDFPrint((" TOP_LEVEL_IRP\n"));
} else {
KdPrint((" RECURSIVE_IRP, TOP = %x\n", TopIrp));
UDFPrint((" RECURSIVE_IRP, TOP = %x\n", TopIrp));
}
}
@ -2029,7 +2029,7 @@ UDFRename(
// removed (in UDFRenameMoveFile__()). Otherwise
// return STATUS_ACCESS_DENIED
if(UDFHasAStreamDir(File1)) {
KdPrint(("TODO: We should remove Streams from source file\n"));
UDFPrint(("TODO: We should remove Streams from source file\n"));
try_return (RC = STATUS_ACCESS_DENIED);
}
#else //UDF_ENABLE_SECURITY

View file

@ -63,9 +63,9 @@ UDFCheckOtherFS(PDEVICE_OBJECT deviceObject) {
FilterDevExt->NodeIdentifier.NodeType = UDF_NODE_TYPE_FILTER_DEVOBJ;
FilterDevExt->NodeIdentifier.NodeSize = sizeof(FILTER_DEV_EXTENSION);
KdPrint(("UDFCheckOtherFS: Attaching filter devobj %x to FS devobj %x \n",filterDeviceObject,deviceObject));
UDFPrint(("UDFCheckOtherFS: Attaching filter devobj %x to FS devobj %x \n",filterDeviceObject,deviceObject));
deviceObject = IoGetAttachedDevice( deviceObject );
KdPrint(("UDFCheckOtherFS: top devobj is %x \n",deviceObject));
UDFPrint(("UDFCheckOtherFS: top devobj is %x \n",deviceObject));
FilterDevExt->lowerFSDeviceObject = deviceObject;
RC = IoAttachDeviceByPointer( filterDeviceObject, deviceObject );
@ -85,7 +85,7 @@ UDFCheckOtherFSByName(PCWSTR DeviceObjectName) {
UNICODE_STRING nameString;
NTSTATUS RC;
KdPrint(("UDFCheckOtherFSByName: trying %s \n",DeviceObjectName));
UDFPrint(("UDFCheckOtherFSByName: trying %s \n",DeviceObjectName));
RtlInitUnicodeString( &nameString, DeviceObjectName );
RC = IoGetDeviceObjectPointer(
@ -96,7 +96,7 @@ UDFCheckOtherFSByName(PCWSTR DeviceObjectName) {
);
if (!NT_SUCCESS(RC)) {
KdPrint(("UDFCheckOtherFSByName: error %x while calling IoGetDeviceObjectPointer \n",RC));
UDFPrint(("UDFCheckOtherFSByName: error %x while calling IoGetDeviceObjectPointer \n",RC));
return;
}
@ -151,7 +151,7 @@ Return Value:
// Begin by determining whether this file system is registering or
// unregistering as an active file system.
if (FsActive) {
KdPrint(("UDFFSNotification \n"));
UDFPrint(("UDFFSNotification \n"));
UDFCheckOtherFS(DeviceObject);
}
}

View file

@ -47,7 +47,7 @@ UDFFlush(
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
KdPrint(("UDFFlush: \n"));
UDFPrint(("UDFFlush: \n"));
FsRtlEnterFileSystem();
ASSERT(DeviceObject);
@ -124,7 +124,7 @@ UDFCommonFlush(
BOOLEAN PostRequest = FALSE;
BOOLEAN CanWait = TRUE;
KdPrint(("UDFCommonFlush: \n"));
UDFPrint(("UDFCommonFlush: \n"));
_SEH2_TRY {
@ -296,7 +296,7 @@ UDFFlushAFile(
// BOOLEAN PurgeCache = FALSE;
ULONG ret_val = 0;
KdPrint(("UDFFlushAFile: \n"));
UDFPrint(("UDFFlushAFile: \n"));
if(!Fcb)
return 0;
@ -419,7 +419,7 @@ UDFFlushADirectory(
IN ULONG FlushFlags
)
{
KdPrint(("UDFFlushADirectory: \n"));
UDFPrint(("UDFFlushADirectory: \n"));
// PDIR_INDEX_HDR hDI;
PDIR_INDEX_ITEM DI;
// BOOLEAN Referenced = FALSE;
@ -514,7 +514,7 @@ UDFFlushLogicalVolume(
#ifndef UDF_READ_ONLY_BUILD
IO_STATUS_BLOCK IoStatus;
KdPrint(("UDFFlushLogicalVolume: \n"));
UDFPrint(("UDFFlushLogicalVolume: \n"));
_SEH2_TRY {
if(Vcb->VCBFlags & (UDF_VCB_FLAGS_RAW_DISK/* |
@ -534,10 +534,10 @@ UDFFlushLogicalVolume(
// return;
// flush internal cache
if(FlushFlags & UDF_FLUSH_FLAGS_LITE) {
KdPrint((" Lite flush, keep Modified=%d.\n", Vcb->Modified));
UDFPrint((" Lite flush, keep Modified=%d.\n", Vcb->Modified));
} else {
if(Vcb->VerifyOnWrite) {
KdPrint(("UDF: Flushing cache for verify\n"));
UDFPrint(("UDF: Flushing cache for verify\n"));
//WCacheFlushAll__(&(Vcb->FastCache), Vcb);
WCacheFlushBlocks__(&(Vcb->FastCache), Vcb, 0, Vcb->LastLBA);
UDFVFlush(Vcb);
@ -583,7 +583,7 @@ UDFFlushCompletion(
{
// NTSTATUS RC = STATUS_SUCCESS;
KdPrint(("UDFFlushCompletion: \n"));
UDFPrint(("UDFFlushCompletion: \n"));
if (Irp->PendingReturned) {
IoMarkIrpPending(Irp);

View file

@ -45,7 +45,7 @@ UDFFSControl(
PtrUDFIrpContext PtrIrpContext;
BOOLEAN AreWeTopLevel = FALSE;
KdPrint(("\nUDFFSControl: \n\n"));
UDFPrint(("\nUDFFSControl: \n\n"));
FsRtlEnterFileSystem();
ASSERT(DeviceObject);
@ -70,7 +70,7 @@ UDFFSControl(
} _SEH2_EXCEPT(UDFExceptionFilter(PtrIrpContext, _SEH2_GetExceptionInformation())) {
KdPrint(("UDFFSControl: exception ***"));
UDFPrintErr(("UDFFSControl: exception ***"));
RC = UDFExceptionHandler(PtrIrpContext, Irp);
UDFLogEvent(UDF_ERROR_INTERNAL_ERROR, RC);
@ -109,7 +109,7 @@ UDFCommonFSControl(
PIO_STACK_LOCATION IrpSp = NULL;
// PDEVICE_OBJECT PtrTargetDeviceObject = NULL;
KdPrint(("\nUDFCommonFSControl\n\n"));
UDFPrint(("\nUDFCommonFSControl\n\n"));
// BrutePoint();
_SEH2_TRY {
@ -120,24 +120,24 @@ UDFCommonFSControl(
switch ((IrpSp)->MinorFunction)
{
case IRP_MN_USER_FS_REQUEST:
KdPrint((" UDFFSControl: UserFsReq request ....\n"));
UDFPrint((" UDFFSControl: UserFsReq request ....\n"));
RC = UDFUserFsCtrlRequest(PtrIrpContext,Irp);
break;
case IRP_MN_MOUNT_VOLUME:
KdPrint((" UDFFSControl: MOUNT_VOLUME request ....\n"));
UDFPrint((" UDFFSControl: MOUNT_VOLUME request ....\n"));
RC = UDFMountVolume(PtrIrpContext,Irp);
break;
case IRP_MN_VERIFY_VOLUME:
KdPrint((" UDFFSControl: VERIFY_VOLUME request ....\n"));
UDFPrint((" UDFFSControl: VERIFY_VOLUME request ....\n"));
RC = UDFVerifyVolume(Irp);
break;
default:
KdPrint((" UDFFSControl: STATUS_INVALID_DEVICE_REQUEST MinorFunction %x\n", (IrpSp)->MinorFunction));
UDFPrintErr((" UDFFSControl: STATUS_INVALID_DEVICE_REQUEST MinorFunction %x\n", (IrpSp)->MinorFunction));
RC = STATUS_INVALID_DEVICE_REQUEST;
Irp->IoStatus.Status = RC;
@ -151,10 +151,10 @@ UDFCommonFSControl(
} _SEH2_FINALLY {
if (!_SEH2_AbnormalTermination()) {
// Free up the Irp Context
KdPrint((" UDFCommonFSControl: finally\n"));
UDFPrint((" UDFCommonFSControl: finally\n"));
UDFReleaseIrpContext(PtrIrpContext);
} else {
KdPrint((" UDFCommonFSControl: finally after exception ***\n"));
UDFPrint((" UDFCommonFSControl: finally after exception ***\n"));
}
} _SEH2_END;
@ -195,7 +195,7 @@ UDFUserFsCtrlRequest(
case FSCTL_OPLOCK_BREAK_ACK_NO_2 :
case FSCTL_REQUEST_FILTER_OPLOCK :
KdPrint(("UDFUserFsCtrlRequest: OPLOCKS\n"));
UDFPrint(("UDFUserFsCtrlRequest: OPLOCKS\n"));
RC = STATUS_INVALID_DEVICE_REQUEST;
Irp->IoStatus.Information = 0;
@ -229,7 +229,7 @@ UDFUserFsCtrlRequest(
case FSCTL_ALLOW_EXTENDED_DASD_IO:
KdPrint(("UDFUserFsCtrlRequest: FSCTL_ALLOW_EXTENDED_DASD_IO\n"));
UDFPrint(("UDFUserFsCtrlRequest: FSCTL_ALLOW_EXTENDED_DASD_IO\n"));
// DASD i/o is always permitted
// So, no-op this call
RC = STATUS_SUCCESS;
@ -270,13 +270,13 @@ UDFUserFsCtrlRequest(
case FSCTL_GET_VOLUME_BITMAP:
KdPrint(("UDFUserFsCtrlRequest: FSCTL_GET_VOLUME_BITMAP\n"));
UDFPrint(("UDFUserFsCtrlRequest: FSCTL_GET_VOLUME_BITMAP\n"));
RC = UDFGetVolumeBitmap( IrpContext, Irp );
break;
case FSCTL_GET_RETRIEVAL_POINTERS:
KdPrint(("UDFUserFsCtrlRequest: FSCTL_GET_RETRIEVAL_POINTERS\n"));
UDFPrint(("UDFUserFsCtrlRequest: FSCTL_GET_RETRIEVAL_POINTERS\n"));
RC = UDFGetRetrievalPointers( IrpContext, Irp, 0 );
break;
@ -284,7 +284,7 @@ UDFUserFsCtrlRequest(
// We don't support any of the known or unknown requests.
default:
KdPrint(("UDFUserFsCtrlRequest: STATUS_INVALID_DEVICE_REQUEST for %x\n",
UDFPrintErr(("UDFUserFsCtrlRequest: STATUS_INVALID_DEVICE_REQUEST for %x\n",
IrpSp->Parameters.FileSystemControl.FsControlCode));
RC = STATUS_INVALID_DEVICE_REQUEST;
@ -344,11 +344,11 @@ UDFMountVolume(
int8* ioBuf = NULL;
ASSERT(IrpSp);
KdPrint(("\n !!! UDFMountVolume\n"));
// KdPrint(("Build " VER_STR_PRODUCT "\n\n"));
UDFPrint(("\n !!! UDFMountVolume\n"));
// UDFPrint(("Build " VER_STR_PRODUCT "\n\n"));
fsDeviceObject = PtrIrpContext->TargetDeviceObject;
KdPrint(("Mount on device object %x\n", fsDeviceObject));
UDFPrint(("Mount on device object %x\n", fsDeviceObject));
filterDevExt = (PFILTER_DEV_EXTENSION)fsDeviceObject->DeviceExtension;
if (filterDevExt->NodeIdentifier.NodeType == UDF_NODE_TYPE_FILTER_DEVOBJ &&
filterDevExt->NodeIdentifier.NodeSize == sizeof(FILTER_DEV_EXTENSION)) {
@ -358,7 +358,7 @@ UDFMountVolume(
filterDevExt->NodeIdentifier.NodeSize == sizeof(UDFFS_DEV_EXTENSION)) {
CompleteIrp = TRUE;
} else {
KdPrint(("Invalid node type in FS or FILTER DeviceObject\n"));
UDFPrintErr(("Invalid node type in FS or FILTER DeviceObject\n"));
ASSERT(FALSE);
}
// Get a pointer to the target physical/virtual device object.
@ -405,7 +405,7 @@ UDFMountVolume(
if(WrongMedia) try_return(RC = STATUS_UNRECOGNIZED_VOLUME);
if(RemovableMedia) {
KdPrint(("UDFMountVolume: removable media\n"));
UDFPrint(("UDFMountVolume: removable media\n"));
// just remember current MediaChangeCount
// or fail if No Media ....
@ -431,13 +431,13 @@ UDFMountVolume(
&Mode,sizeof(Mode),
&TestUnitReadyBuffer,sizeof(TEST_UNIT_READY_USER_OUT),
FALSE,NULL);
KdPrint(("UDFMountVolume: TEST_UNIT_READY %x\n", RC));
UDFPrint(("UDFMountVolume: TEST_UNIT_READY %x\n", RC));
if(!NT_SUCCESS(RC))
break;
if(TestUnitReadyBuffer.SenseKey == SCSI_SENSE_NOT_READY &&
TestUnitReadyBuffer.AdditionalSenseCode == SCSI_ADSENSE_LUN_NOT_READY &&
TestUnitReadyBuffer.AdditionalSenseCodeQualifier == SCSI_SENSEQ_BECOMING_READY) {
KdPrint(("UDFMountVolume: retry\n"));
UDFPrint(("UDFMountVolume: retry\n"));
KeDelayExecutionThread(KernelMode, FALSE, &delay);
//delay.QuadPart -= 10000000LL; // 1.0 sec
} else {
@ -445,7 +445,7 @@ UDFMountVolume(
}
}
if(i) {
KdPrint(("UDFMountVolume: additional delay 3 sec\n"));
UDFPrint(("UDFMountVolume: additional delay 3 sec\n"));
delay.QuadPart = -30000000LL; // 3.0 sec
KeDelayExecutionThread(KernelMode, FALSE, &delay);
}
@ -460,7 +460,7 @@ UDFMountVolume(
FALSE,&Iosb );
if(RC == STATUS_IO_DEVICE_ERROR) {
KdPrint(("UDFMountVolume: retry check verify\n"));
UDFPrint(("UDFMountVolume: retry check verify\n"));
RC = UDFPhSendIOCTL( IOCTL_STORAGE_CHECK_VERIFY,
TargetDeviceObject,
NULL,0,
@ -513,7 +513,7 @@ UDFMountVolume(
// Now before we can initialize the Vcb we need to set up the
// Get our device object and alignment requirement.
// Device extension == VCB
KdPrint(("UDFMountVolume: create device\n"));
UDFPrint(("UDFMountVolume: create device\n"));
RC = IoCreateDevice( UDFGlobalData.DriverObject,
sizeof(VCB),
NULL,
@ -622,17 +622,17 @@ UDFMountVolume(
#endif //UDF_READ_ONLY_BUILD
if(!NT_SUCCESS(RC)) {
KdPrint(("UDFMountVolume: try raw mount\n"));
UDFPrint(("UDFMountVolume: try raw mount\n"));
if(Vcb->NSRDesc & VRS_ISO9660_FOUND) {
KdPrint(("UDFMountVolume: block raw mount due to ISO9660 presence\n"));
UDFPrint(("UDFMountVolume: block raw mount due to ISO9660 presence\n"));
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_RAW_DISK;
try_return(RC);
}
try_raw_mount:
KdPrint(("UDFMountVolume: try raw mount (2)\n"));
UDFPrint(("UDFMountVolume: try raw mount (2)\n"));
if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
KdPrint(("UDFMountVolume: trying raw mount...\n"));
UDFPrint(("UDFMountVolume: trying raw mount...\n"));
Vcb->VolIdent.Length =
(Vcb->VolIdent.MaximumLength = sizeof(UDF_BLANK_VOLUME_LABEL)) - 2;
if(Vcb->VolIdent.Buffer)
@ -654,14 +654,14 @@ try_raw_mount:
#ifndef UDF_READ_ONLY_BUILD
// set cache mode according to media type
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY)) {
KdPrint(("UDFMountVolume: writable volume\n"));
UDFPrint(("UDFMountVolume: writable volume\n"));
if(!Vcb->CDR_Mode) {
if((FsDeviceType == FILE_DEVICE_DISK_FILE_SYSTEM) ||
CdrwMediaClassEx_IsRAM(Vcb->MediaClassEx)) {
KdPrint(("UDFMountVolume: RAM mode\n"));
UDFPrint(("UDFMountVolume: RAM mode\n"));
Mode = WCACHE_MODE_RAM;
} else {
KdPrint(("UDFMountVolume: RW mode\n"));
UDFPrint(("UDFMountVolume: RW mode\n"));
Mode = WCACHE_MODE_RW;
}
/* if(FsDeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM) {
@ -669,12 +669,12 @@ try_raw_mount:
Vcb->WriteSecurity = TRUE;
}*/
} else {
KdPrint(("UDFMountVolume: R mode\n"));
UDFPrint(("UDFMountVolume: R mode\n"));
Mode = WCACHE_MODE_R;
}
// we can't record ACL on old format disks
if(!UDFNtAclSupported(Vcb)) {
KdPrint(("UDFMountVolume: NO ACL and ExtFE support\n"));
UDFPrint(("UDFMountVolume: NO ACL and ExtFE support\n"));
Vcb->WriteSecurity = FALSE;
Vcb->UseExtendedFE = FALSE;
}
@ -707,7 +707,7 @@ try_raw_mount:
RC = UDFStartEjectWaiter(Vcb);
if(!NT_SUCCESS(RC)) try_return(RC);
} else {
KdPrint(("UDFMountVolume: RO mount\n"));
UDFPrint(("UDFMountVolume: RO mount\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
}
#endif //UDF_READ_ONLY_BUILD
@ -725,7 +725,7 @@ try_raw_mount:
Vcb->FreeAllocUnits = UDFGetFreeSpace(Vcb);
// Register shutdown routine
if(!Vcb->ShutdownRegistered) {
KdPrint(("UDFMountVolume: Register shutdown routine\n"));
UDFPrint(("UDFMountVolume: Register shutdown routine\n"));
IoRegisterShutdownNotification(Vcb->VCBDeviceObject);
Vcb->ShutdownRegistered = TRUE;
}
@ -733,7 +733,7 @@ try_raw_mount:
// unlock media
if(RemovableMedia) {
if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) {
KdPrint(("UDFMountVolume: unlock media on RO volume\n"));
UDFPrint(("UDFMountVolume: unlock media on RO volume\n"));
((PPREVENT_MEDIA_REMOVAL_USER_IN)(&MediaChangeCount))->PreventMediaRemoval = FALSE;
UDFPhSendIOCTL( IOCTL_STORAGE_MEDIA_REMOVAL,
TargetDeviceObject,
@ -761,7 +761,7 @@ try_raw_mount:
try_exit: NOTHING;
} _SEH2_FINALLY {
KdPrint(("UDFMountVolume: RC = %x\n", RC));
UDFPrint(("UDFMountVolume: RC = %x\n", RC));
if(ioBuf) {
MyFreePool__(ioBuf);
@ -770,7 +770,7 @@ try_exit: NOTHING;
if(!NT_SUCCESS(RC)) {
if(RemovableMedia && Locked) {
KdPrint(("UDFMountVolume: unlock media\n"));
UDFPrint(("UDFMountVolume: unlock media\n"));
((PPREVENT_MEDIA_REMOVAL_USER_IN)(&MediaChangeCount))->PreventMediaRemoval = FALSE;
UDFPhSendIOCTL( IOCTL_STORAGE_MEDIA_REMOVAL,
TargetDeviceObject,
@ -783,12 +783,12 @@ try_exit: NOTHING;
// reset driver
if(!DeviceNotTouched &&
(!Vcb || (Vcb && (Vcb->VCBFlags & UDF_VCB_FLAGS_OUR_DEVICE_DRIVER)))) {
KdPrint(("UDFMountVolume: reset driver\n"));
UDFPrint(("UDFMountVolume: reset driver\n"));
UDFResetDeviceDriver(Vcb, TargetDeviceObject, TRUE);
}
if(RC == STATUS_CRC_ERROR || RC == STATUS_FILE_CORRUPT_ERROR) {
KdPrint(("UDFMountVolume: status -> STATUS_UNRECOGNIZED_VOLUME\n"));
UDFPrint(("UDFMountVolume: status -> STATUS_UNRECOGNIZED_VOLUME\n"));
RC = STATUS_UNRECOGNIZED_VOLUME;
}
@ -820,7 +820,7 @@ try_exit: NOTHING;
if(!_SEH2_AbnormalTermination()) {
// Set mount event
KdPrint(("UDFMountVolume: complete req RC %x\n", RC));
UDFPrint(("UDFMountVolume: complete req RC %x\n", RC));
UDFNotifyVolumeEvent(IrpSp->FileObject, FSRTL_VOLUME_MOUNT);
// Complete the IRP.
Irp->IoStatus.Status = RC;
@ -841,7 +841,7 @@ try_exit: NOTHING;
} _SEH2_END;
KdPrint(("UDFMountVolume: final RC = %x\n", RC));
UDFPrint(("UDFMountVolume: final RC = %x\n", RC));
return RC;
} // end UDFMountVolume()
@ -853,31 +853,31 @@ UDFStartEjectWaiter(
{
// NTSTATUS RC;
PREVENT_MEDIA_REMOVAL_USER_IN Buff;
KdPrint(("UDFStartEjectWaiter:\n"));
UDFPrint(("UDFStartEjectWaiter:\n"));
if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) {
KdPrint((" UDF_VCB_FLAGS_MEDIA_READ_ONLY\n"));
UDFPrint((" UDF_VCB_FLAGS_MEDIA_READ_ONLY\n"));
}
if(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) {
KdPrint((" UDF_VCB_FLAGS_MEDIA_LOCKED\n"));
UDFPrint((" UDF_VCB_FLAGS_MEDIA_LOCKED\n"));
}
KdPrint((" EjectWaiter=%x\n", Vcb->EjectWaiter));
UDFPrint((" EjectWaiter=%x\n", Vcb->EjectWaiter));
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_READ_ONLY) &&
/*!(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) &&*/
!(Vcb->EjectWaiter)) {
KdPrint(("UDFStartEjectWaiter: check driver\n"));
UDFPrint(("UDFStartEjectWaiter: check driver\n"));
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_OUR_DEVICE_DRIVER) &&
(Vcb->FsDeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM)) {
// we don't know how to write without our device driver
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
KdPrint((" not our driver, ignore\n"));
UDFPrint((" not our driver, ignore\n"));
return STATUS_SUCCESS;
}
KdPrint(("UDFStartEjectWaiter: check removable\n"));
UDFPrint(("UDFStartEjectWaiter: check removable\n"));
if(Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA) {
// prevent media removal
KdPrint(("UDFStartEjectWaiter: lock media\n"));
UDFPrint(("UDFStartEjectWaiter: lock media\n"));
Buff.PreventMediaRemoval = TRUE;
UDFTSendIOCTL( IOCTL_STORAGE_MEDIA_REMOVAL,
Vcb,
@ -886,7 +886,7 @@ UDFStartEjectWaiter(
FALSE,NULL );
Vcb->VCBFlags |= UDF_VCB_FLAGS_MEDIA_LOCKED;
}
KdPrint(("UDFStartEjectWaiter: prepare to start\n"));
UDFPrint(("UDFStartEjectWaiter: prepare to start\n"));
// initialize Eject Request waiter
Vcb->EjectWaiter = (PUDFEjectWaitContext)MyAllocatePool__(NonPagedPool, sizeof(UDFEjectWaitContext));
if(!(Vcb->EjectWaiter)) return STATUS_INSUFFICIENT_RESOURCES;
@ -901,10 +901,10 @@ UDFStartEjectWaiter(
ASSERT(!(Vcb->VCBFlags & UDF_VCB_FLAGS_STOP_WAITER_EVENT));
Vcb->VCBFlags |= UDF_VCB_FLAGS_STOP_WAITER_EVENT;
ExInitializeWorkItem(&(Vcb->EjectWaiter->EjectReqWorkQueueItem), (PWORKER_THREAD_ROUTINE)UDFEjectReqWaiter, Vcb->EjectWaiter);
KdPrint(("UDFStartEjectWaiter: create thread\n"));
UDFPrint(("UDFStartEjectWaiter: create thread\n"));
ExQueueWorkItem(&(Vcb->EjectWaiter->EjectReqWorkQueueItem), DelayedWorkQueue);
} else {
KdPrint((" ignore\n"));
UDFPrint((" ignore\n"));
}
return STATUS_SUCCESS;
} // end UDFStartEjectWaiter()
@ -921,18 +921,18 @@ UDFCompleteMount(
PtrUDFObjectName RootName;
PtrUDFFCB RootFcb;
KdPrint(("UDFCompleteMount:\n"));
UDFPrint(("UDFCompleteMount:\n"));
Vcb->ZBuffer = (PCHAR)DbgAllocatePoolWithTag(NonPagedPool, max(Vcb->LBlockSize, PAGE_SIZE), 'zNWD');
if(!Vcb->ZBuffer) return STATUS_INSUFFICIENT_RESOURCES;
RtlZeroMemory(Vcb->ZBuffer, Vcb->LBlockSize);
KdPrint(("UDFCompleteMount: alloc Root FCB\n"));
UDFPrint(("UDFCompleteMount: alloc Root FCB\n"));
// Create the root index and reference it in the Vcb.
RootFcb =
Vcb->RootDirFCB = UDFAllocateFCB();
if(!RootFcb) return STATUS_INSUFFICIENT_RESOURCES;
KdPrint(("UDFCompleteMount: alloc Root ObjName\n"));
UDFPrint(("UDFCompleteMount: alloc Root ObjName\n"));
// Allocate and set root FCB unique name
RootName = UDFAllocateObjectName();
if(!RootName) {
@ -954,7 +954,7 @@ insuf_res_1:
Vcb->RootDirFCB = NULL;
return RC;
}
KdPrint(("UDFCompleteMount: open Root Dir\n"));
UDFPrint(("UDFCompleteMount: open Root Dir\n"));
// Open Root Directory
RC = UDFOpenRootFile__( Vcb, &(Vcb->RootLbAddr), RootFcb->FileInfo );
if(!NT_SUCCESS(RC)) {
@ -966,7 +966,7 @@ insuf_res_2:
RootFcb->FileInfo->Fcb = RootFcb;
if(!(RootFcb->NTRequiredFCB = RootFcb->FileInfo->Dloc->CommonFcb)) {
KdPrint(("UDFCompleteMount: alloc Root ObjName (2)\n"));
UDFPrint(("UDFCompleteMount: alloc Root ObjName (2)\n"));
if(!(RootFcb->NTRequiredFCB =
(PtrUDFNTRequiredFCB)MyAllocatePool__(NonPagedPool, UDFQuadAlign(sizeof(UDFNTRequiredFCB))) ) ) {
RC = STATUS_INSUFFICIENT_RESOURCES;
@ -975,7 +975,7 @@ insuf_res_2:
RtlZeroMemory(RootFcb->NTRequiredFCB, UDFQuadAlign(sizeof(UDFNTRequiredFCB)));
RootFcb->FileInfo->Dloc->CommonFcb = RootFcb->NTRequiredFCB;
}
KdPrint(("UDFCompleteMount: init FCB\n"));
UDFPrint(("UDFCompleteMount: init FCB\n"));
RC = UDFInitializeFCB(RootFcb,Vcb,RootName,UDF_FCB_ROOT_DIRECTORY | UDF_FCB_DIRECTORY,NULL);
if(!NT_SUCCESS(RC)) {
// if we get here, no resources are inited
@ -1353,7 +1353,7 @@ UDFCloseResidual(
// Deinitialize Non-alloc file
if(Vcb->VCBOpenCount)
UDFInterlockedDecrement((PLONG)&(Vcb->VCBOpenCount));
KdPrint(("UDFCloseResidual: NonAllocFileInfo %x\n", Vcb->NonAllocFileInfo));
UDFPrint(("UDFCloseResidual: NonAllocFileInfo %x\n", Vcb->NonAllocFileInfo));
if(Vcb->NonAllocFileInfo) {
UDFCloseFile__(Vcb,Vcb->NonAllocFileInfo);
UDFCleanUpFile__(Vcb, Vcb->NonAllocFileInfo);
@ -1361,7 +1361,7 @@ UDFCloseResidual(
Vcb->NonAllocFileInfo = NULL;
}
// Deinitialize Unique ID Mapping
KdPrint(("UDFCloseResidual: NonAllocFileInfo %x\n", Vcb->NonAllocFileInfo));
UDFPrint(("UDFCloseResidual: NonAllocFileInfo %x\n", Vcb->NonAllocFileInfo));
if(Vcb->UniqueIDMapFileInfo) {
UDFCloseFile__(Vcb,Vcb->UniqueIDMapFileInfo);
UDFCleanUpFile__(Vcb, Vcb->UniqueIDMapFileInfo);
@ -1369,7 +1369,7 @@ UDFCloseResidual(
Vcb->UniqueIDMapFileInfo = NULL;
}
// Deinitialize VAT file
KdPrint(("UDFCloseResidual: VatFileInfo %x\n", Vcb->VatFileInfo));
UDFPrint(("UDFCloseResidual: VatFileInfo %x\n", Vcb->VatFileInfo));
if(Vcb->VatFileInfo) {
UDFCloseFile__(Vcb,Vcb->VatFileInfo);
UDFCleanUpFile__(Vcb, Vcb->VatFileInfo);
@ -1377,7 +1377,7 @@ UDFCloseResidual(
Vcb->VatFileInfo = NULL;
}
// System StreamDir
KdPrint(("UDFCloseResidual: SysSDirFileInfo %x\n", Vcb->SysSDirFileInfo));
UDFPrint(("UDFCloseResidual: SysSDirFileInfo %x\n", Vcb->SysSDirFileInfo));
if(Vcb->SysSDirFileInfo) {
UDFCloseFile__(Vcb, Vcb->SysSDirFileInfo);
UDFCleanUpFile__(Vcb, Vcb->SysSDirFileInfo);
@ -1411,7 +1411,7 @@ UDFCloseResidual(
}*/
// Deinitialize root dir fcb
KdPrint(("UDFCloseResidual: RootDirFCB %x\n", Vcb->RootDirFCB));
UDFPrint(("UDFCloseResidual: RootDirFCB %x\n", Vcb->RootDirFCB));
if(Vcb->RootDirFCB) {
UDFCloseFile__(Vcb,Vcb->RootDirFCB->FileInfo);
if(Vcb->RootDirFCB->OpenHandleCount)
@ -1559,11 +1559,11 @@ UDFIsVolumeMounted(
PtrUDFFCB Fcb;
PtrUDFCCB Ccb;
KdPrint(("UDFIsVolumeMounted\n"));
UDFPrint(("UDFIsVolumeMounted\n"));
Ccb = (PtrUDFCCB)IrpSp->FileObject->FsContext2;
if(!Ccb) {
KdPrint((" !Ccb\n"));
UDFPrintErr((" !Ccb\n"));
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
return STATUS_INVALID_PARAMETER;
@ -1612,7 +1612,7 @@ UDFGetStatistics(
ULONG StatsSize;
ULONG BytesToCopy;
KdPrint(("UDFGetStatistics\n"));
UDFPrint(("UDFGetStatistics\n"));
// Extract the buffer
BufferLength = IrpSp->Parameters.FileSystemControl.OutputBufferLength;
@ -1669,7 +1669,7 @@ UDFIsPathnameValid(
UNICODE_STRING CurName;
PWCHAR TmpBuffer;
KdPrint(("UDFIsPathnameValid\n"));
UDFPrint(("UDFIsPathnameValid\n"));
// Extract the pathname
PathnameBuffer = (PPATHNAME_BUFFER)Irp->AssociatedIrp.SystemBuffer;
@ -1737,13 +1737,13 @@ UDFLockVolume(
PtrUDFCCB Ccb;
BOOLEAN VcbAcquired = FALSE;
KdPrint(("UDFLockVolume: PID %x\n", PID));
UDFPrint(("UDFLockVolume: PID %x\n", PID));
// Decode the file object, the only type of opens we accept are
// user volume opens.
Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
if(!Ccb) {
KdPrint((" !Ccb\n"));
UDFPrintErr((" !Ccb\n"));
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
return STATUS_INVALID_PARAMETER;
@ -1871,13 +1871,13 @@ UDFUnlockVolume(
PtrUDFFCB Fcb;
PtrUDFCCB Ccb;
KdPrint(("UDFUnlockVolume: PID %x\n", PID));
UDFPrint(("UDFUnlockVolume: PID %x\n", PID));
// Decode the file object, the only type of opens we accept are
// user volume opens.
Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
if(!Ccb) {
KdPrint((" !Ccb\n"));
UDFPrintErr((" !Ccb\n"));
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
return STATUS_INVALID_PARAMETER;
@ -1954,13 +1954,13 @@ UDFDismountVolume(
PPREVENT_MEDIA_REMOVAL_USER_IN Buf = NULL;
BOOLEAN VcbAcquired = FALSE;
KdPrint(("\n ### UDFDismountVolume ###\n\n"));
UDFPrint(("\n ### UDFDismountVolume ###\n\n"));
// Decode the file object, the only type of opens we accept are
// user volume opens.
Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
if(!Ccb) {
KdPrint((" !Ccb\n"));
UDFPrintErr((" !Ccb\n"));
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
return STATUS_INVALID_PARAMETER;
@ -2080,7 +2080,7 @@ UDFGetVolumeBitmap(
PtrUDFFCB Fcb;
PtrUDFCCB Ccb;
KdPrint(("UDFGetVolumeBitmap\n"));
UDFPrint(("UDFGetVolumeBitmap\n"));
ULONG BytesToCopy;
ULONG TotalClusters;
@ -2099,7 +2099,7 @@ UDFGetVolumeBitmap(
// user volume opens.
Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
if(!Ccb) {
KdPrint((" !Ccb\n"));
UDFPrintErr((" !Ccb\n"));
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
return STATUS_INVALID_PARAMETER;
@ -2176,7 +2176,7 @@ UDFGetVolumeBitmap(
} _SEH2_EXCEPT(UDFExceptionFilter(IrpContext, _SEH2_GetExceptionInformation())) {
BrutePoint();
KdPrint(("UDFGetVolumeBitmap: Exception\n"));
UDFPrintErr(("UDFGetVolumeBitmap: Exception\n"));
// UDFUnlockCallersBuffer(IrpContext, Irp, OutputBuffer);
BrutePoint();
// RC = UDFExceptionHandler(IrpContext, Irp);
@ -2234,13 +2234,13 @@ UDFGetRetrievalPointers(
ULONG LBSh;
ULONG L2BSh;
KdPrint(("UDFGetRetrievalPointers\n"));
UDFPrint(("UDFGetRetrievalPointers\n"));
// Decode the file object, the only type of opens we accept are
// user volume opens.
Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
if(!Ccb) {
KdPrint((" !Ccb\n"));
UDFPrintErr((" !Ccb\n"));
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
return STATUS_INVALID_PARAMETER;
@ -2377,7 +2377,7 @@ UDFIsVolumeDirty(
PtrUDFFCB Fcb;
PtrUDFCCB Ccb;
KdPrint(("UDFIsVolumeDirty\n"));
UDFPrint(("UDFIsVolumeDirty\n"));
Irp->IoStatus.Information = 0;
@ -2386,13 +2386,13 @@ UDFIsVolumeDirty(
} else if (Irp->MdlAddress != NULL) {
VolumeState = (PULONG)MmGetSystemAddressForMdl(Irp->MdlAddress);
} else {
KdPrint((" STATUS_INVALID_USER_BUFFER\n"));
UDFPrintErr((" STATUS_INVALID_USER_BUFFER\n"));
Irp->IoStatus.Status = STATUS_INVALID_USER_BUFFER;
return STATUS_INVALID_USER_BUFFER;
}
if (IrpSp->Parameters.FileSystemControl.OutputBufferLength < sizeof(ULONG)) {
KdPrint((" STATUS_BUFFER_TOO_SMALL\n"));
UDFPrintErr((" STATUS_BUFFER_TOO_SMALL\n"));
Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
return STATUS_BUFFER_TOO_SMALL;
}
@ -2403,7 +2403,7 @@ UDFIsVolumeDirty(
// user volume opens.
Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
if(!Ccb) {
KdPrint((" !Ccb\n"));
UDFPrintErr((" !Ccb\n"));
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
return STATUS_INVALID_PARAMETER;
@ -2412,23 +2412,23 @@ UDFIsVolumeDirty(
Vcb = Fcb->Vcb;
if(Vcb != (PVCB)Fcb || !(Ccb->CCBFlags & UDF_CCB_VOLUME_OPEN)) {
KdPrint((" !Volume\n"));
UDFPrintErr((" !Volume\n"));
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
return STATUS_INVALID_PARAMETER;
}
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
KdPrint((" !Mounted\n"));
UDFPrintErr((" !Mounted\n"));
Irp->IoStatus.Status = STATUS_VOLUME_DISMOUNTED;
return STATUS_VOLUME_DISMOUNTED;
}
if(Vcb->origIntegrityType == INTEGRITY_TYPE_OPEN) {
KdPrint((" Dirty\n"));
UDFPrint((" Dirty\n"));
(*VolumeState) |= VOLUME_IS_DIRTY;
Irp->IoStatus.Information = sizeof(ULONG);
} else {
KdPrint((" Clean\n"));
UDFPrint((" Clean\n"));
}
Irp->IoStatus.Status = STATUS_SUCCESS;
@ -2448,7 +2448,7 @@ UDFInvalidateVolumes(
(PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation( Irp );
PPREVENT_MEDIA_REMOVAL_USER_IN Buf = NULL;
KdPrint(("UDFInvalidateVolumes\n"));
UDFPrint(("UDFInvalidateVolumes\n"));
KIRQL SavedIrql;
@ -2472,13 +2472,13 @@ UDFInvalidateVolumes(
IrpSp->MinorFunction == IRP_MN_USER_FS_REQUEST &&
IrpSp->Parameters.FileSystemControl.FsControlCode == FSCTL_INVALIDATE_VOLUMES &&
!SeSinglePrivilegeCheck( TcbPrivilege, UserMode )) {
KdPrint(("UDFInvalidateVolumes: STATUS_PRIVILEGE_NOT_HELD\n"));
UDFPrintErr(("UDFInvalidateVolumes: STATUS_PRIVILEGE_NOT_HELD\n"));
Irp->IoStatus.Status = STATUS_PRIVILEGE_NOT_HELD;
return STATUS_PRIVILEGE_NOT_HELD;
}
// Try to get a pointer to the device object from the handle passed in.
if (IrpSp->Parameters.FileSystemControl.InputBufferLength != sizeof( HANDLE )) {
KdPrint(("UDFInvalidateVolumes: STATUS_INVALID_PARAMETER\n"));
UDFPrintErr(("UDFInvalidateVolumes: STATUS_INVALID_PARAMETER\n"));
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
return STATUS_INVALID_PARAMETER;
}
@ -2493,7 +2493,7 @@ UDFInvalidateVolumes(
NULL );
if (!NT_SUCCESS(RC)) {
KdPrint(("UDFInvalidateVolumes: can't get handle, RC=%x\n", RC));
UDFPrintErr(("UDFInvalidateVolumes: can't get handle, RC=%x\n", RC));
Irp->IoStatus.Status = RC;
return RC;
}
@ -2508,7 +2508,7 @@ UDFInvalidateVolumes(
// a new volume.
NewVpb = (PVPB)DbgAllocatePoolWithTag( NonPagedPool, sizeof( VPB ), 'bpvU' );
if(!NewVpb) {
KdPrint(("UDFInvalidateVolumes: STATUS_INSUFFICIENT_RESOURCES\n"));
UDFPrintErr(("UDFInvalidateVolumes: STATUS_INSUFFICIENT_RESOURCES\n"));
Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
return STATUS_INSUFFICIENT_RESOURCES;
}
@ -2554,7 +2554,7 @@ UDFInvalidateVolumes(
if(!Buf) {
Buf = (PPREVENT_MEDIA_REMOVAL_USER_IN)MyAllocatePool__(NonPagedPool, sizeof(PREVENT_MEDIA_REMOVAL_USER_IN)*2);
if(!Buf) {
KdPrint(("UDFInvalidateVolumes: STATUS_INSUFFICIENT_RESOURCES (2)\n"));
UDFPrintErr(("UDFInvalidateVolumes: STATUS_INSUFFICIENT_RESOURCES (2)\n"));
UDFReleaseResource(&(Vcb->VCBResource));
MyFreePool__(NewVpb);
Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
@ -2563,18 +2563,18 @@ UDFInvalidateVolumes(
}
#ifdef UDF_DELAYED_CLOSE
KdPrint((" UDFInvalidateVolumes: set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
UDFPrint((" UDFInvalidateVolumes: set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_NO_DELAYED_CLOSE;
UDFReleaseResource(&(Vcb->VCBResource));
#endif //UDF_DELAYED_CLOSE
if(Vcb->RootDirFCB && Vcb->RootDirFCB->FileInfo) {
KdPrint((" UDFInvalidateVolumes: UDFCloseAllSystemDelayedInDir\n"));
UDFPrint((" UDFInvalidateVolumes: UDFCloseAllSystemDelayedInDir\n"));
RC = UDFCloseAllSystemDelayedInDir(Vcb, Vcb->RootDirFCB->FileInfo);
ASSERT(OS_SUCCESS(RC));
}
#ifdef UDF_DELAYED_CLOSE
KdPrint((" UDFInvalidateVolumes: UDFCloseAllDelayed\n"));
UDFPrint((" UDFInvalidateVolumes: UDFCloseAllDelayed\n"));
UDFCloseAllDelayed(Vcb);
//ASSERT(OS_SUCCESS(RC));
#endif //UDF_DELAYED_CLOSE
@ -2585,10 +2585,10 @@ UDFInvalidateVolumes(
UDFReleaseResource(&(Vcb->VCBResource));
UDFStopEjectWaiter(Vcb);
KdPrint(("UDFInvalidateVolumes: Vcb %x dismounted\n", Vcb));
UDFPrint(("UDFInvalidateVolumes: Vcb %x dismounted\n", Vcb));
break;
} else {
KdPrint(("UDFInvalidateVolumes: skip Vcb %x\n", Vcb));
UDFPrint(("UDFInvalidateVolumes: skip Vcb %x\n", Vcb));
UDFReleaseResource(&(Vcb->VCBResource));
}
@ -2600,17 +2600,17 @@ UDFInvalidateVolumes(
Irp->IoStatus.Status = STATUS_SUCCESS;
if(Buf) {
KdPrint(("UDFInvalidateVolumes: free buffer\n"));
UDFPrint(("UDFInvalidateVolumes: free buffer\n"));
MyFreePool__(Buf);
}
// drop volume completly
KdPrint(("UDFInvalidateVolumes: drop volume completly\n"));
UDFPrint(("UDFInvalidateVolumes: drop volume completly\n"));
UDFAcquireResourceExclusive(&(UDFGlobalData.GlobalDataResource), TRUE);
UDFScanForDismountedVcb(IrpContext);
UDFReleaseResource( &(UDFGlobalData.GlobalDataResource) );
KdPrint(("UDFInvalidateVolumes: done\n"));
UDFPrint(("UDFInvalidateVolumes: done\n"));
return STATUS_SUCCESS;
} // end UDFInvalidateVolumes()

View file

@ -43,7 +43,7 @@ UDFLockControl(
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
KdPrint(("UDFLockControl\n"));
UDFPrint(("UDFLockControl\n"));
// BrutePoint();
FsRtlEnterFileSystem();
@ -118,7 +118,7 @@ UDFCommonLockControl(
PtrUDFFCB Fcb = NULL;
PtrUDFCCB Ccb = NULL;
KdPrint(("UDFCommonLockControl\n"));
UDFPrint(("UDFCommonLockControl\n"));
_SEH2_TRY {
// First, get a pointer to the current I/O stack location.
@ -220,7 +220,7 @@ UDFFastLock (
PtrUDFFCB Fcb = NULL;
PtrUDFCCB Ccb = NULL;
KdPrint(("UDFFastLock\n"));
UDFPrint(("UDFFastLock\n"));
// Decode the type of file object we're being asked to process and make
// sure it is only a user file open.
@ -323,7 +323,7 @@ UDFFastUnlockSingle(
PtrUDFFCB Fcb = NULL;
PtrUDFCCB Ccb = NULL;
KdPrint(("UDFFastUnlockSingle\n"));
UDFPrint(("UDFFastUnlockSingle\n"));
// Decode the type of file object we're being asked to process and make
// sure it is only a user file open.
@ -415,7 +415,7 @@ UDFFastUnlockAll(
PtrUDFFCB Fcb = NULL;
PtrUDFCCB Ccb = NULL;
KdPrint(("UDFFastUnlockAll\n"));
UDFPrint(("UDFFastUnlockAll\n"));
IoStatus->Information = 0;
// Decode the type of file object we're being asked to process and make
@ -506,7 +506,7 @@ UDFFastUnlockAllByKey(
PtrUDFFCB Fcb = NULL;
PtrUDFCCB Ccb = NULL;
KdPrint(("UDFFastUnlockAllByKey\n"));
UDFPrint(("UDFFastUnlockAllByKey\n"));
IoStatus->Information = 0;
// Decode the type of file object we're being asked to process and make

View file

@ -272,32 +272,32 @@ UDFExceptionFilter(
#if defined UDF_DBG || defined PRINT_ALWAYS
ULONG i;
KdPrint(("UDFExceptionFilter\n"));
KdPrint((" Ex. Code: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionCode));
KdPrint((" Ex. Addr: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionAddress));
KdPrint((" Ex. Flag: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionFlags));
KdPrint((" Ex. Pnum: %x\n",PtrExceptionPointers->ExceptionRecord->NumberParameters));
UDFPrint(("UDFExceptionFilter\n"));
UDFPrint((" Ex. Code: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionCode));
UDFPrint((" Ex. Addr: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionAddress));
UDFPrint((" Ex. Flag: %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionFlags));
UDFPrint((" Ex. Pnum: %x\n",PtrExceptionPointers->ExceptionRecord->NumberParameters));
for(i=0;i<PtrExceptionPointers->ExceptionRecord->NumberParameters;i++) {
KdPrint((" %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionInformation[i]));
UDFPrint((" %x\n",PtrExceptionPointers->ExceptionRecord->ExceptionInformation[i]));
}
#ifdef _X86_
KdPrint(("Exception context:\n"));
UDFPrint(("Exception context:\n"));
if(PtrExceptionPointers->ContextRecord->ContextFlags & CONTEXT_INTEGER) {
KdPrint(("EAX=%8.8x ",PtrExceptionPointers->ContextRecord->Eax));
KdPrint(("EBX=%8.8x ",PtrExceptionPointers->ContextRecord->Ebx));
KdPrint(("ECX=%8.8x ",PtrExceptionPointers->ContextRecord->Ecx));
KdPrint(("EDX=%8.8x\n",PtrExceptionPointers->ContextRecord->Edx));
UDFPrint(("EAX=%8.8x ",PtrExceptionPointers->ContextRecord->Eax));
UDFPrint(("EBX=%8.8x ",PtrExceptionPointers->ContextRecord->Ebx));
UDFPrint(("ECX=%8.8x ",PtrExceptionPointers->ContextRecord->Ecx));
UDFPrint(("EDX=%8.8x\n",PtrExceptionPointers->ContextRecord->Edx));
KdPrint(("ESI=%8.8x ",PtrExceptionPointers->ContextRecord->Esi));
KdPrint(("EDI=%8.8x ",PtrExceptionPointers->ContextRecord->Edi));
UDFPrint(("ESI=%8.8x ",PtrExceptionPointers->ContextRecord->Esi));
UDFPrint(("EDI=%8.8x ",PtrExceptionPointers->ContextRecord->Edi));
}
if(PtrExceptionPointers->ContextRecord->ContextFlags & CONTEXT_CONTROL) {
KdPrint(("EBP=%8.8x ",PtrExceptionPointers->ContextRecord->Esp));
KdPrint(("ESP=%8.8x\n",PtrExceptionPointers->ContextRecord->Ebp));
UDFPrint(("EBP=%8.8x ",PtrExceptionPointers->ContextRecord->Esp));
UDFPrint(("ESP=%8.8x\n",PtrExceptionPointers->ContextRecord->Ebp));
KdPrint(("EIP=%8.8x\n",PtrExceptionPointers->ContextRecord->Eip));
UDFPrint(("EIP=%8.8x\n",PtrExceptionPointers->ContextRecord->Eip));
}
// KdPrint(("Flags: %s %s ",PtrExceptionPointers->ContextRecord->Eip));
// UDFPrint(("Flags: %s %s ",PtrExceptionPointers->ContextRecord->Eip));
#endif //_X86_
#endif // UDF_DBG
@ -319,7 +319,7 @@ UDFExceptionFilter(
// better free up the IrpContext now ...
if (PtrIrpContext) {
KdPrint((" UDF Driver internal error\n"));
UDFPrint((" UDF Driver internal error\n"));
BrutePoint();
} else {
// we are not ok, propagate this exception.
@ -366,12 +366,12 @@ UDFExceptionHandler(
PVPB Vpb;
PETHREAD Thread;
KdPrint(("UDFExceptionHandler \n"));
UDFPrint(("UDFExceptionHandler \n"));
// ASSERT(Irp);
if (!Irp) {
KdPrint((" !Irp, return\n"));
UDFPrint((" !Irp, return\n"));
ASSERT(!PtrIrpContext);
return ExceptionCode;
}
@ -383,7 +383,7 @@ UDFExceptionHandler(
// Free irp context here
// UDFReleaseIrpContext(PtrIrpContext);
} else {
KdPrint((" complete Irp and return\n"));
UDFPrint((" complete Irp and return\n"));
// must be insufficient resources ...?
ExceptionCode = STATUS_INSUFFICIENT_RESOURCES;
Irp->IoStatus.Status = ExceptionCode;
@ -408,7 +408,7 @@ UDFExceptionHandler(
if (ExceptionCode == STATUS_VERIFY_REQUIRED) {
if (KeGetCurrentIrql() >= APC_LEVEL) {
KdPrint((" use UDFPostRequest()\n"));
UDFPrint((" use UDFPostRequest()\n"));
ExceptionCode = UDFPostRequest( PtrIrpContext, Irp );
}
}
@ -417,7 +417,7 @@ UDFExceptionHandler(
if ((ExceptionCode == STATUS_PENDING) ||
(ExceptionCode == STATUS_CANT_WAIT)) {
KdPrint((" STATUS_PENDING/STATUS_CANT_WAIT, return\n"));
UDFPrint((" STATUS_PENDING/STATUS_CANT_WAIT, return\n"));
return ExceptionCode;
}
@ -448,7 +448,7 @@ UDFExceptionHandler(
// Let's not BugCheck just because the driver screwed up.
if (Device == NULL) {
KdPrint((" Device == NULL, return\n"));
UDFPrint((" Device == NULL, return\n"));
ExceptionCode = STATUS_DRIVER_INTERNAL_ERROR;
Irp->IoStatus.Status = ExceptionCode;
Irp->IoStatus.Information = 0;
@ -461,7 +461,7 @@ UDFExceptionHandler(
}
}
KdPrint((" use UDFPerformVerify()\n"));
UDFPrint((" use UDFPerformVerify()\n"));
// UDFPerformVerify() will do the right thing with the Irp.
// If we return STATUS_CANT_WAIT then the current thread
// can retry the request.
@ -475,7 +475,7 @@ UDFExceptionHandler(
if (FlagOn( PtrIrpContext->IrpContextFlags, UDF_IRP_CONTEXT_FLAG_DISABLE_POPUPS )) {
KdPrint((" DISABLE_POPUPS, complete Irp and return\n"));
UDFPrint((" DISABLE_POPUPS, complete Irp and return\n"));
Irp->IoStatus.Status = ExceptionCode;
Irp->IoStatus.Information = 0;
// complete the IRP
@ -506,7 +506,7 @@ UDFExceptionHandler(
// Let's not BugCheck just because the driver screwed up.
if (Device == NULL) {
KdPrint((" Device == NULL, return(2)\n"));
UDFPrint((" Device == NULL, return(2)\n"));
Irp->IoStatus.Status = ExceptionCode;
Irp->IoStatus.Information = 0;
// complete the IRP
@ -528,7 +528,7 @@ UDFExceptionHandler(
// We will be handing control back to the caller here, so
// reset the saved device object.
KdPrint((" use IoSetDeviceToVerify()\n"));
UDFPrint((" use IoSetDeviceToVerify()\n"));
IoSetDeviceToVerify( Thread, NULL );
// The Irp will be completed by Io or resubmitted. In either
// case we must clean up the IrpContext here.
@ -540,7 +540,7 @@ UDFExceptionHandler(
// If it was a normal request from IOManager then complete it
if (Irp) {
KdPrint((" complete Irp\n"));
UDFPrint((" complete Irp\n"));
// set the error code in the IRP
Irp->IoStatus.Status = ExceptionCode;
Irp->IoStatus.Information = 0;
@ -551,7 +551,7 @@ UDFExceptionHandler(
UDFReleaseIrpContext(PtrIrpContext);
}
KdPrint((" return from exception handler with code %x\n", ExceptionCode));
UDFPrint((" return from exception handler with code %x\n", ExceptionCode));
return(ExceptionCode);
} // end UDFExceptionHandler()
@ -725,7 +725,7 @@ UDFAllocateCCB(VOID)
// if we failed to obtain from the zone, get it directly from the VMM
Ccb = (PtrUDFCCB)MyAllocatePool__(NonPagedPool, UDFQuadAlign(sizeof(UDFCCB)));
AllocatedFromZone = FALSE;
// KdPrint((" CCB allocated @%x\n",Ccb));
// UDFPrint((" CCB allocated @%x\n",Ccb));
}
if (!Ccb) {
@ -744,7 +744,7 @@ UDFAllocateCCB(VOID)
UDFSetFlag(Ccb->CCBFlags, UDF_CCB_NOT_FROM_ZONE);
}
KdPrint(("UDFAllocateCCB: %x\n", Ccb));
UDFPrint(("UDFAllocateCCB: %x\n", Ccb));
return(Ccb);
} // end UDFAllocateCCB()
@ -773,7 +773,7 @@ UDFReleaseCCB(
ASSERT(Ccb);
KdPrint(("UDFReleaseCCB: %x\n", Ccb));
UDFPrint(("UDFReleaseCCB: %x\n", Ccb));
// give back memory either to the zone or to the VMM
if(!(Ccb->CCBFlags & UDF_CCB_NOT_FROM_ZONE)) {
// back to the zone
@ -868,7 +868,7 @@ UDFAllocateFCB(VOID)
Fcb->NodeIdentifier.NodeType = UDF_NODE_TYPE_FCB;
Fcb->NodeIdentifier.NodeSize = UDFQuadAlign(sizeof(UDFFCB));
KdPrint(("UDFAllocateFCB: %x\n", Fcb));
UDFPrint(("UDFAllocateFCB: %x\n", Fcb));
return(Fcb);
} // end UDFAllocateFCB()
@ -909,7 +909,7 @@ UDFCleanUpFCB(
PtrUDFFCB Fcb
)
{
KdPrint(("UDFCleanUpFCB: %x\n", Fcb));
UDFPrint(("UDFCleanUpFCB: %x\n", Fcb));
if(!Fcb) return;
ASSERT(Fcb->NodeIdentifier.NodeType == UDF_NODE_TYPE_FCB);
@ -927,7 +927,7 @@ UDFCleanUpFCB(
}
#ifdef UDF_DBG
else {
KdPrint(("UDF: Fcb has invalid FCBName Buffer\n"));
UDFPrint(("UDF: Fcb has invalid FCBName Buffer\n"));
BrutePoint();
}
#endif
@ -936,7 +936,7 @@ UDFCleanUpFCB(
}
#ifdef UDF_DBG
else {
KdPrint(("UDF: Fcb has invalid FCBName field\n"));
UDFPrint(("UDF: Fcb has invalid FCBName field\n"));
BrutePoint();
}
#endif
@ -1224,7 +1224,7 @@ UDFCommonDispatch(
(PtrIrpContext->NodeIdentifier.NodeType != UDF_NODE_TYPE_IRP_CONTEXT) ||
(PtrIrpContext->NodeIdentifier.NodeSize != UDFQuadAlign(sizeof(UDFIrpContext))) /*||
!(PtrIrpContext->Irp)*/) {
KdPrint((" Invalid Context\n"));
UDFPrint((" Invalid Context\n"));
BrutePoint();
return;
}
@ -1232,11 +1232,11 @@ UDFCommonDispatch(
Vcb = (PVCB)(PtrIrpContext->TargetDeviceObject->DeviceExtension);
ASSERT(Vcb);
KdPrint((" *** Thr: %x ThCnt: %x QCnt: %x Started!\n", PsGetCurrentThread(), Vcb->PostedRequestCount, Vcb->OverflowQueueCount));
UDFPrint((" *** Thr: %x ThCnt: %x QCnt: %x Started!\n", PsGetCurrentThread(), Vcb->PostedRequestCount, Vcb->OverflowQueueCount));
while(TRUE) {
KdPrint((" Next IRP\n"));
UDFPrint((" Next IRP\n"));
FsRtlEnterFileSystem();
// Get a pointer to the IRP structure
@ -1263,7 +1263,7 @@ UDFCommonDispatch(
// either in the IrpContext (copied from the IRP), or directly from the
// IRP itself (we will need a pointer to the stack location to do that),
// Then, switch based on the value on the Major Function code
KdPrint((" *** MJ: %x, Thr: %x\n", PtrIrpContext->MajorFunction, PsGetCurrentThread()));
UDFPrint((" *** MJ: %x, Thr: %x\n", PtrIrpContext->MajorFunction, PsGetCurrentThread()));
switch (PtrIrpContext->MajorFunction) {
case IRP_MJ_CREATE:
// Invoke the common create routine
@ -1332,7 +1332,7 @@ UDFCommonDispatch(
#endif // UDF_ENABLE_SECURITY
// Continue with the remaining possible dispatch routines below ...
default:
KdPrint((" unhandled *** MJ: %x, Thr: %x\n", PtrIrpContext->MajorFunction, PsGetCurrentThread()));
UDFPrint((" unhandled *** MJ: %x, Thr: %x\n", PtrIrpContext->MajorFunction, PsGetCurrentThread()));
// This is the case where we have an invalid major function
Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
Irp->IoStatus.Information = 0;
@ -1344,7 +1344,7 @@ UDFCommonDispatch(
}
// Note: PtrIrpContext is invalid here
KdPrint((" *** Thr: %x Done!\n", PsGetCurrentThread()));
UDFPrint((" *** Thr: %x Done!\n", PsGetCurrentThread()));
} _SEH2_EXCEPT(UDFExceptionFilter(PtrIrpContext, _SEH2_GetExceptionInformation())) {
@ -1386,7 +1386,7 @@ UDFCommonDispatch(
Vcb->PostedRequestCount--;
KeReleaseSpinLock(&(Vcb->OverflowQueueSpinLock), SavedIrql);
KdPrint((" *** Thr: %x ThCnt: %x QCnt: %x Terminated!\n", PsGetCurrentThread(), Vcb->PostedRequestCount, Vcb->OverflowQueueCount));
UDFPrint((" *** Thr: %x ThCnt: %x QCnt: %x Terminated!\n", PsGetCurrentThread(), Vcb->PostedRequestCount, Vcb->OverflowQueueCount));
return;
} // end UDFCommonDispatch()
@ -1637,7 +1637,7 @@ Kill_DevName_buffer:
}
}
KdPrint((" TargetDevName: %S\n", Vcb->TargetDevName.Buffer));
UDFPrint((" TargetDevName: %S\n", Vcb->TargetDevName.Buffer));
// Initialize caching for the stream file object.
//CcInitializeCacheMap(Vcb->PtrStreamFileObject, (PCC_FILE_SIZES)(&(Vcb->AllocationSize)),
@ -2138,18 +2138,18 @@ UDFReleaseVCB(
)
{
LARGE_INTEGER delay;
KdPrint(("UDFReleaseVCB\n"));
UDFPrint(("UDFReleaseVCB\n"));
delay.QuadPart = -500000; // 0.05 sec
while(Vcb->PostedRequestCount) {
KdPrint(("UDFReleaseVCB: PostedRequestCount = %d\n", Vcb->PostedRequestCount));
UDFPrint(("UDFReleaseVCB: PostedRequestCount = %d\n", Vcb->PostedRequestCount));
// spin until all queues IRPs are processed
KeDelayExecutionThread(KernelMode, FALSE, &delay);
delay.QuadPart -= 500000; // grow delay 0.05 sec
}
_SEH2_TRY {
KdPrint(("UDF: Flushing buffers\n"));
UDFPrint(("UDF: Flushing buffers\n"));
UDFVRelease(Vcb);
WCacheFlushAll__(&(Vcb->FastCache),Vcb);
WCacheRelease__(&(Vcb->FastCache));
@ -2161,8 +2161,8 @@ UDFReleaseVCB(
#ifdef UDF_DBG
_SEH2_TRY {
if (!ExIsResourceAcquiredShared(&UDFGlobalData.GlobalDataResource)) {
KdPrint(("UDF: attempt to access to not protected data\n"));
KdPrint(("UDF: UDFGlobalData\n"));
UDFPrint(("UDF: attempt to access to not protected data\n"));
UDFPrint(("UDF: UDFGlobalData\n"));
BrutePoint();
}
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
@ -2185,7 +2185,7 @@ UDFReleaseVCB(
}*/
_SEH2_TRY {
KdPrint(("UDF: Delete resources\n"));
UDFPrint(("UDF: Delete resources\n"));
UDFDeleteResource(&(Vcb->VCBResource));
UDFDeleteResource(&(Vcb->BitMapResource1));
UDFDeleteResource(&(Vcb->FcbListResource));
@ -2200,7 +2200,7 @@ UDFReleaseVCB(
} _SEH2_END;
_SEH2_TRY {
KdPrint(("UDF: Cleanup VCB\n"));
UDFPrint(("UDF: Cleanup VCB\n"));
ASSERT(IsListEmpty(&(Vcb->NextNotifyIRP)));
FsRtlNotifyUninitializeSync(&(Vcb->NotifyIRPMutex));
UDFCleanupVCB(Vcb);
@ -2209,7 +2209,7 @@ UDFReleaseVCB(
} _SEH2_END;
_SEH2_TRY {
KdPrint(("UDF: Delete DO\n"));
UDFPrint(("UDF: Delete DO\n"));
IoDeleteDevice(Vcb->VCBDeviceObject);
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
BrutePoint();
@ -2263,12 +2263,12 @@ UDFRegCheckParameterValue(
paramPath.Buffer = (PWCH)MyAllocatePool__(PagedPool, paramPath.MaximumLength);
if(!paramPath.Buffer) {
KdPrint(("UDFCheckRegValue: couldn't allocate paramPath\n"));
UDFPrint(("UDFCheckRegValue: couldn't allocate paramPath\n"));
try_return(val = DefValue);
}
paramPathUnknown.Buffer = (PWCH)MyAllocatePool__(PagedPool, paramPathUnknown.MaximumLength);
if(!paramPathUnknown.Buffer) {
KdPrint(("UDFCheckRegValue: couldn't allocate paramPathUnknown\n"));
UDFPrint(("UDFCheckRegValue: couldn't allocate paramPathUnknown\n"));
try_return(val = DefValue);
}
@ -2281,7 +2281,7 @@ UDFRegCheckParameterValue(
if(!NT_SUCCESS(status)) {
try_return(val = DefValue);
}
KdPrint(("UDFCheckRegValue: (1) |%S|\n", paramPath.Buffer));
UDFPrint(("UDFCheckRegValue: (1) |%S|\n", paramPath.Buffer));
RtlZeroMemory(paramPathUnknown.Buffer, paramPathUnknown.MaximumLength);
status = RtlAppendUnicodeToString(&paramPathUnknown, RegistryPath->Buffer);
@ -2296,7 +2296,7 @@ UDFRegCheckParameterValue(
if(!NT_SUCCESS(status)) {
try_return(val = DefValue);
}
KdPrint(("UDFCheckRegValue: (2) |%S|\n", paramPathUnknown.Buffer));
UDFPrint(("UDFCheckRegValue: (2) |%S|\n", paramPathUnknown.Buffer));
// First append \Parameters\Default_XXX to the passed in registry path
if(DefaultPath) {
@ -2305,7 +2305,7 @@ UDFRegCheckParameterValue(
defaultParamPath.MaximumLength = paramPath.Length + defaultParamStr.Length + sizeof(WCHAR);
defaultParamPath.Buffer = (PWCH)MyAllocatePool__(PagedPool, defaultParamPath.MaximumLength);
if(!defaultParamPath.Buffer) {
KdPrint(("UDFCheckRegValue: couldn't allocate defaultParamPath\n"));
UDFPrint(("UDFCheckRegValue: couldn't allocate defaultParamPath\n"));
try_return(val = DefValue);
}
@ -2318,7 +2318,7 @@ UDFRegCheckParameterValue(
if(!NT_SUCCESS(status)) {
try_return(val = DefValue);
}
KdPrint(("UDFCheckRegValue: (3) |%S|\n", defaultParamPath.Buffer));
UDFPrint(("UDFCheckRegValue: (3) |%S|\n", defaultParamPath.Buffer));
}
if(PtrVolumePath) {
@ -2347,7 +2347,7 @@ UDFRegCheckParameterValue(
}
}
KdPrint(( " Parameter = %ws\n", Name));
UDFPrint(( " Parameter = %ws\n", Name));
{
HKEY hk = NULL;
@ -2393,7 +2393,7 @@ try_exit: NOTHING;
}
} _SEH2_END;
KdPrint(( "UDFCheckRegValue: %ws for drive %s is %x\n\n", Name, PtrVolumePath, val));
UDFPrint(( "UDFCheckRegValue: %ws for drive %s is %x\n\n", Name, PtrVolumePath, val));
return val;
} // end UDFRegCheckParameterValue()
@ -2489,7 +2489,7 @@ UDFQuerySetEA(
// PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
KdPrint(("UDFQuerySetEA: \n"));
UDFPrint(("UDFQuerySetEA: \n"));
FsRtlEnterFileSystem();
ASSERT(DeviceObject);
@ -2533,7 +2533,7 @@ UDFAcquireResourceExclusiveWithCheck(
ExIsResourceAcquiredExclusiveLite(Resource) ? 1 :
(ExIsResourceAcquiredSharedLite(Resource) ? 2 : 0);
if(ReAcqRes) {
KdPrint(("UDFAcquireResourceExclusiveWithCheck: ReAcqRes, %x\n", ReAcqRes));
UDFPrint(("UDFAcquireResourceExclusiveWithCheck: ReAcqRes, %x\n", ReAcqRes));
} else {
// BrutePoint();
}
@ -2542,7 +2542,7 @@ UDFAcquireResourceExclusiveWithCheck(
// OK
} else
if(ReAcqRes == 2) {
KdPrint(("UDFAcquireResourceExclusiveWithCheck: !!! Shared !!!\n"));
UDFPrint(("UDFAcquireResourceExclusiveWithCheck: !!! Shared !!!\n"));
//BrutePoint();
} else {
UDFAcquireResourceExclusive(Resource, TRUE);
@ -2560,7 +2560,7 @@ UDFAcquireResourceSharedWithCheck(
ExIsResourceAcquiredExclusiveLite(Resource) ? 1 :
(ExIsResourceAcquiredSharedLite(Resource) ? 2 : 0);
if(ReAcqRes) {
KdPrint(("UDFAcquireResourceSharedWithCheck: ReAcqRes, %x\n", ReAcqRes));
UDFPrint(("UDFAcquireResourceSharedWithCheck: ReAcqRes, %x\n", ReAcqRes));
/* } else {
BrutePoint();*/
}
@ -2569,7 +2569,7 @@ UDFAcquireResourceSharedWithCheck(
// OK
} else
if(ReAcqRes == 1) {
KdPrint(("UDFAcquireResourceSharedWithCheck: Exclusive\n"));
UDFPrint(("UDFAcquireResourceSharedWithCheck: Exclusive\n"));
//BrutePoint();
} else {
UDFAcquireResourceShared(Resource, TRUE);

View file

@ -87,7 +87,7 @@ UDFPnp (
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel;
KdPrint(("UDFPnp\n"));
UDFPrint(("UDFPnp\n"));
ASSERT(FALSE);
FsRtlEnterFileSystem();
@ -150,7 +150,7 @@ UDFCommonPnp (
NTSTATUS RC;
PIO_STACK_LOCATION IrpSp;
PVCB Vcb;
KdPrint(("UDFCommonPnp\n"));
UDFPrint(("UDFCommonPnp\n"));
_SEH2_TRY {
// Get the current Irp stack location.
@ -195,7 +195,7 @@ UDFCommonPnp (
break;*/
default:
KdPrint(("UDFCommonPnp: pass through\n"));
UDFPrint(("UDFCommonPnp: pass through\n"));
// Just pass the IRP on. As we do not need to be in the
// way on return, ellide ourselves out of the stack.
IoSkipCurrentIrpStackLocation( Irp );

View file

@ -124,7 +124,7 @@ UDFPostStackOverflowRead(
PKEVENT Event;
PERESOURCE Resource;
KdPrint(("Getting too close to stack limit pass request to Fsp\n"));
UDFPrint(("Getting too close to stack limit pass request to Fsp\n"));
// Allocate an event and get shared on the resource we will
// be later using the common read.
@ -190,7 +190,7 @@ UDFStackOverflowRead(
PtrUDFIrpContext PtrIrpContext = (PtrUDFIrpContext)Context;
NTSTATUS RC;
KdPrint(("UDFStackOverflowRead: \n"));
UDFPrint(("UDFStackOverflowRead: \n"));
// Make it now look like we can wait for I/O to complete
PtrIrpContext->IrpContextFlags |= UDF_IRP_CONTEXT_CAN_BLOCK;
@ -264,27 +264,27 @@ UDFCommonRead(
TopIrp = IoGetTopLevelIrp();
switch((ULONG)TopIrp) {
case FSRTL_FSP_TOP_LEVEL_IRP:
KdPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n"));
break;
case FSRTL_CACHE_TOP_LEVEL_IRP:
KdPrint((" FSRTL_CACHE_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_CACHE_TOP_LEVEL_IRP\n"));
break;
case FSRTL_MOD_WRITE_TOP_LEVEL_IRP:
KdPrint((" FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
// BrutePoint()
break;
case FSRTL_FAST_IO_TOP_LEVEL_IRP:
KdPrint((" FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
// BrutePoint()
break;
case NULL:
KdPrint((" NULL TOP_LEVEL_IRP\n"));
UDFPrint((" NULL TOP_LEVEL_IRP\n"));
break;
default:
if(TopIrp == Irp) {
KdPrint((" TOP_LEVEL_IRP\n"));
UDFPrint((" TOP_LEVEL_IRP\n"));
} else {
KdPrint((" RECURSIVE_IRP, TOP = %x\n", TopIrp));
UDFPrint((" RECURSIVE_IRP, TOP = %x\n", TopIrp));
}
break;
}
@ -345,7 +345,7 @@ UDFCommonRead(
PagingIo = (Irp->Flags & IRP_PAGING_IO) ? TRUE : FALSE;
NonBufferedIo = (Irp->Flags & IRP_NOCACHE) ? TRUE : FALSE;
SynchronousIo = (FileObject->Flags & FO_SYNCHRONOUS_IO) ? TRUE : FALSE;
KdPrint((" Flags: %s %s %s %s\n",
UDFPrint((" Flags: %s %s %s %s\n",
CanWait ? "W" : "w", PagingIo ? "Pg" : "pg",
NonBufferedIo ? "NBuf" : "buff", SynchronousIo ? "Snc" : "Asc"));
@ -368,7 +368,7 @@ UDFCommonRead(
// a 0 byte read can be immediately succeeded
try_return(RC);
}
KdPrint((" ByteOffset = %I64x, ReadLength = %x\n", ByteOffset.QuadPart, ReadLength));
UDFPrint((" ByteOffset = %I64x, ReadLength = %x\n", ByteOffset.QuadPart, ReadLength));
// Is this a read of the volume itself ?
if (Fcb->NodeIdentifier.NodeType == UDF_NODE_TYPE_VCB) {
@ -382,7 +382,7 @@ UDFCommonRead(
if(PtrIrpContext->IrpContextFlags & UDF_IRP_CONTEXT_FLUSH2_REQUIRED) {
KdPrint((" UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
UDFPrint((" UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
PtrIrpContext->IrpContextFlags &= ~UDF_IRP_CONTEXT_FLUSH2_REQUIRED;
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK)) {
@ -396,7 +396,7 @@ UDFCommonRead(
if(PtrIrpContext->IrpContextFlags & UDF_IRP_CONTEXT_FLUSH_REQUIRED) {
KdPrint((" UDF_IRP_CONTEXT_FLUSH_REQUIRED\n"));
UDFPrint((" UDF_IRP_CONTEXT_FLUSH_REQUIRED\n"));
PtrIrpContext->IrpContextFlags &= ~UDF_IRP_CONTEXT_FLUSH_REQUIRED;
// Acquire the volume resource exclusive
@ -515,7 +515,7 @@ UDFCommonRead(
TruncatedLength = (ULONG)(NtReqFcb->CommonFCBHeader.FileSize.QuadPart - ByteOffset.QuadPart);
// we can't get ZERO here
}
KdPrint((" TruncatedLength = %x\n", TruncatedLength));
UDFPrint((" TruncatedLength = %x\n", TruncatedLength));
// There are certain complications that arise when the same file stream
// has been opened for cached and non-cached access. The FSD is then
@ -685,11 +685,11 @@ UDFCommonRead(
#if 1
if((ULONG)TopIrp == FSRTL_MOD_WRITE_TOP_LEVEL_IRP) {
KdPrint(("FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n"));
UDFPrint(("FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n"));
CanWait = TRUE;
} else
if((ULONG)TopIrp == FSRTL_CACHE_TOP_LEVEL_IRP) {
KdPrint(("FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n"));
UDFPrint(("FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n"));
CanWait = TRUE;
}
@ -699,7 +699,7 @@ UDFCommonRead(
} else
{}
/* if((TopIrp != Irp)) {
KdPrint(("(TopIrp != Irp) => CanWait\n"));
UDFPrint(("(TopIrp != Irp) => CanWait\n"));
CanWait = TRUE;
} else*/
#endif
@ -831,7 +831,7 @@ try_exit: NOTHING;
if(!_SEH2_AbnormalTermination()) {
Irp->IoStatus.Status = RC;
Irp->IoStatus.Information = NumberBytesRead;
KdPrint((" NumberBytesRead = %x\n", NumberBytesRead));
UDFPrint((" NumberBytesRead = %x\n", NumberBytesRead));
// Free up the Irp Context
UDFReleaseIrpContext(PtrIrpContext);
// complete the IRP
@ -875,7 +875,7 @@ UDFGetCallersBuffer(
{
VOID *ReturnedBuffer = NULL;
KdPrint(("UDFGetCallersBuffer: \n"));
UDFPrint(("UDFGetCallersBuffer: \n"));
// If an MDL is supplied, use it.
if(Irp->MdlAddress) {
@ -943,7 +943,7 @@ UDFLockCallersBuffer(
NTSTATUS RC = STATUS_SUCCESS;
PMDL PtrMdl = NULL;
KdPrint(("UDFLockCallersBuffer: \n"));
UDFPrint(("UDFLockCallersBuffer: \n"));
ASSERT(Irp);
@ -1039,7 +1039,7 @@ UDFUnlockCallersBuffer(
{
NTSTATUS RC = STATUS_SUCCESS;
KdPrint(("UDFUnlockCallersBuffer: \n"));
UDFPrint(("UDFUnlockCallersBuffer: \n"));
ASSERT(Irp);
@ -1047,7 +1047,7 @@ UDFUnlockCallersBuffer(
// Is a nonPaged buffer already present in the IRP
if (PtrIrpContext->IrpContextFlags & UDF_IRP_CONTEXT_BUFFER_LOCKED) {
KdPrint((" UDF_IRP_CONTEXT_BUFFER_LOCKED MDL=%x, Irp MDL=%x\n", PtrIrpContext->PtrMdl, Irp->MdlAddress));
UDFPrint((" UDF_IRP_CONTEXT_BUFFER_LOCKED MDL=%x, Irp MDL=%x\n", PtrIrpContext->PtrMdl, Irp->MdlAddress));
if(PtrIrpContext->TransitionBuffer) {
MmPrint((" UDFUnlockCallersBuffer: free TransitionBuffer\n"));
DbgFreePool(PtrIrpContext->TransitionBuffer);
@ -1083,7 +1083,7 @@ UDFUnlockCallersBuffer(
if(Irp->MdlAddress) {
// MmPrint((" Irp->Mdl, MmUnmapLockedPages()\n"));
// MmUnmapLockedPages(SystemBuffer, Irp->MdlAddress);
KdPrint((" UDF_IRP_CONTEXT_BUFFER_LOCKED MDL=%x, Irp MDL=%x\n", PtrIrpContext->PtrMdl, Irp->MdlAddress));
UDFPrint((" UDF_IRP_CONTEXT_BUFFER_LOCKED MDL=%x, Irp MDL=%x\n", PtrIrpContext->PtrMdl, Irp->MdlAddress));
UDFTouch(Irp->MdlAddress);
KeFlushIoBuffers( Irp->MdlAddress,
((IoGetCurrentIrpStackLocation(Irp))->MajorFunction) == IRP_MJ_READ,
@ -1123,7 +1123,7 @@ BOOLEAN ReadCompletion)
NTSTATUS RC = STATUS_SUCCESS;
PFILE_OBJECT FileObject = NULL;
KdPrint(("UDFMdlComplete: \n"));
UDFPrint(("UDFMdlComplete: \n"));
FileObject = IrpSp->FileObject;
ASSERT(FileObject);

View file

@ -62,7 +62,7 @@ UDFGetSecurity(
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
KdPrint(("UDFGetSecurity\n"));
UDFPrint(("UDFGetSecurity\n"));
// BrutePoint();
FsRtlEnterFileSystem();
@ -137,7 +137,7 @@ UDFCommonGetSecurity(
PVOID PtrSystemBuffer = NULL;
ULONG BufferLength = 0;
KdPrint(("UDFCommonGetSecurity\n"));
UDFPrint(("UDFCommonGetSecurity\n"));
_SEH2_TRY {
@ -241,7 +241,7 @@ UDFSetSecurity(
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
KdPrint(("UDFSetSecurity\n"));
UDFPrint(("UDFSetSecurity\n"));
// BrutePoint();
FsRtlEnterFileSystem();
@ -314,7 +314,7 @@ UDFCommonSetSecurity(
PtrUDFCCB Ccb = NULL;
ACCESS_MASK DesiredAccess = 0;
KdPrint(("UDFCommonSetSecurity\n"));
UDFPrint(("UDFCommonSetSecurity\n"));
_SEH2_TRY {
@ -362,7 +362,7 @@ UDFCommonSetSecurity(
UDFConvertToSelfRelative(&(NtReqFcb->SecurityDesc));
KdDump(NtReqFcb->SecurityDesc, RtlLengthSecurityDescriptor(NtReqFcb->SecurityDesc));
KdPrint(("\n"));
UDFPrint(("\n"));
RC = SeSetSecurityDescriptorInfo(/*FileObject*/ NULL,
&(IrpSp->Parameters.SetSecurity.SecurityInformation),
@ -431,18 +431,18 @@ UDFReadSecurity(
ULONG NumberBytesRead;
PERESOURCE Res1 = NULL;
KdPrint(("UDFReadSecurity\n"));
UDFPrint(("UDFReadSecurity\n"));
_SEH2_TRY {
FileInfo = Fcb->FileInfo;
ASSERT(FileInfo);
if(!FileInfo) {
KdPrint((" Volume Security\n"));
UDFPrint((" Volume Security\n"));
try_return(RC = STATUS_NO_SECURITY_ON_OBJECT);
}
if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
KdPrint((" No Security on blank volume\n"));
UDFPrint((" No Security on blank volume\n"));
try_return(RC = STATUS_NO_SECURITY_ON_OBJECT);
}
@ -532,7 +532,7 @@ UDFConvertToSelfRelative(
PSECURITY_DESCRIPTOR NewSD;
ULONG Len;
KdPrint((" UDFConvertToSelfRelative\n"));
UDFPrint((" UDFConvertToSelfRelative\n"));
if(!(*SecurityDesc))
return STATUS_NO_SECURITY_ON_OBJECT;
@ -569,7 +569,7 @@ UDFInheritAcl(
SECURITY_INFORMATION SecurityInformation;
ULONG Len;
KdPrint((" UDFInheritAcl\n"));
UDFPrint((" UDFInheritAcl\n"));
if(!(*ParentSecurityDesc)) {
*SecurityDesc = NULL;
@ -603,7 +603,7 @@ UDFBuildEmptyAcl(
NTSTATUS RC;
ULONG Len = 2 * (sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE) + sizeof(ULONG)*4 /*RtlLengthSid(SeExports->SeWorldSid)*/);
KdPrint((" UDFBuildEmptyAcl\n"));
UDFPrint((" UDFBuildEmptyAcl\n"));
// Create Security Descriptor
(*SecurityDesc) = (PSECURITY_DESCRIPTOR)DbgAllocatePool(NonPagedPool,
sizeof(SECURITY_DESCRIPTOR) + Len);
@ -629,7 +629,7 @@ UDFBuildFullControlAcl(
PACL Acl;
ULONG Len = sizeof(ACL) + 2*(sizeof(ACCESS_ALLOWED_ACE) + sizeof(ULONG)*4 /*- sizeof(ULONG)*/ /*+ RtlLengthSid(SeExports->SeWorldSid)*/);
KdPrint((" UDFBuildFullControlAcl\n"));
UDFPrint((" UDFBuildFullControlAcl\n"));
// Create Security Descriptor
RC = UDFBuildEmptyAcl(Vcb, SecurityDesc);
if(!NT_SUCCESS(RC))
@ -714,7 +714,7 @@ UDFAssignAcl(
#ifdef UDF_ENABLE_SECURITY
// SECURITY_INFORMATION SecurityInformation;
// KdPrint((" UDFAssignAcl\n"));
// UDFPrint((" UDFAssignAcl\n"));
if(!NtReqFcb->SecurityDesc) {
PSECURITY_DESCRIPTOR ExplicitSecurity = NULL;
@ -777,7 +777,7 @@ UDFDeassignAcl(
#ifdef UDF_ENABLE_SECURITY
// NTSTATUS RC = STATUS_SUCCESS;
// KdPrint((" UDFDeassignAcl\n"));
// UDFPrint((" UDFDeassignAcl\n"));
if(!NtReqFcb->SecurityDesc)
return;
@ -807,7 +807,7 @@ UDFWriteSecurity(
NTSTATUS RC;
ULONG NumberBytesRead;
// KdPrint(("UDFWriteSecurity\n"));
// UDFPrint(("UDFWriteSecurity\n"));
#if !defined(UDF_READ_ONLY_BUILD)
@ -826,7 +826,7 @@ UDFWriteSecurity(
FileInfo = Fcb->FileInfo;
ASSERT(FileInfo);
if(!FileInfo) {
KdPrint((" Volume Security\n"));
UDFPrint((" Volume Security\n"));
try_return(RC = STATUS_SUCCESS);
}

View file

@ -53,7 +53,7 @@ UDFShutdown(
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
KdPrint(("UDFShutDown\n"));
UDFPrint(("UDFShutDown\n"));
// BrutePoint();
FsRtlEnterFileSystem();
@ -124,7 +124,7 @@ UDFCommonShutdown(
PPREVENT_MEDIA_REMOVAL_USER_IN Buf = NULL;
LARGE_INTEGER delay;
KdPrint(("UDFCommonShutdown\n"));
UDFPrint(("UDFCommonShutdown\n"));
_SEH2_TRY {
// First, get a pointer to the current I/O stack location
@ -168,7 +168,7 @@ UDFCommonShutdown(
#ifdef UDF_DELAYED_CLOSE
UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
KdPrint((" UDFCommonShutdown: set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
UDFPrint((" UDFCommonShutdown: set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_NO_DELAYED_CLOSE;
UDFReleaseResource(&(Vcb->VCBResource));
#endif //UDF_DELAYED_CLOSE
@ -178,7 +178,7 @@ UDFCommonShutdown(
// release GlobalDataResource and re-acquire it later.
UDFReleaseResource( &(UDFGlobalData.GlobalDataResource) );
if(Vcb->RootDirFCB && Vcb->RootDirFCB->FileInfo) {
KdPrint((" UDFCommonShutdown: UDFCloseAllSystemDelayedInDir\n"));
UDFPrint((" UDFCommonShutdown: UDFCloseAllSystemDelayedInDir\n"));
RC = UDFCloseAllSystemDelayedInDir(Vcb, Vcb->RootDirFCB->FileInfo);
ASSERT(OS_SUCCESS(RC));
}

View file

@ -22,7 +22,7 @@ UDFDebugAcquireResourceSharedLite(
) {
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
#ifdef TRACK_RESOURCES
KdPrint(("Res:Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
@ -45,14 +45,14 @@ UDFDebugAcquireResourceSharedLite(
if(Success) {
#ifdef TRACK_RESOURCES
KdPrint(("Res:Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
AcqCounter++;
return Success;
}
#ifdef TRACK_RESOURCES
KdPrint(("Res:Sha:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Sha:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
return FALSE;
@ -67,7 +67,7 @@ UDFDebugAcquireSharedStarveExclusive(
) {
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
#ifdef TRACK_RESOURCES
KdPrint(("Res:Sha*:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Sha*:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
@ -90,14 +90,14 @@ UDFDebugAcquireSharedStarveExclusive(
if(Success) {
#ifdef TRACK_RESOURCES
KdPrint(("Res:Sha*:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Sha*:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
AcqCounter++;
return Success;
}
#ifdef TRACK_RESOURCES
KdPrint(("Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
return FALSE;
@ -112,7 +112,7 @@ UDFDebugAcquireResourceExclusiveLite(
) {
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
#ifdef TRACK_RESOURCES
KdPrint(("Res:Exc:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Exc:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
@ -138,14 +138,14 @@ UDFDebugAcquireResourceExclusiveLite(
if(Success) {
#ifdef TRACK_RESOURCES
KdPrint(("Res:Exc:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Exc:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
AcqCounter++;
return Success;
}
#ifdef TRACK_RESOURCES
KdPrint(("Res:Exc:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Exc:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
// BrutePoint();
@ -163,12 +163,12 @@ UDFDebugReleaseResourceForThreadLite(
{
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
#ifdef TRACK_RESOURCES
KdPrint(("Res:Free:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Free:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
ExReleaseResourceForThreadLite(Resource, ResourceThreadId);
#ifdef TRACK_RESOURCES
KdPrint(("Res:Free:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Free:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
AcqCounter--;
@ -184,7 +184,7 @@ UDFDebugDeleteResource(
{
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
#ifdef TRACK_RESOURCES
KdPrint(("Res:Del:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Del:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
_SEH2_TRY {
@ -196,7 +196,7 @@ UDFDebugDeleteResource(
BrutePoint();
} _SEH2_END;
#ifdef TRACK_RESOURCES
KdPrint(("Res:Del:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Del:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
ResCounter--;
@ -213,14 +213,14 @@ UDFDebugInitializeResourceLite(
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
NTSTATUS RC;
#ifdef TRACK_RESOURCES
KdPrint(("Res:Ini:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Ini:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
ASSERT(!(*((PULONG)Resource)));
ASSERT(!(*(((PULONG)Resource)+1)));
RC = ExInitializeResourceLite(Resource);
#ifdef TRACK_RESOURCES
KdPrint(("Res:Ini:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Ini:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
if(NT_SUCCESS(RC)) {
@ -239,12 +239,12 @@ UDFDebugConvertExclusiveToSharedLite(
{
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
#ifdef TRACK_RESOURCES
KdPrint(("Res:2Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:2Sha:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
ExConvertExclusiveToSharedLite(Resource);
#ifdef TRACK_RESOURCES
KdPrint(("Res:2Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:2Sha:Ok:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,ResourceThreadId));
#endif
}
@ -258,7 +258,7 @@ UDFDebugAcquireSharedWaitForExclusive(
) {
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
#ifdef TRACK_RESOURCES
KdPrint(("Res:Sha*:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Sha*:Try:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
@ -282,13 +282,13 @@ UDFDebugAcquireSharedWaitForExclusive(
if(Success) {
#ifdef TRACK_RESOURCES
KdPrint(("Res:Sha*:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Sha*:OK:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
return Success;
}
#ifdef TRACK_RESOURCES
KdPrint(("Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
UDFPrint(("Res:Sha*:Fail:Resource:%x:BugCheckId:%x:Line:%d:ThId:%x\n",Resource,
BugCheckId,Line,PsGetCurrentThread()));
#endif
// BrutePoint();
@ -306,7 +306,7 @@ UDFDebugInterlockedIncrement(
#ifdef TRACK_REF_COUNTERS
LONG a;
a = InterlockedIncrement(addr);
KdPrint(("ThId:%x:Ilck:Inc:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
UDFPrint(("ThId:%x:Ilck:Inc:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
PsGetCurrentThread(),BugCheckId,Line,addr,a-1,a));
return a;
#else
@ -323,7 +323,7 @@ UDFDebugInterlockedDecrement(
#ifdef TRACK_REF_COUNTERS
LONG a;
a = InterlockedDecrement(addr);
KdPrint(("ThId:%x:Ilck:Dec:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
UDFPrint(("ThId:%x:Ilck:Dec:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
PsGetCurrentThread(),BugCheckId,Line,addr,a+1,a));
return a;
#else
@ -341,7 +341,7 @@ UDFDebugInterlockedExchangeAdd(
#ifdef TRACK_REF_COUNTERS
LONG a;
a = InterlockedExchangeAdd(addr,i);
KdPrint(("ThId:%x:Ilck:Add:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
UDFPrint(("ThId:%x:Ilck:Add:FileId:%x:Line:%d:Ref:%x:Val:%x:%x\n",
PsGetCurrentThread(),BugCheckId,Line,addr,a,a+i));
return a;
#else
@ -378,7 +378,7 @@ DebugAllocatePool(
#endif //TRACK_SYS_ALLOC_CALLERS
) {
ULONG i;
// KdPrint(("SysAllocated: %x\n",AllocCount));
// UDFPrint(("SysAllocated: %x\n",AllocCount));
if(!MemDescInited) {
RtlZeroMemory(&MemDesc, sizeof(MemDesc));
MemDescInited = 1;
@ -407,7 +407,7 @@ DebugAllocatePool(
}
}
if(cur_max == MAX_MEM_DEBUG_DESCRIPTORS) {
KdPrint(("Debug memory descriptor list full\n"));
UDFPrint(("Debug memory descriptor list full\n"));
return ExAllocatePoolWithTag(Type, (size) , 'Fnwd');
}
@ -456,11 +456,11 @@ VOID DebugFreePool(PVOID addr) {
}
}
if (i==cur_max && cur_max != MAX_MEM_DEBUG_DESCRIPTORS) {
KdPrint(("Buug! - Deallocating nonallocated block\n"));
UDFPrint(("Buug! - Deallocating nonallocated block\n"));
return;
}
not_bug:
// KdPrint(("SysAllocated: %x\n",AllocCount));
// UDFPrint(("SysAllocated: %x\n",AllocCount));
ExFreePool(addr);
}
@ -470,7 +470,7 @@ UDFWaitForSingleObject(
IN PLARGE_INTEGER Timeout OPTIONAL
)
{
KdPrint(("UDFWaitForSingleObject\n"));
UDFPrint(("UDFWaitForSingleObject\n"));
LARGE_INTEGER LocalTimeout;
LARGE_INTEGER delay;
delay.QuadPart = -(WAIT_FOR_XXX_EMU_DELAY);
@ -478,11 +478,11 @@ UDFWaitForSingleObject(
if(Timeout && (Timeout->QuadPart)) LocalTimeout = *Timeout;
else LocalTimeout.QuadPart = 0x7FFFFFFFFFFFFFFFLL;
KdPrint(("SignalState %x\n", *Object));
UDFPrint(("SignalState %x\n", *Object));
if(!Object) return STATUS_INVALID_PARAMETER;
if((*Object)) return STATUS_SUCCESS;
while(LocalTimeout.QuadPart>0 && !(*Object) ) {
KdPrint(("SignalState %x\n", *Object));
UDFPrint(("SignalState %x\n", *Object));
// Stall for a while.
KeDelayExecutionThread(KernelMode, FALSE, &delay);
LocalTimeout.QuadPart -= WAIT_FOR_XXX_EMU_DELAY;
@ -518,7 +518,7 @@ DbgWaitForSingleObject_(
RC = KeWaitForSingleObject(Object, Executive, KernelMode, FALSE, to);
if(RC == STATUS_SUCCESS)
break;
KdPrint(("No response ?\n"));
UDFPrint(("No response ?\n"));
if(c<2)
BrutePoint();
}

View file

@ -1186,7 +1186,7 @@ UDFIsBlockAllocated(
if(bm = (uint32*)(((PVCB)_Vcb)->BSBM_Bitmap)) {
ret_val |= (UDFGetBadBit(bm, Lba) ? WCACHE_BLOCK_BAD : 0);
if(ret_val & WCACHE_BLOCK_BAD) {
KdPrint(("Marked BB @ %#x\n", Lba));
UDFPrint(("Marked BB @ %#x\n", Lba));
}
}
*/

View file

@ -31,7 +31,7 @@
#define UDF_DUMP_DIRTREE
#ifdef UDF_DUMP_DIRTREE
#define DirPrint(x) KdPrint(x)
#define DirPrint(x) UDFPrint(x)
#else
#define DirPrint(x) {;}
#endif
@ -490,7 +490,7 @@ UDFFindNextFI(
if(FileId->fileCharacteristics & (~0x1f))
continue;
if(prevOffset + ((FileId->lengthFileIdent + FileId->lengthOfImpUse + sizeof(FILE_IDENT_DESC) + 3) & (~((uint32)3))) <= Length) {
KdPrint(("UDFFindNextFI OK: %x\n", prevOffset));
UDFPrint(("UDFFindNextFI OK: %x\n", prevOffset));
return prevOffset;
}
}
@ -527,7 +527,7 @@ UDFIndexDirectory(
ExtInfo = &(FileInfo->Dloc->DataLoc);
FileInfo->Dloc->DirIndex = NULL;
KdPrint(("UDF: scaning directory\n"));
UDFPrint(("UDF: scaning directory\n"));
// allocate buffer for the whole directory
ASSERT((uint32)(ExtInfo->Length));
if(!ExtInfo->Length)
@ -578,7 +578,7 @@ UDFIndexDirectory(
Count++;
if(Offset+sizeof(FILE_IDENT_DESC) > ExtInfo->Length) {
if(Offset != ExtInfo->Length) {
KdPrint((" Trash at the end of Dir\n"));
UDFPrint((" Trash at the end of Dir\n"));
}
// BrutePoint();
break;
@ -587,7 +587,7 @@ UDFIndexDirectory(
DirPrint((" final Offset %x\n", Offset));
if(Offset > ExtInfo->Length) {
BrutePoint();
KdPrint((" Unexpected end of Dir\n"));
UDFPrint((" Unexpected end of Dir\n"));
DbgFreePool(buff);
return STATUS_FILE_CORRUPT_ERROR;
}
@ -631,7 +631,7 @@ UDFIndexDirectory(
while((Offset<ExtInfo->Length) && FileId->descTag.tagIdent) {
// add new entry to index list
if(FileId->descTag.tagIdent != TID_FILE_IDENT_DESC) {
KdPrint((" Invalid tagIdent %x (expected %x) offst %x\n", FileId->descTag.tagIdent, TID_FILE_IDENT_DESC, Offset));
UDFPrint((" Invalid tagIdent %x (expected %x) offst %x\n", FileId->descTag.tagIdent, TID_FILE_IDENT_DESC, Offset));
DirPrint((" FileId: filen %x, iulen %x, charact %x\n",
FileId->lengthFileIdent, FileId->lengthOfImpUse, FileId->fileCharacteristics));
DirPrint((" loc: @%x\n", UDFExtentOffsetToLba(Vcb, ExtInfo->Mapping, Offset, NULL, NULL, NULL, NULL)));
@ -686,7 +686,7 @@ UDFIndexDirectory(
DirNdx->FI_Flags |= UDF_FI_FLAG_FI_INTERNAL;
}
#if 0
KdPrint(("%ws\n", DirNdx->FName.Buffer));
UDFPrint(("%ws\n", DirNdx->FName.Buffer));
#endif
DirPrint(("%ws\n", DirNdx->FName.Buffer));
// remember FileEntry location...
@ -715,7 +715,7 @@ UDFIndexDirectory(
Count++;
if(Offset+sizeof(FILE_IDENT_DESC) > ExtInfo->Length) {
if(Offset != ExtInfo->Length) {
KdPrint((" Trash at the end of Dir (2)\n"));
UDFPrint((" Trash at the end of Dir (2)\n"));
}
// BrutePoint();
break;
@ -725,7 +725,7 @@ UDFIndexDirectory(
DbgFreePool(buff);
if(Count < 2) {
UDFDirIndexFree(hDirNdx);
KdPrint((" Directory too short\n"));
UDFPrint((" Directory too short\n"));
return STATUS_FILE_CORRUPT_ERROR;
}
// store index

View file

@ -342,7 +342,7 @@ UDFShortAllocDescToMapping(
AllocExt.extLength = len;
AllocExt.extLocation = UDFPartLbaToPhys(Vcb, &locAddr);
if(AllocExt.extLocation == LBA_OUT_OF_EXTENT) {
KdPrint(("bad address\n"));
UDFPrint(("bad address\n"));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
@ -370,10 +370,10 @@ UDFShortAllocDescToMapping(
// check integrity
if((NextAllocDesc->descTag.tagIdent != TID_ALLOC_EXTENT_DESC) ||
(NextAllocDesc->lengthAllocDescs > (len - sizeof(ALLOC_EXT_DESC))) ) {
KdPrint(("Integrity check failed\n"));
KdPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
KdPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
KdPrint(("len = %x\n", len));
UDFPrint(("Integrity check failed\n"));
UDFPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
UDFPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
UDFPrint(("len = %x\n", len));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
@ -415,7 +415,7 @@ UDFShortAllocDescToMapping(
if(type != EXTENT_NOT_RECORDED_NOT_ALLOCATED && len) {
Extent[i].extLocation = UDFPartLbaToPhys(Vcb, &locAddr);
if(Extent[i].extLocation == LBA_OUT_OF_EXTENT) {
KdPrint(("bad address (2)\n"));
UDFPrint(("bad address (2)\n"));
MyFreePool__(Extent);
return NULL;
}
@ -502,7 +502,7 @@ UDFLongAllocDescToMapping(
AllocExt.extLength = len;
AllocExt.extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
if(AllocExt.extLocation == LBA_OUT_OF_EXTENT) {
KdPrint(("bad address\n"));
UDFPrint(("bad address\n"));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
@ -530,10 +530,10 @@ UDFLongAllocDescToMapping(
// check integrity
if((NextAllocDesc->descTag.tagIdent != TID_ALLOC_EXTENT_DESC) ||
(NextAllocDesc->lengthAllocDescs > (len - sizeof(ALLOC_EXT_DESC))) ) {
KdPrint(("Integrity check failed\n"));
KdPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
KdPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
KdPrint(("len = %x\n", len));
UDFPrint(("Integrity check failed\n"));
UDFPrint(("NextAllocDesc->descTag.tagIdent = %x\n", NextAllocDesc->descTag.tagIdent));
UDFPrint(("NextAllocDesc->lengthAllocDescs = %x\n", NextAllocDesc->lengthAllocDescs));
UDFPrint(("len = %x\n", len));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
@ -564,7 +564,7 @@ UDFLongAllocDescToMapping(
if(type != EXTENT_NOT_RECORDED_NOT_ALLOCATED && len) {
Extent[i].extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
if(Extent[i].extLocation == LBA_OUT_OF_EXTENT) {
KdPrint(("bad address (2)\n"));
UDFPrint(("bad address (2)\n"));
MyFreePool__(Extent);
return NULL;
}
@ -638,7 +638,7 @@ UDFExtAllocDescToMapping(
AllocExt.extLength = len;
AllocExt.extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
if(AllocExt.extLocation == LBA_OUT_OF_EXTENT) {
KdPrint(("bad address\n"));
UDFPrint(("bad address\n"));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
@ -666,7 +666,7 @@ UDFExtAllocDescToMapping(
// check integrity
if((NextAllocDesc->descTag.tagIdent != TID_ALLOC_EXTENT_DESC) ||
(NextAllocDesc->lengthAllocDescs > (len - sizeof(ALLOC_EXT_DESC))) ) {
KdPrint(("Integrity check failed\n"));
UDFPrint(("Integrity check failed\n"));
MyFreePool__(NextAllocDesc);
MyFreePool__(Extent);
return NULL;
@ -700,7 +700,7 @@ UDFExtAllocDescToMapping(
if(type != EXTENT_NOT_RECORDED_NOT_ALLOCATED && len) {
Extent[i].extLocation = UDFPartLbaToPhys(Vcb,&(AllocDesc[i].extLocation));
if(Extent[i].extLocation == LBA_OUT_OF_EXTENT) {
KdPrint(("bad address (2)\n"));
UDFPrint(("bad address (2)\n"));
MyFreePool__(Extent);
return NULL;
}
@ -751,7 +751,7 @@ UDFReadMappingFromXEntry(
if(XEntry->tagIdent == TID_FILE_ENTRY) {
// KdPrint(("Standard FileEntry\n"));
// UDFPrint(("Standard FileEntry\n"));
PFILE_ENTRY FileEntry = (PFILE_ENTRY)XEntry;
ExtPrint(("Standard FileEntry\n"));
@ -763,7 +763,7 @@ UDFReadMappingFromXEntry(
AllocMode = FileEntry->icbTag.flags & ICB_FLAG_ALLOC_MASK;
} else if(XEntry->tagIdent == TID_EXTENDED_FILE_ENTRY) {
// KdPrint(("Extended FileEntry\n"));
// UDFPrint(("Extended FileEntry\n"));
ExtPrint(("Extended FileEntry\n"));
PEXTENDED_FILE_ENTRY ExFileEntry = (PEXTENDED_FILE_ENTRY)XEntry;
@ -925,14 +925,14 @@ UDFBuildShortAllocDescs(
(*Buff) = (int8*)MyAllocatePoolTag__(NonPagedPool, NewLen, MEM_SHAD_TAG);
if(!(*Buff)) {
status = STATUS_INSUFFICIENT_RESOURCES;
KdPrint(("UDFResizeExtent() failed (%x)\n",status));
UDFPrint(("UDFResizeExtent() failed (%x)\n",status));
BrutePoint();
goto sh_alloc_err;
}
if(UDFGetExtentLength(AllocExtent->Mapping) < NewLen) {
status = UDFResizeExtent(Vcb, PartNum, NewLen, TRUE, AllocExtent);
if(!OS_SUCCESS(status)) {
KdPrint(("UDFResizeExtent(2) failed (%x)\n",status));
UDFPrint(("UDFResizeExtent(2) failed (%x)\n",status));
BrutePoint();
sh_alloc_err:
MyFreePool__(Alloc);
@ -1336,16 +1336,16 @@ UDFDiscardFESpace(
PEXTENT_MAP Mapping2;
uint32 i;
KdPrint((" DiscardFESpace\n"));
UDFPrint((" DiscardFESpace\n"));
Mapping2 = Mapping;
for(i=0;i<lim;i++, Mapping++) {
// we should not discard allocated FEs
if( (Mapping->extLength >> 30) == EXTENT_RECORDED_ALLOCATED) {
KdPrint((" used @ %x\n", Mapping->extLocation));
UDFPrint((" used @ %x\n", Mapping->extLocation));
Mapping->extLength = Vcb->LBlockSize | (EXTENT_NOT_RECORDED_NOT_ALLOCATED << 30);
Mapping->extLocation = 0;
} else {
KdPrint((" free @ %x\n", Mapping->extLocation));
UDFPrint((" free @ %x\n", Mapping->extLocation));
}
}
UDFMarkSpaceAsXXX(Vcb, 0, Mapping2, AS_DISCARDED);
@ -1373,13 +1373,13 @@ UDFInitAllocationCache(
switch(AllocClass) {
case UDF_PREALLOC_CLASS_FE:
KdPrint(("AllocationCache FE:\n"));
UDFPrint(("AllocationCache FE:\n"));
pAllocCache = &(Vcb->FEChargeCache);
plim = &(Vcb->FEChargeCacheMaxSize);
lim = 32;
break;
case UDF_PREALLOC_CLASS_DIR:
KdPrint(("AllocationCache DIR:\n"));
UDFPrint(("AllocationCache DIR:\n"));
pAllocCache = &(Vcb->PreallocCache);
plim = &(Vcb->PreallocCacheMaxSize);
lim = 32;
@ -1433,7 +1433,7 @@ UDFGetCachedAllocation(
UDFReleaseResource(&(Vcb->PreallocResource));
return status;
}
KdPrint(("Get AllocationCache for %x\n", ParentLocation));
UDFPrint(("Get AllocationCache for %x\n", ParentLocation));
for(i=0; i<lim; i++) {
if(AllocCache[i].ParentLocation == ParentLocation) {
@ -1473,7 +1473,7 @@ UDFStoreCachedAllocation(
UDFReleaseResource(&(Vcb->PreallocResource));
return status;
}
KdPrint(("Store AllocationCache for %x, map %x\n", ParentLocation, Ext->Mapping));
UDFPrint(("Store AllocationCache for %x, map %x\n", ParentLocation, Ext->Mapping));
for(i=0; i<lim; i++) {
if(AllocCache[i].ParentLocation == LBA_NOT_ALLOCATED) {
@ -1514,7 +1514,7 @@ UDFFlushAllCachedAllocations(
uint32 i, lim;
OSSTATUS status;
KdPrint(("Flush AllocationCache\n"));
UDFPrint(("Flush AllocationCache\n"));
UDFAcquireResourceExclusive(&(Vcb->PreallocResource),TRUE);
status = UDFInitAllocationCache(Vcb, AllocClass, &AllocCache, &lim, FALSE);
@ -1621,7 +1621,7 @@ UDFAllocateFESpace(
if(Vcb->LowFreeSpace) {
status = UDFAllocFreeExtent(Vcb, Len << Vcb->LBlockSizeBits,p_start, p_end, FEExtInfo, EXTENT_FLAG_VERIFY);
if(OS_SUCCESS(status)) {
KdPrint(("FE @ %x (1)\n", FEExtInfo->Mapping[0].extLocation ));
UDFPrint(("FE @ %x (1)\n", FEExtInfo->Mapping[0].extLocation ));
}
return status;
} else {
@ -1647,11 +1647,11 @@ UDFAllocateFESpace(
}
if(!OS_SUCCESS(status = UDFAllocFreeExtent(Vcb, lim << Vcb->LBlockSizeBits, p_start, p_end, Ext, EXTENT_FLAG_VERIFY) )) {
// can't pre-allocate space for multiple FEs. Try single FE
KdPrint(("allocate single FE entry\n"));
UDFPrint(("allocate single FE entry\n"));
status = UDFAllocFreeExtent(Vcb, Len,
p_start, p_end, FEExtInfo, EXTENT_FLAG_VERIFY);
if(OS_SUCCESS(status)) {
KdPrint(("FE @ %x (2)\n", FEExtInfo->Mapping[0].extLocation ));
UDFPrint(("FE @ %x (2)\n", FEExtInfo->Mapping[0].extLocation ));
}
return status;
}
@ -1674,7 +1674,7 @@ UDFAllocateFESpace(
if(Vcb->BSBM_Bitmap) {
uint32 lba = Ext->Mapping[i].extLocation;
if(UDFGetBadBit((uint32*)(Vcb->BSBM_Bitmap), lba)) {
KdPrint(("Remove BB @ %x from FE charge\n", lba));
UDFPrint(("Remove BB @ %x from FE charge\n", lba));
Ext->Mapping[i].extLength |= (EXTENT_NOT_RECORDED_NOT_ALLOCATED << 30);
Ext->Mapping[i].extLocation = 0;
continue;
@ -1687,7 +1687,7 @@ UDFAllocateFESpace(
Ext->Mapping[i].extLength |= (EXTENT_NOT_RECORDED_ALLOCATED << 30);
return STATUS_INSUFFICIENT_RESOURCES;
}
KdPrint(("FE @ %x (3)\n", FEExtInfo->Mapping[0].extLocation ));
UDFPrint(("FE @ %x (3)\n", FEExtInfo->Mapping[0].extLocation ));
FEExtInfo->Length = Len;
FEExtInfo->Offset = 0;
FEExtInfo->Modified = TRUE;
@ -1699,7 +1699,7 @@ UDFAllocateFESpace(
status = UDFAllocFreeExtent(Vcb, Len,
UDFPartStart(Vcb, PartNum), UDFPartEnd(Vcb, PartNum), FEExtInfo, EXTENT_FLAG_VERIFY);
if(OS_SUCCESS(status)) {
KdPrint(("FE @ %x (4)\n", FEExtInfo->Mapping[0].extLocation ));
UDFPrint(("FE @ %x (4)\n", FEExtInfo->Mapping[0].extLocation ));
}
return status;
}
@ -2297,7 +2297,7 @@ UDFResizeExtent(
int64 l2 = ((l-1)/MaxGrow + 1)*MaxGrow;
status = UDFResizeExtent(Vcb, PartNum, l2, AlwaysInIcb, ExtInfo);
if(!OS_SUCCESS(status)) {
KdPrint(("Sub-call to UDFResizeExtent() failed (%x)\n", status));
UDFPrint(("Sub-call to UDFResizeExtent() failed (%x)\n", status));
return status;
}
l = ExtInfo->Length;
@ -2306,7 +2306,7 @@ UDFResizeExtent(
while((Length - l) > MaxGrow) {
status = UDFResizeExtent(Vcb, PartNum, l+MaxGrow, AlwaysInIcb, ExtInfo);
if(!OS_SUCCESS(status)) {
KdPrint(("Sub-call (2) to UDFResizeExtent() failed (%x)\n", status));
UDFPrint(("Sub-call (2) to UDFResizeExtent() failed (%x)\n", status));
return status;
}
l = ExtInfo->Length;
@ -2413,7 +2413,7 @@ UDFResizeExtent(
TmpExtInf.Mapping = (PEXTENT_MAP)MyAllocatePoolTag__(NonPagedPool , (i+1)*sizeof(EXTENT_MAP),
MEM_EXTMAP_TAG);
if(!TmpExtInf.Mapping) {
KdPrint(("UDFResizeExtent: !TmpExtInf.Mapping\n"));
UDFPrint(("UDFResizeExtent: !TmpExtInf.Mapping\n"));
UDFReleaseResource(&(Vcb->BitMapResource1));
return STATUS_INSUFFICIENT_RESOURCES;
}
@ -2506,7 +2506,7 @@ UDFResizeExtent(
&TmpExtInf,
ExtInfo->Flags /*& EXTENT_FLAG_ALLOC_MASK*/);
if(!OS_SUCCESS(status)) {
KdPrint(("UDFResizeExtent: UDFAllocFreeExtent() failed (%x)\n", status));
UDFPrint(("UDFResizeExtent: UDFAllocFreeExtent() failed (%x)\n", status));
return status;
}
ExtInfo->Mapping = UDFMergeMappings(ExtInfo->Mapping, TmpExtInf.Mapping);

File diff suppressed because it is too large Load diff

View file

@ -57,7 +57,7 @@ UDFEjectReqWaiter(
// BOOLEAN FlushAndEject = FALSE;
KdPrint((" UDFEjectReqWaiter: start\n"));
UDFPrint((" UDFEjectReqWaiter: start\n"));
uint8 supported_evt_classes = 0;
uint32 i, j;
uint8 evt_type;
@ -72,10 +72,10 @@ UDFEjectReqWaiter(
if(UseEvent) {
supported_evt_classes = EventStat_Class_Media;
} else {
KdPrint((" Eject Button ignored\n"));
UDFPrint((" Eject Button ignored\n"));
}
for(j=0; j<4; j++) {
KdPrint((" Reading events... (0)\n"));
UDFPrint((" Reading events... (0)\n"));
if(supported_evt_classes) {
for(i=1; i<=EventRetStat_Class_Mask;i++) {
evt_type = (((UCHAR)1) << i);
@ -129,7 +129,7 @@ stop_waiter:
KeSetEvent(WC->WaiterStopped, 0, FALSE);
MyFreePool__(WC);
WC = NULL;
KdPrint((" UDFEjectReqWaiter: exit 3\n"));
UDFPrint((" UDFEjectReqWaiter: exit 3\n"));
return;
}
BM_FlushPriod = Vcb->BM_FlushPriod;
@ -213,7 +213,7 @@ wait_eject:
Error,sizeof(GET_LAST_ERROR_USER_OUT),
TRUE,NULL);
UDFReleaseResource(&(Vcb->IoResource));
KdPrint(("SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
UDFPrint(("SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
Error->SenseKey, Error->AdditionalSenseCode, Error->AdditionalSenseCodeQualifier, Error->LastError));
// check for Long Write In Progress
if( ((Error->SenseKey == SCSI_SENSE_NOT_READY) &&
@ -225,9 +225,9 @@ wait_eject:
||
(Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL)) {
// we should forget about this disk...
KdPrint((" LAST_WRITE %x\n", !!(Vcb->VCBFlags & UDF_VCB_LAST_WRITE)));
KdPrint((" UDF_VCB_FLAGS_UNSAFE_IOCTL %x\n", !!(Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL)));
KdPrint((" UDFEjectReqWaiter: Unexpected write-in-progress on !Modified volume\n"));
UDFPrint((" LAST_WRITE %x\n", !!(Vcb->VCBFlags & UDF_VCB_LAST_WRITE)));
UDFPrint((" UDF_VCB_FLAGS_UNSAFE_IOCTL %x\n", !!(Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL)));
UDFPrint((" UDFEjectReqWaiter: Unexpected write-in-progress on !Modified volume\n"));
//ASSERT(FALSE);
Vcb->ForgetVolume = TRUE;
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY | UDF_VCB_FLAGS_MEDIA_READ_ONLY;
@ -240,7 +240,7 @@ wait_eject:
!(WC->DevCap.Capabilities2 & DevCap_lock_state)) {
// probably bus reset or power failure occured
// re-lock tray
KdPrint((" UDFEjectReqWaiter: Unexpected tray unlock encountered. Try to re-lock\n"));
UDFPrint((" UDFEjectReqWaiter: Unexpected tray unlock encountered. Try to re-lock\n"));
UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
VcbAcquired = TRUE;
@ -278,14 +278,14 @@ wait_eject:
AllFlushed = FALSE;
KdPrint((" SkipCount=%x, SkipCountLimit=%x\n",
UDFPrint((" SkipCount=%x, SkipCountLimit=%x\n",
SkipCount,
Vcb->SkipCountLimit));
if( Tree_FlushPriod &&
(Tree_FlushPriod < Vcb->Tree_FlushTime)) {
KdPrint((" Tree_FlushPriod %I64x, Vcb->Tree_FlushTime %I64x\n",
UDFPrint((" Tree_FlushPriod %I64x, Vcb->Tree_FlushTime %I64x\n",
Tree_FlushPriod,
Vcb->Tree_FlushTime));
@ -307,13 +307,13 @@ wait_eject:
VcbAcquired = TRUE;
}
KdPrint(("UDF: Flushing Directory Tree....\n"));
UDFPrint(("UDF: Flushing Directory Tree....\n"));
if( BM_FlushPriod &&
(BM_FlushPriod < Vcb->BM_FlushTime)) {
KdPrint((" full flush\n"));
UDFPrint((" full flush\n"));
flush_stat = UDFFlushADirectory(Vcb, Vcb->RootDirFCB->FileInfo, &IoStatus, UDF_FLUSH_FLAGS_BREAKABLE);
} else {
KdPrint((" light flush\n"));
UDFPrint((" light flush\n"));
flush_stat = UDFFlushADirectory(Vcb, Vcb->RootDirFCB->FileInfo, &IoStatus, UDF_FLUSH_FLAGS_BREAKABLE | UDF_FLUSH_FLAGS_LITE);
}
if(flush_stat & UDF_FLUSH_FLAGS_INTERRUPTED)
@ -327,7 +327,7 @@ skip_BM_flush:
if( BM_FlushPriod &&
(BM_FlushPriod < Vcb->BM_FlushTime)) {
KdPrint((" BM_FlushPriod %I64x, Vcb->BM_FlushTime %I64x\n",
UDFPrint((" BM_FlushPriod %I64x, Vcb->BM_FlushTime %I64x\n",
BM_FlushPriod,
Vcb->BM_FlushTime));
@ -369,20 +369,20 @@ skip_BM_flush:
UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr2, &(Vcb->VolIdent));
if(Vcb->VerifyOnWrite) {
KdPrint(("UDF: Flushing cache for verify\n"));
UDFPrint(("UDF: Flushing cache for verify\n"));
//WCacheFlushAll__(&(Vcb->FastCache), Vcb);
WCacheFlushBlocks__(&(Vcb->FastCache), Vcb, 0, Vcb->LastLBA);
UDFVFlush(Vcb);
}
#ifdef UDF_DBG
KdPrint(("UDF: Flushing Free Space Bitmap....\n"));
UDFPrint(("UDF: Flushing Free Space Bitmap....\n"));
// if(!OS_SUCCESS(UDFUpdateVolIdent(Vcb, Vcb->PVolDescAddr, &(Vcb->VolIdent))))
// KdPrint(("Error updating VolIdent\n"));
// UDFPrint(("Error updating VolIdent\n"));
if(!OS_SUCCESS(UDFUpdateVDS(Vcb, Vcb->VDS1, Vcb->VDS1 + Vcb->VDS1_Len, flags)))
KdPrint(("Error updating Main VDS\n"));
UDFPrint(("Error updating Main VDS\n"));
if(!OS_SUCCESS(UDFUpdateVDS(Vcb, Vcb->VDS2, Vcb->VDS2 + Vcb->VDS2_Len, flags)))
KdPrint(("Error updating Reserve VDS\n"));
UDFPrint(("Error updating Reserve VDS\n"));
#else
UDFUpdateVDS(Vcb, Vcb->VDS1, Vcb->VDS1 + Vcb->VDS1_Len, flags);
UDFUpdateVDS(Vcb, Vcb->VDS2, Vcb->VDS2 + Vcb->VDS2_Len, flags);
@ -425,7 +425,7 @@ skip_BM_flush2:
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA))
try_return(RC);
KdPrint((" UDFEjectReqWaiter: check removable media\n"));
UDFPrint((" UDFEjectReqWaiter: check removable media\n"));
if(!WC->SoftEjectReq && SkipEject) {
try_return(RC);
}
@ -433,7 +433,7 @@ skip_BM_flush2:
if(!WC->SoftEjectReq) {
if(!UseEvent) {
KdPrint((" Eject Button ignored\n"));
UDFPrint((" Eject Button ignored\n"));
try_return(RC);
}
@ -443,7 +443,7 @@ skip_BM_flush2:
// KeDelayExecutionThread(KernelMode, FALSE, &delay);
OSSTATUS RC;
KdPrint((" Sync cache before GET_EVENT\n"));
UDFPrint((" Sync cache before GET_EVENT\n"));
RC = UDFSyncCache(Vcb);
if(RC == STATUS_INVALID_DEVICE_REQUEST) {
Vcb->VCBFlags |= UDF_VCB_FLAGS_NO_SYNC_CACHE;
@ -465,15 +465,15 @@ skip_BM_flush2:
if(RC != STATUS_SUCCESS &&
RC != STATUS_DATA_OVERRUN) {
if(RC == STATUS_NO_SUCH_DEVICE) {
KdPrint((" Device loss\n"));
UDFPrint((" Device loss\n"));
goto device_failure;
}
if(RC == STATUS_NO_MEDIA_IN_DEVICE) {
KdPrint((" Media loss\n"));
UDFPrint((" Media loss\n"));
goto media_loss;
}
}
KdPrint((" Reading events...\n"));
UDFPrint((" Reading events...\n"));
if(supported_evt_classes) {
for(i=1; i<=EventRetStat_Class_Mask;i++) {
evt_type = (((UCHAR)1) << i);
@ -499,7 +499,7 @@ skip_BM_flush2:
continue;
}
if(RC == STATUS_NO_SUCH_DEVICE) {
KdPrint((" Device loss (2)\n"));
UDFPrint((" Device loss (2)\n"));
goto device_failure;
}
if(!OS_SUCCESS(RC)) {
@ -510,7 +510,7 @@ skip_BM_flush2:
continue;
}
if( evt_type == EventStat_Class_Media ) {
KdPrint((" EventStat_Class_Media:\n"));
UDFPrint((" EventStat_Class_Media:\n"));
if((WC->EjectReqBuffer.MediaChange.Header.Flags.Flags & EventRetStat_Class_Mask) !=
EventRetStat_Class_Media) {
continue;
@ -527,14 +527,14 @@ retry_media_presence_check:
if(RC == STATUS_SUCCESS ||
RC == STATUS_DATA_OVERRUN) {
KdPrint((" Buggy GET_EVENT media presence flag %x\n",
UDFPrint((" Buggy GET_EVENT media presence flag %x\n",
WC->EjectReqBuffer.MediaChange.Byte1));
WC->EjectReqBuffer.MediaChange.Byte1.Flags |= EventStat_MediaStat_Present;
WC->EjectReqBuffer.MediaChange.Byte1.Flags &= ~EventStat_MediaStat_DoorOpen;
goto retry_media_presence_check;
}
media_loss:
KdPrint((" Unexpected media loss. Check device status\n"));
UDFPrint((" Unexpected media loss. Check device status\n"));
UseEject = FALSE;
MediaLoss = TRUE;
} else
@ -543,12 +543,12 @@ media_loss:
EventStat_MediaEvent_EjectReq ) {
continue;
}
KdPrint((" eject requested\n"));
UDFPrint((" eject requested\n"));
WC->SoftEjectReq = TRUE;
break;
}
if( evt_type == EventStat_Class_ExternalReq ) {
KdPrint((" EventStat_Class_ExternalReq:\n"));
UDFPrint((" EventStat_Class_ExternalReq:\n"));
if((WC->EjectReqBuffer.ExternalReq.Header.Flags.Flags & EventRetStat_Class_Mask) !=
EventRetStat_Class_ExternReq)
continue;
@ -556,7 +556,7 @@ media_loss:
case EventStat_ExtrnReqEvent_KeyDown:
case EventStat_ExtrnReqEvent_KeyUp:
case EventStat_ExtrnReqEvent_ExtrnReq:
KdPrint((" eject requested (%x)\n", WC->EjectReqBuffer.ExternalReq.Byte0.Flags));
UDFPrint((" eject requested (%x)\n", WC->EjectReqBuffer.ExternalReq.Byte0.Flags));
WC->SoftEjectReq = TRUE;
break;
}
@ -571,7 +571,7 @@ media_loss:
}
} else {
KdPrint((" Reading Media Event...\n"));
UDFPrint((" Reading Media Event...\n"));
((PGET_EVENT_USER_IN)(&(WC->EjectReqBuffer)))->Immed = TRUE;
((PGET_EVENT_USER_IN)(&(WC->EjectReqBuffer)))->EventClass = EventStat_Class_Media;
@ -610,26 +610,26 @@ device_failure:
// Acquire Vcb resource
Vcb->SoftEjectReq = TRUE;
KdPrint((" UDFEjectReqWaiter: ejecting...\n"));
UDFPrint((" UDFEjectReqWaiter: ejecting...\n"));
#ifdef UDF_DELAYED_CLOSE
UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
KdPrint((" UDFEjectReqWaiter: set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
UDFPrint((" UDFEjectReqWaiter: set UDF_VCB_FLAGS_NO_DELAYED_CLOSE\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_NO_DELAYED_CLOSE;
UDFReleaseResource(&(Vcb->VCBResource));
#endif //UDF_DELAYED_CLOSE
KdPrint((" UDFEjectReqWaiter: UDFCloseAllSystemDelayedInDir\n"));
UDFPrint((" UDFEjectReqWaiter: UDFCloseAllSystemDelayedInDir\n"));
RC = UDFCloseAllSystemDelayedInDir(Vcb, Vcb->RootDirFCB->FileInfo);
ASSERT(OS_SUCCESS(RC));
#ifdef UDF_DELAYED_CLOSE
KdPrint((" UDFEjectReqWaiter: UDFCloseAllDelayed\n"));
UDFPrint((" UDFEjectReqWaiter: UDFCloseAllDelayed\n"));
UDFCloseAllDelayed(Vcb);
//ASSERT(OS_SUCCESS(RC));
#endif //UDF_DELAYED_CLOSE
UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
KdPrint((" UDFEjectReqWaiter: UDFDoDismountSequence\n"));
UDFPrint((" UDFEjectReqWaiter: UDFDoDismountSequence\n"));
UDFDoDismountSequence(Vcb, (PPREVENT_MEDIA_REMOVAL_USER_IN)&(WC->EjectReqBuffer), UseEject);
if (MediaLoss) {
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
@ -639,12 +639,12 @@ device_failure:
Vcb->SoftEjectReq = FALSE;
UDFReleaseResource(&(Vcb->VCBResource));
KdPrint((" UDFEjectReqWaiter: set WaiterStopped\n"));
UDFPrint((" UDFEjectReqWaiter: set WaiterStopped\n"));
KeSetEvent(WC->WaiterStopped, 0, FALSE);
MyFreePool__(WC);
WC = NULL;
KdPrint((" UDFEjectReqWaiter: exit 1\n"));
UDFPrint((" UDFEjectReqWaiter: exit 1\n"));
return;
try_exit: NOTHING;
@ -671,11 +671,11 @@ try_exit: NOTHING;
void
UDFStopEjectWaiter(PVCB Vcb) {
KdPrint((" UDFStopEjectWaiter: try\n"));
UDFPrint((" UDFStopEjectWaiter: try\n"));
UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE);
_SEH2_TRY {
if(Vcb->EjectWaiter) {
KdPrint((" UDFStopEjectWaiter: set flag\n"));
UDFPrint((" UDFStopEjectWaiter: set flag\n"));
KeSetEvent( &(Vcb->EjectWaiter->StopReq), 0, FALSE );
} else {
// return;
@ -687,7 +687,7 @@ UDFStopEjectWaiter(PVCB Vcb) {
_SEH2_TRY {
if(Vcb->VCBFlags & UDF_VCB_FLAGS_STOP_WAITER_EVENT) {
KdPrint((" UDFStopEjectWaiter: wait\n"));
UDFPrint((" UDFStopEjectWaiter: wait\n"));
KeWaitForSingleObject(&(Vcb->WaiterStopped), Executive, KernelMode, FALSE, NULL);
}
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_STOP_WAITER_EVENT;
@ -695,7 +695,7 @@ UDFStopEjectWaiter(PVCB Vcb) {
BrutePoint();
} _SEH2_END;
ASSERT(!Vcb->EjectWaiter);
KdPrint((" UDFStopEjectWaiter: exit\n"));
UDFPrint((" UDFStopEjectWaiter: exit\n"));
} // end UDFStopEjectWaiter()
@ -712,7 +712,7 @@ UDFDoDismountSequence(
// flush system cache
UDFFlushLogicalVolume(NULL, NULL, Vcb, 0);
KdPrint(("UDFDoDismountSequence:\n"));
UDFPrint(("UDFDoDismountSequence:\n"));
delay.QuadPart = -1000000; // 0.1 sec
KeDelayExecutionThread(KernelMode, FALSE, &delay);
@ -728,7 +728,7 @@ UDFDoDismountSequence(
// unlock media, drop our own Locks
if(Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA) {
KdPrint((" cleanup tray-lock (%d+2):\n", Vcb->MediaLockCount));
UDFPrint((" cleanup tray-lock (%d+2):\n", Vcb->MediaLockCount));
for(i=0; i<Vcb->MediaLockCount+2; i++) {
Buf->PreventMediaRemoval = FALSE;
UDFPhSendIOCTL(IOCTL_STORAGE_MEDIA_REMOVAL,
@ -745,7 +745,7 @@ UDFDoDismountSequence(
if(!UDFIsDvdMedia(Vcb)) {
// send speed limits to drive
KdPrint((" Restore drive speed on dismount\n"));
UDFPrint((" Restore drive speed on dismount\n"));
Vcb->SpeedBuf.ReadSpeed = Vcb->MaxReadSpeed;
Vcb->SpeedBuf.WriteSpeed = Vcb->MaxWriteSpeed;
UDFPhSendIOCTL(IOCTL_CDRW_SET_SPEED,
@ -765,7 +765,7 @@ UDFDoDismountSequence(
memset(&CBuff,0,sizeof(CLOSE_TRK_SES_USER_IN));
// stop BG format
if(Vcb->MRWStatus) {
KdPrint((" Stop background formatting\n"));
UDFPrint((" Stop background formatting\n"));
CBuff.Byte1.Flags = 0;//CloseTrkSes_Immed;
CBuff.Byte2.Flags = CloseTrkSes_Ses;
@ -778,7 +778,7 @@ UDFDoDismountSequence(
FALSE, NULL );
/* } else
if(Vcb->MediaClassEx == CdMediaClass_DVDRW) {
KdPrint((" Close BG-formatted track\n"));
UDFPrint((" Close BG-formatted track\n"));
CBuff.Byte1.Flags = 0;//CloseTrkSes_Immed;
CBuff.Byte2.Flags = CloseTrkSes_Trk;
@ -835,7 +835,7 @@ UDFDoDismountSequence(
ExFreePool(Vcb->CDBurnerVolume.Buffer);
}
*/
KdPrint((" set UnsafeIoctl\n"));
UDFPrint((" set UnsafeIoctl\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_UNSAFE_IOCTL;
return STATUS_SUCCESS;

View file

@ -61,18 +61,18 @@ UDFVInit(
BOOLEAN res_inited = FALSE;
if(VerifyCtx->VInited) {
KdPrint(("Already inited\n"));
UDFPrint(("Already inited\n"));
return STATUS_SUCCESS;
}
_SEH2_TRY {
RtlZeroMemory(VerifyCtx, sizeof(UDF_VERIFY_CTX));
if(!Vcb->VerifyOnWrite) {
KdPrint(("Verify is disabled\n"));
UDFPrint(("Verify is disabled\n"));
return STATUS_SUCCESS;
}
if(Vcb->CDR_Mode) {
KdPrint(("Verify is not intended for CD/DVD-R\n"));
UDFPrint(("Verify is not intended for CD/DVD-R\n"));
return STATUS_SUCCESS;
}
if(!OS_SUCCESS(status = ExInitializeResourceLite(&(VerifyCtx->VerifyLock)))) {
@ -84,7 +84,7 @@ UDFVInit(
if(VerifyCtx->StoredBitMap) {
RtlZeroMemory(VerifyCtx->StoredBitMap, i);
} else {
KdPrint(("Can't alloc verify bitmap for %x blocks\n", Vcb->LastPossibleLBA));
UDFPrint(("Can't alloc verify bitmap for %x blocks\n", Vcb->LastPossibleLBA));
try_return(status = STATUS_INSUFFICIENT_RESOURCES);
}
InitializeListHead(&(VerifyCtx->vrfList));
@ -113,14 +113,14 @@ UDFVWaitQueued(
ULONG w;
while(VerifyCtx->QueuedCount) {
KdPrint(("UDFVWaitQueued: wait for completion (%d)\n", VerifyCtx->QueuedCount));
UDFPrint(("UDFVWaitQueued: wait for completion (%d)\n", VerifyCtx->QueuedCount));
w = InterlockedIncrement((PLONG)&(VerifyCtx->WaiterCount));
KdPrint((" %d waiters\n", w));
UDFPrint((" %d waiters\n", w));
DbgWaitForSingleObject(&(VerifyCtx->vrfEvent), NULL);
if((w = InterlockedDecrement((PLONG)&(VerifyCtx->WaiterCount)))) {
KdPrint((" still %d waiters, q %d\n", w, VerifyCtx->QueuedCount));
UDFPrint((" still %d waiters, q %d\n", w, VerifyCtx->QueuedCount));
if(!VerifyCtx->QueuedCount) {
KdPrint((" pulse event\n", w));
UDFPrint((" pulse event\n", w));
KeSetEvent(&(VerifyCtx->vrfEvent), 0, FALSE);
}
}
@ -141,7 +141,7 @@ UDFVRelease(
return;
}
KdPrint(("UDFVRelease: wait for completion\n"));
UDFPrint(("UDFVRelease: wait for completion\n"));
UDFVWaitQueued(VerifyCtx);
UDFAcquireResourceExclusive(&(VerifyCtx->VerifyLock), TRUE);
@ -177,7 +177,7 @@ UDFVStoreBlock(
PUDF_VERIFY_CTX VerifyCtx = &Vcb->VerifyCtx;
PUDF_VERIFY_ITEM vItem;
KdPrint(("v-add %x\n", LBA));
UDFPrint(("v-add %x\n", LBA));
vItem = (PUDF_VERIFY_ITEM)DbgAllocatePoolWithTag(PagedPool, sizeof(UDF_VERIFY_ITEM)+Vcb->BlockSize, 'bvWD');
if(!vItem)
@ -201,7 +201,7 @@ UDFVUpdateBlock(
PUDF_VERIFY_ITEM vItem
)
{
KdPrint(("v-upd %x\n", vItem->lba));
UDFPrint(("v-upd %x\n", vItem->lba));
RtlCopyMemory(vItem+1, Buffer, Vcb->BlockSize);
vItem->crc = crc32((PUCHAR)Buffer, Vcb->BlockSize);
return;
@ -213,7 +213,7 @@ UDFVRemoveBlock(
PUDF_VERIFY_ITEM vItem
)
{
KdPrint(("v-del %x\n", vItem->lba));
UDFPrint(("v-del %x\n", vItem->lba));
UDFClrBit(VerifyCtx->StoredBitMap, vItem->lba);
RemoveEntryList(&(vItem->vrfList));
VerifyCtx->ItemCount--;
@ -421,7 +421,7 @@ UDFVRead(
if(!(Flags & PH_READ_VERIFY_CACHE)) {
crc = crc32((PUCHAR)Buffer+(vItem->lba - LBA)*Vcb->BlockSize, Vcb->BlockSize);
if(vItem->crc != crc) {
KdPrint(("UDFVRead: stored %x != %x\n", vItem->crc, crc));
UDFPrint(("UDFVRead: stored %x != %x\n", vItem->crc, crc));
RtlCopyMemory((PUCHAR)Buffer+(vItem->lba - LBA)*Vcb->BlockSize, vItem->Buffer, Vcb->BlockSize);
status = STATUS_FT_WRITE_RECOVERY;
@ -431,25 +431,25 @@ UDFVRead(
if(bm) {
RtlZeroMemory(bm, crc);
} else {
KdPrint(("Can't alloc BSBM for %x blocks\n", Vcb->LastPossibleLBA));
UDFPrint(("Can't alloc BSBM for %x blocks\n", Vcb->LastPossibleLBA));
}
}
if(bm) {
UDFSetBit(bm, vItem->lba);
KdPrint(("Set BB @ %#x\n", vItem->lba));
UDFPrint(("Set BB @ %#x\n", vItem->lba));
}
#ifdef _BROWSE_UDF_
bm = (uint32*)(Vcb->FSBM_Bitmap);
if(bm) {
UDFSetUsedBit(bm, vItem->lba);
KdPrint(("Set BB @ %#x as used\n", vItem->lba));
UDFPrint(("Set BB @ %#x as used\n", vItem->lba));
}
#endif //_BROWSE_UDF_
} else {
// ok
}
} else {
KdPrint(("UDFVRead: get cached @ %x\n", vItem->lba));
UDFPrint(("UDFVRead: get cached @ %x\n", vItem->lba));
RtlCopyMemory((PUCHAR)Buffer+(vItem->lba - LBA)*Vcb->BlockSize, vItem->Buffer, Vcb->BlockSize);
}
if(i >= n) {
@ -561,8 +561,8 @@ UDFVWorkItem(
WCacheEODirect__(&(Vcb->FastCache), Vcb);
} else {
for(i=0; i<VerifyReq->nReq; i++) {
KdPrint(("!!! No more space for remap !!!\n"));
KdPrint((" try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
UDFPrint(("!!! No more space for remap !!!\n"));
UDFPrint((" try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
UDFVRead(Vcb, VerifyReq->Buffer, VerifyReq->vr[i].BCount, VerifyReq->vr[i].lba,
PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER);
}
@ -579,8 +579,8 @@ UDFVWorkItem(
PH_TMP_BUFFER | PH_VCB_IN_RETLEN /*| PH_LOCK_CACHE*/);
WCacheEODirect__(&(Vcb->FastCache), Vcb);
} else {
KdPrint(("!!! No more space for remap !!!\n"));
KdPrint((" try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
UDFPrint(("!!! No more space for remap !!!\n"));
UDFPrint((" try del from verify cache @ %x\n", VerifyReq->vr[i].lba));
RC = UDFVRead(Vcb, VerifyReq->Buffer, VerifyReq->vr[i].BCount, VerifyReq->vr[i].lba,
PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER);
}
@ -589,8 +589,8 @@ UDFVWorkItem(
DbgFreePool(VerifyReq->Buffer);
DbgFreePool(VerifyReq);
InterlockedDecrement((PLONG)&(Vcb->VerifyCtx.QueuedCount));
KdPrint((" QueuedCount = %d\n", Vcb->VerifyCtx.QueuedCount));
KdPrint((" Setting event...\n"));
UDFPrint((" QueuedCount = %d\n", Vcb->VerifyCtx.QueuedCount));
UDFPrint((" Setting event...\n"));
KeSetEvent(&(Vcb->VerifyCtx.vrfEvent), 0, FALSE);
return;
} // end UDFVWorkItem()
@ -616,10 +616,10 @@ UDFVVerify(
}
if(VerifyCtx->QueuedCount) {
if(Flags & UFD_VERIFY_FLAG_WAIT) {
KdPrint((" wait for verify flush\n"));
UDFPrint((" wait for verify flush\n"));
goto wait;
}
KdPrint((" verify flush already queued\n"));
UDFPrint((" verify flush already queued\n"));
return;
}
@ -729,7 +729,7 @@ UDFVVerify(
}
if(Flags & UFD_VERIFY_FLAG_WAIT) {
wait:
KdPrint(("UDFVVerify: wait for completion\n"));
UDFPrint(("UDFVVerify: wait for completion\n"));
UDFVWaitQueued(VerifyCtx);
}
@ -747,12 +747,12 @@ UDFVFlush(
return;
}
KdPrint(("UDFVFlush: wait for completion\n"));
UDFPrint(("UDFVFlush: wait for completion\n"));
UDFVWaitQueued(VerifyCtx);
UDFVVerify(Vcb, UFD_VERIFY_FLAG_FORCE);
KdPrint(("UDFVFlush: wait for completion (2)\n"));
UDFPrint(("UDFVFlush: wait for completion (2)\n"));
UDFVWaitQueued(VerifyCtx);
} // end UDFVFlush()
@ -822,9 +822,9 @@ UDFRemapPacket(
// use sparing table for relocation
if(Vcb->SparingCountFree == (ULONG)-1) {
KdPrint(("calculate free spare areas\n"));
UDFPrint(("calculate free spare areas\n"));
re_check:
KdPrint(("verify spare area\n"));
UDFPrint(("verify spare area\n"));
Vcb->SparingCountFree = 0;
Map = Vcb->SparingTable;
for(i=0;i<max;i++,Map++) {
@ -832,7 +832,7 @@ re_check:
if(UDFCheckArea(Vcb, Map->mappedLocation, BS)) {
Vcb->SparingCountFree++;
} else {
KdPrint(("initial check: bad spare block @ %x\n", Map->mappedLocation));
UDFPrint(("initial check: bad spare block @ %x\n", Map->mappedLocation));
Map->origLocation = SPARING_LOC_CORRUPTED;
Vcb->SparingTableModified = TRUE;
}
@ -840,7 +840,7 @@ re_check:
}
}
if(!Vcb->SparingCountFree) {
KdPrint(("sparing table full\n"));
UDFPrint(("sparing table full\n"));
return STATUS_DISK_FULL;
}
@ -851,7 +851,7 @@ re_check:
if(Lba == (orig & ~(BS-1)) ) {
// already remapped
KdPrint(("remap remapped: bad spare block @ %x\n", Map->mappedLocation));
UDFPrint(("remap remapped: bad spare block @ %x\n", Map->mappedLocation));
if(!verified) {
verified = TRUE;
goto re_check;
@ -871,14 +871,14 @@ re_check:
Map = Vcb->SparingTable;
for(i=0;i<max;i++,Map++) {
if(Map->origLocation == SPARING_LOC_AVAILABLE) {
KdPrint(("remap %x -> %x\n", Lba, Map->mappedLocation));
UDFPrint(("remap %x -> %x\n", Lba, Map->mappedLocation));
Map->origLocation = Lba;
Vcb->SparingTableModified = TRUE;
Vcb->SparingCountFree--;
return STATUS_SUCCESS;
}
}
KdPrint(("sparing table full\n"));
UDFPrint(("sparing table full\n"));
return STATUS_DISK_FULL;
}
return STATUS_UNSUCCESSFUL;
@ -914,7 +914,7 @@ UDFUnmapRange(
if(orig >= Lba &&
(orig+BS) <= (Lba+BCount)) {
// unmap
KdPrint(("unmap %x -> %x\n", orig, Map->mappedLocation));
UDFPrint(("unmap %x -> %x\n", orig, Map->mappedLocation));
Map->origLocation = SPARING_LOC_AVAILABLE;
Vcb->SparingTableModified = TRUE;
Vcb->SparingCountFree++;

View file

@ -318,7 +318,7 @@ UDFReadFileEntry(
Ident))) return status;
if((FileEntry->descTag.tagIdent != TID_FILE_ENTRY) &&
(FileEntry->descTag.tagIdent != TID_EXTENDED_FILE_ENTRY)) {
KdPrint((" Not a FileEntry (lbn=%x, tag=%x)\n", Icb->extLocation.logicalBlockNum, FileEntry->descTag.tagIdent));
UDFPrint((" Not a FileEntry (lbn=%x, tag=%x)\n", Icb->extLocation.logicalBlockNum, FileEntry->descTag.tagIdent));
return STATUS_FILE_CORRUPT_ERROR;
}
return STATUS_SUCCESS;
@ -1069,7 +1069,7 @@ UDFLoadExtInfo(
{
EXTENT_AD TmpExt;
KdPrint((" UDFLoadExtInfo:\n"));
UDFPrint((" UDFLoadExtInfo:\n"));
FExtInfo->Mapping = UDFReadMappingFromXEntry(Vcb, fe_loc->extLocation.partitionReferenceNum,
(tag*)fe, &(FExtInfo->Offset), AExtInfo);
if(!(FExtInfo->Mapping)) {
@ -1082,12 +1082,12 @@ UDFLoadExtInfo(
FExtInfo->Mapping = UDFExtentToMapping(&TmpExt);
}
if(fe->descTag.tagIdent == TID_FILE_ENTRY) {
// KdPrint(("Standard FileEntry\n"));
// UDFPrint(("Standard FileEntry\n"));
FExtInfo->Length = fe->informationLength;
} else /*if(fe->descTag.tagIdent == TID_EXTENDED_FILE_ENTRY) */ {
FExtInfo->Length = ((PEXTENDED_FILE_ENTRY)fe)->informationLength;
}
KdPrint((" FExtInfo->Length %x\n", FExtInfo->Length));
UDFPrint((" FExtInfo->Length %x\n", FExtInfo->Length));
ASSERT(FExtInfo->Length <= UDFGetExtentLength(FExtInfo->Mapping));
FExtInfo->Modified = FALSE;
@ -1565,30 +1565,30 @@ UDFReadEntityID_Domain(
dis = (domainIdentSuffix*)&(eID->identSuffix);
KdPrint(("UDF: Entity Id:\n"));
KdPrint(("flags: %x\n", eID->flags));
KdPrint(("ident[0]: %x\n", eID->ident[0]));
KdPrint(("ident[1]: %x\n", eID->ident[1]));
KdPrint(("ident[2]: %x\n", eID->ident[2]));
KdPrint(("ident[3]: %x\n", eID->ident[3]));
KdPrint(("UDF: Entity Id Domain:\n"));
UDFPrint(("UDF: Entity Id:\n"));
UDFPrint(("flags: %x\n", eID->flags));
UDFPrint(("ident[0]: %x\n", eID->ident[0]));
UDFPrint(("ident[1]: %x\n", eID->ident[1]));
UDFPrint(("ident[2]: %x\n", eID->ident[2]));
UDFPrint(("ident[3]: %x\n", eID->ident[3]));
UDFPrint(("UDF: Entity Id Domain:\n"));
// Get current UDF revision
Vcb->CurrentUDFRev = max(dis->currentRev, Vcb->CurrentUDFRev);
KdPrint(("Effective Revision: %x\n", Vcb->CurrentUDFRev));
UDFPrint(("Effective Revision: %x\n", Vcb->CurrentUDFRev));
// Get Read-Only flags
flags = dis->flags;
KdPrint(("Flags: %x\n", flags));
UDFPrint(("Flags: %x\n", flags));
if((flags & ENTITYID_FLAGS_SOFT_RO) &&
(Vcb->CompatFlags & UDF_VCB_IC_SOFT_RO)) {
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_SOFT_RO;
KdPrint((" Soft-RO\n"));
UDFPrint((" Soft-RO\n"));
}
if((flags & ENTITYID_FLAGS_HARD_RO) &&
(Vcb->CompatFlags & UDF_VCB_IC_HW_RO)) {
Vcb->VCBFlags |= UDF_VCB_FLAGS_MEDIA_READ_ONLY;
Vcb->UserFSFlags |= UDF_USER_FS_FLAGS_HW_RO;
KdPrint((" Hard-RO\n"));
UDFPrint((" Hard-RO\n"));
}
} // end UDFReadEntityID_Domain()
@ -1820,7 +1820,7 @@ UDFUnlinkFile__(
}
SDirInfo = Dloc->SDirInfo;
/* if(FreeSpace && SDirInfo) {
KdPrint(("Unlink: SDirInfo should be NULL !!!\n"));
UDFPrint(("Unlink: SDirInfo should be NULL !!!\n"));
BrutePoint();
return STATUS_CANNOT_DELETE;
}*/
@ -2296,15 +2296,15 @@ UDFCleanUpFile__(
ValidateFileInfo(FileInfo);
if(FileInfo->OpenCount || FileInfo->RefCount) {
KdPrint(("UDF: not all references are closed\n"));
KdPrint((" Skipping cleanup\n"));
KdPrint(("UDF: OpenCount = %x, RefCount = %x, LinkRefCount = %x\n",
UDFPrint(("UDF: not all references are closed\n"));
UDFPrint((" Skipping cleanup\n"));
UDFPrint(("UDF: OpenCount = %x, RefCount = %x, LinkRefCount = %x\n",
FileInfo->OpenCount,FileInfo->RefCount,FileInfo->Dloc->LinkRefCount));
return UDF_FREE_NOTHING;
}
if(FileInfo->Fcb) {
KdPrint(("Operating System still has references to this file\n"));
KdPrint((" Skipping cleanup\n"));
UDFPrint(("Operating System still has references to this file\n"));
UDFPrint((" Skipping cleanup\n"));
// BrutePoint();
return UDF_FREE_NOTHING;
}
@ -2321,7 +2321,7 @@ UDFCleanUpFile__(
// we can't delete modified file
// it should be closed & reopened (or flushed) before deletion
DirNdx = UDFDirIndex(hDirNdx,Index);
KdPrint(("Cleanup Mod: %s%s%s%s%s%s\n",
UDFPrint(("Cleanup Mod: %s%s%s%s%s%s\n",
(Dloc->FE_Flags & UDF_FE_FLAG_FE_MODIFIED) ? "FE " : "",
(Dloc->DataLoc.Modified) ? "DataLoc " : "",
(Dloc->DataLoc.Flags & EXTENT_FLAG_PREALLOCATED) ? "Data-PreAlloc " : "",
@ -2357,8 +2357,8 @@ UDFCleanUpFile__(
if(DirNdx->FileInfo) {
if(!KeepDloc) {
BrutePoint();
KdPrint(("UDF: Found not cleaned up reference.\n"));
KdPrint((" Skipping cleanup (1)\n"));
UDFPrint(("UDF: Found not cleaned up reference.\n"));
UDFPrint((" Skipping cleanup (1)\n"));
// BrutePoint();
return UDF_FREE_NOTHING;
}
@ -2389,7 +2389,7 @@ UDFCleanUpFile__(
}
}
if(Dloc->SDirInfo) {
KdPrint(("UDF: Found not cleaned up reference (SDir).\n"));
UDFPrint(("UDF: Found not cleaned up reference (SDir).\n"));
// (Update Child Objects - II)
if(Dloc->SDirInfo->ParentFile == FileInfo) {
@ -2402,7 +2402,7 @@ UDFCleanUpFile__(
// place (in parallel object)
if(!KeepDloc) {
BrutePoint();
KdPrint((" Skipping cleanup\n"));
UDFPrint((" Skipping cleanup\n"));
return UDF_FREE_NOTHING;
}
@ -2998,7 +2998,7 @@ UDFCloseFile__(
if(!FileInfo) return STATUS_SUCCESS;
if(FileInfo->Index<2 && (FileInfo->ParentFile) && !UDFIsAStreamDir(FileInfo)) {
KdPrint(("Closing Current or Parent Directory... :-\\\n"));
UDFPrint(("Closing Current or Parent Directory... :-\\\n"));
if(FileInfo->RefCount) {
UDFInterlockedDecrement((PLONG)&(FileInfo->RefCount));
ASSERT(FileInfo->Dloc);
@ -3007,7 +3007,7 @@ UDFCloseFile__(
#ifdef UDF_DBG
} else {
BrutePoint();
KdPrint(("ERROR: Closing unreferenced file!\n"));
UDFPrint(("ERROR: Closing unreferenced file!\n"));
#endif // UDF_DBG
}
if(FileInfo->ParentFile->OpenCount) {
@ -3015,7 +3015,7 @@ UDFCloseFile__(
#ifdef UDF_DBG
} else {
BrutePoint();
KdPrint(("ERROR: Closing unopened file!\n"));
UDFPrint(("ERROR: Closing unopened file!\n"));
#endif // UDF_DBG
}
return STATUS_SUCCESS;
@ -3031,7 +3031,7 @@ UDFCloseFile__(
#ifdef UDF_DBG
} else {
BrutePoint();
KdPrint(("ERROR: Closing unreferenced file!\n"));
UDFPrint(("ERROR: Closing unreferenced file!\n"));
#endif // UDF_DBG
}
if(DirInfo) {
@ -3043,7 +3043,7 @@ UDFCloseFile__(
#ifdef UDF_DBG
} else {
BrutePoint();
KdPrint(("ERROR: Closing unopened file!\n"));
UDFPrint(("ERROR: Closing unopened file!\n"));
#endif // UDF_DBG
}
}
@ -3056,7 +3056,7 @@ UDFCloseFile__(
// ASSERT(FileInfo->Dloc->FELoc.Mapping[0].extLocation);
PartNum = UDFGetPartNumByPhysLba(Vcb, FileInfo->Dloc->FELoc.Mapping[0].extLocation);
if(PartNum == (uint32)-1) {
KdPrint((" Is DELETED ?\n"));
UDFPrint((" Is DELETED ?\n"));
if(DirInfo) {
PartNum = UDFGetPartNumByPhysLba(Vcb, DirInfo->Dloc->FELoc.Mapping[0].extLocation);
} else {
@ -3070,7 +3070,7 @@ UDFCloseFile__(
//ASSERT(FileInfo->Dloc->FELoc.Mapping[0].extLocation);
if(UDFIsAStreamDir(FileInfo)) {
if(!UDFIsSDirDeleted(FileInfo)) {
KdPrint((" Not DELETED SDir\n"));
UDFPrint((" Not DELETED SDir\n"));
BrutePoint();
}
ASSERT(!FileInfo->Dloc->FELoc.Modified);
@ -3133,14 +3133,14 @@ UDFCloseFile__(
}
if(!OS_SUCCESS(status = UDFFlushFE(Vcb, FileInfo, PartNum))) {
KdPrint(("Error flushing FE\n"));
UDFPrint(("Error flushing FE\n"));
//flush_recovery:
BrutePoint();
if(FileInfo->Index >= 2) {
PDIR_INDEX_ITEM DirNdx;
DirNdx = UDFDirIndex(UDFGetDirIndexByFileInfo(FileInfo), FileInfo->Index);
if(DirNdx) {
KdPrint(("Recovery: mark as deleted & flush FI\n"));
UDFPrint(("Recovery: mark as deleted & flush FI\n"));
DirNdx->FI_Flags |= UDF_FI_FLAG_FI_MODIFIED;
DirNdx->FileCharacteristics |= FILE_DELETED;
FileInfo->FileIdent->fileCharacteristics |= FILE_DELETED;
@ -3152,7 +3152,7 @@ UDFCloseFile__(
}
// ... but FI must be updated (if any)
if(!OS_SUCCESS(status = UDFFlushFI(Vcb, FileInfo, PartNum))) {
KdPrint(("Error flushing FI\n"));
UDFPrint(("Error flushing FI\n"));
return status;
}
#ifdef UDF_DBG
@ -3475,12 +3475,12 @@ UDFResizeFile__(
int8* OldInIcb = NULL;
PEXTENT_MAP NewMap;
KdPrint(("UDFResizeFile__: FI %x, -> %I64x\n", FileInfo, NewLength));
UDFPrint(("UDFResizeFile__: FI %x, -> %I64x\n", FileInfo, NewLength));
ValidateFileInfo(FileInfo);
// ASSERT(FileInfo->RefCount >= 1);
if((NewLength >> Vcb->LBlockSizeBits) > Vcb->TotalAllocUnits) {
KdPrint(("STATUS_DISK_FULL\n"));
UDFPrint(("STATUS_DISK_FULL\n"));
return STATUS_DISK_FULL;
}
if (NewLength == FileInfo->Dloc->DataLoc.Length) return STATUS_SUCCESS;
@ -3631,7 +3631,7 @@ UDFLoadVAT(
}
if((Vcb->LastTrackNum > 1) &&
(Vcb->LastLBA == Vcb->TrackMap[Vcb->LastTrackNum-1].LastLba)) {
KdPrint(("Hardware Read-only volume\n"));
UDFPrint(("Hardware Read-only volume\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY;
}
@ -3655,7 +3655,7 @@ retry_load_vat:
len = (uint32)UDFGetFileSize(VatFileInfo);
if(Vcb->Partitions[PartNdx].PartitionType == UDF_VIRTUAL_MAP15) {
// load Vat 1.50 header
KdPrint(("Load VAT 1.50\n"));
UDFPrint(("Load VAT 1.50\n"));
VirtualAllocationTable15* Buf;
if(((icbtag*)(VatFileInfo->Dloc->FileEntry+1))->fileType != UDF_FILE_TYPE_VAT15) {
status = STATUS_FILE_CORRUPT_ERROR;
@ -3687,7 +3687,7 @@ err_vat_15:
} else
if(Vcb->Partitions[PartNdx].PartitionType == UDF_VIRTUAL_MAP20) {
// load Vat 2.00 header
KdPrint(("Load VAT 2.00\n"));
UDFPrint(("Load VAT 2.00\n"));
VirtualAllocationTable20* Buf;
if(((icbtag*)(VatFileInfo->Dloc->FileEntry+1))->fileType != UDF_FILE_TYPE_VAT20) {
status = STATUS_FILE_CORRUPT_ERROR;
@ -3709,7 +3709,7 @@ err_vat_15:
} else {
// unknown (or wrong) VAT format
KdPrint(("unknown (or wrong) VAT format\n"));
UDFPrint(("unknown (or wrong) VAT format\n"));
status = STATUS_FILE_CORRUPT_ERROR;
goto err_vat_15;
}
@ -3886,7 +3886,7 @@ UDFFlushFE(
}
#endif // UDF_DBG
retry_flush_FE:
KdPrint((" FlushFE: %x\n", FileInfo->Dloc->FELoc.Mapping[0].extLocation));
UDFPrint((" FlushFE: %x\n", FileInfo->Dloc->FELoc.Mapping[0].extLocation));
#ifndef UDF_READ_ONLY_BUILD
UDFReTagDirectory(Vcb, FileInfo);
if(FileInfo->Dloc->DataLoc.Modified ||
@ -3894,7 +3894,7 @@ retry_flush_FE:
ASSERT(PartNum != (uint32)(-1));
// prepare new AllocDescs for flushing...
if(!OS_SUCCESS(status = UDFBuildAllocDescs(Vcb, PartNum, FileInfo, &NewAllocDescs))) {
KdPrint((" FlushFE: UDFBuildAllocDescs() faliled (%x)\n", status));
UDFPrint((" FlushFE: UDFBuildAllocDescs() faliled (%x)\n", status));
if(NewAllocDescs)
MyFreePool__(NewAllocDescs);
return status;
@ -3917,7 +3917,7 @@ retry_flush_FE:
status = UDFWriteExtent(Vcb, &(FileInfo->Dloc->AllocLoc), 0, (uint32)(FileInfo->Dloc->AllocLoc.Length), FALSE, NewAllocDescs, &WrittenBytes);
MyFreePool__(NewAllocDescs);
if(!OS_SUCCESS(status)) {
KdPrint((" FlushFE: UDFWriteExtent() faliled (%x)\n", status));
UDFPrint((" FlushFE: UDFWriteExtent() faliled (%x)\n", status));
return status;
}
#ifdef UDF_DBG
@ -3951,7 +3951,7 @@ retry_flush_FE:
ASSERT(PartNum != (uint32)(-1));
ASSERT(!PartNum);
if(PartNum == (uint32)(-1) || PartNum == (uint32)(-2)) {
KdPrint((" bad PartNum: %d\n", PartNum));
UDFPrint((" bad PartNum: %d\n", PartNum));
}
// update lengthAllocDescs in FE
UDFSetAllocDescLen(Vcb, FileInfo);
@ -3976,17 +3976,17 @@ retry_flush_FE:
(uint32)(FileInfo->Dloc->FELoc.Length), FALSE,
(int8*)(FileInfo->Dloc->FileEntry), &WrittenBytes);
if(!OS_SUCCESS(status)) {
KdPrint((" FlushFE: UDFWriteExtent(2) faliled (%x)\n", status));
UDFPrint((" FlushFE: UDFWriteExtent(2) faliled (%x)\n", status));
if(status == STATUS_DEVICE_DATA_ERROR) {
relocate_FE:
KdPrint((" try to relocate\n"));
UDFPrint((" try to relocate\n"));
EXTENT_INFO _FEExtInfo;
// calculate the length required
// allocate block for FE
if(OS_SUCCESS(UDFAllocateFESpace(Vcb, FileInfo->ParentFile, PartNum, &_FEExtInfo, (uint32)(FileInfo->Dloc->FELoc.Length)) )) {
KdPrint((" relocate %x -> %x\n",
UDFPrint((" relocate %x -> %x\n",
lba,
_FEExtInfo.Mapping[0].extLocation));
@ -4001,7 +4001,7 @@ relocate_FE:
AllocMode = ((PFILE_ENTRY)(FileInfo->Dloc->FileEntry))->icbTag.flags & ICB_FLAG_ALLOC_MASK;
if(AllocMode == ICB_FLAG_AD_IN_ICB) {
KdPrint((" IN-ICB data lost\n"));
UDFPrint((" IN-ICB data lost\n"));
FileInfo->Dloc->DataLoc.Mapping[0].extLocation = _FEExtInfo.Mapping[0].extLocation;
FileInfo->Dloc->DataLoc.Modified = TRUE;
} else {
@ -4013,7 +4013,7 @@ relocate_FE:
PDIR_INDEX_ITEM DirNdx;
DirNdx = UDFDirIndex(UDFGetDirIndexByFileInfo(FileInfo), FileInfo->Index);
if(DirNdx) {
KdPrint((" update reference in FI\n"));
UDFPrint((" update reference in FI\n"));
DirNdx->FileEntryLoc.logicalBlockNum =
FileInfo->FileIdent->icb.extLocation.logicalBlockNum =
UDFPhysLbaToPart(Vcb, PartNum, _FEExtInfo.Mapping[0].extLocation);
@ -4021,7 +4021,7 @@ relocate_FE:
}
}
// this will update
KdPrint((" retry flush...\n"));
UDFPrint((" retry flush...\n"));
goto retry_flush_FE;
}
}
@ -4070,7 +4070,7 @@ UDFFlushFI(
ASSERT(FileInfo->FileIdent->fileCharacteristics & FILE_DELETED);
}
#endif // UDF_DBG
KdPrint((" FlushFI: offs %x\n", (ULONG)(DirNdx->Offset)));
UDFPrint((" FlushFI: offs %x\n", (ULONG)(DirNdx->Offset)));
#ifndef UDF_READ_ONLY_BUILD
if((DirNdx->FI_Flags & UDF_FI_FLAG_FI_MODIFIED)) {
// flush FileIdent
@ -4129,7 +4129,7 @@ UDFFlushFile__(
ASSERT(FileInfo->Dloc->FELoc.Mapping[0].extLocation);
PartNum = UDFGetPartNumByPhysLba(Vcb, FileInfo->Dloc->FELoc.Mapping[0].extLocation);
if(PartNum == (uint32)-1) {
KdPrint((" Is DELETED ?\n"));
UDFPrint((" Is DELETED ?\n"));
if(FileInfo->ParentFile) {
PartNum = UDFGetPartNumByPhysLba(Vcb, FileInfo->ParentFile->Dloc->FELoc.Mapping[0].extLocation);
} else {
@ -4142,7 +4142,7 @@ UDFFlushFile__(
if(UDFIsAStreamDir(FileInfo)) {
if(!UDFIsSDirDeleted(FileInfo)) {
KdPrint((" Not DELETED SDir\n"));
UDFPrint((" Not DELETED SDir\n"));
BrutePoint();
}
ASSERT(!FileInfo->Dloc->FELoc.Modified);
@ -4180,10 +4180,10 @@ full_flush:
}
// flush FE
if(!OS_SUCCESS(status = UDFFlushFE(Vcb, FileInfo, PartNum))) {
KdPrint(("Error flushing FE\n"));
UDFPrint(("Error flushing FE\n"));
BrutePoint();
if(FlushFlags & UDF_FLUSH_FLAGS_LITE) {
KdPrint((" flush pre-alloc\n"));
UDFPrint((" flush pre-alloc\n"));
FlushFlags &= ~UDF_FLUSH_FLAGS_LITE;
goto full_flush;
}
@ -4191,7 +4191,7 @@ full_flush:
PDIR_INDEX_ITEM DirNdx;
DirNdx = UDFDirIndex(UDFGetDirIndexByFileInfo(FileInfo), FileInfo->Index);
if(DirNdx) {
KdPrint(("Recovery: mark as deleted & flush FI\n"));
UDFPrint(("Recovery: mark as deleted & flush FI\n"));
DirNdx->FI_Flags |= UDF_FI_FLAG_FI_MODIFIED;
DirNdx->FileCharacteristics |= FILE_DELETED;
FileInfo->FileIdent->fileCharacteristics |= FILE_DELETED;
@ -4604,14 +4604,14 @@ UDFReadTagged(
_SEH2_TRY {
RC = UDFReadSectors(Vcb, FALSE, Block, 1, FALSE, Buf, &ReadBytes);
if(!OS_SUCCESS(RC)) {
KdPrint(("UDF: Block=%x, Location=%x: read failed\n", Block, Location));
UDFPrint(("UDF: Block=%x, Location=%x: read failed\n", Block, Location));
try_return(RC);
}
*Ident = PTag->tagIdent;
if(Location != PTag->tagLocation) {
KdPrint(("UDF: location mismatch block %x, tag %x != %x\n",
UDFPrint(("UDF: location mismatch block %x, tag %x != %x\n",
Block, PTag->tagLocation, Location));
try_return(RC = STATUS_FILE_CORRUPT_ERROR);
}
@ -4623,14 +4623,14 @@ UDFReadTagged(
checksum += (uint8)((i!=4) ? (*tb) : 0);
if(checksum != PTag->tagChecksum) {
KdPrint(("UDF: tag checksum failed block %x\n", Block));
UDFPrint(("UDF: tag checksum failed block %x\n", Block));
try_return(RC = STATUS_CRC_ERROR);
}
// Verify the tag version
if((PTag->descVersion != 2) &&
(PTag->descVersion != 3)) {
KdPrint(("UDF: Tag version 0x%04x != 0x0002 || 0x0003 block %x\n",
UDFPrint(("UDF: Tag version 0x%04x != 0x0002 || 0x0003 block %x\n",
(PTag->descVersion), Block));
try_return(RC = STATUS_FILE_CORRUPT_ERROR);
}
@ -4639,16 +4639,16 @@ UDFReadTagged(
if(((PTag->descCRCLength) + sizeof(tag) > Vcb->BlockSize) ||
((PTag->descCRC) == UDFCrc((uint8*)Buf + sizeof(tag), PTag->descCRCLength)) ||
!(PTag->descCRC) ) {
/* KdPrint(("Tag ID: %x, ver %x\t", PTag->tagIdent, PTag->descVersion ));
/* UDFPrint(("Tag ID: %x, ver %x\t", PTag->tagIdent, PTag->descVersion ));
if((i == TID_FILE_ENTRY) ||
(i == TID_EXTENDED_FILE_ENTRY)) {
KdPrint(("StrategType: %x, ", Icb->strategyType ));
KdPrint(("FileType: %x\t", Icb->fileType ));
UDFPrint(("StrategType: %x, ", Icb->strategyType ));
UDFPrint(("FileType: %x\t", Icb->fileType ));
}
KdPrint(("\n"));*/
UDFPrint(("\n"));*/
try_return(RC = STATUS_SUCCESS);
}
KdPrint(("UDF: Crc failure block %x: crc = %x, crclen = %x\n",
UDFPrint(("UDF: Crc failure block %x: crc = %x, crclen = %x\n",
Block, PTag->descCRC, PTag->descCRCLength));
RC = STATUS_CRC_ERROR;
@ -5323,7 +5323,7 @@ UDFUpdateVAT(
uint16 PartNdx = (uint16)(Vcb->VatPartNdx);
uint16 PartNum = (uint16)(Lba ? UDFGetPartNumByPhysLba(Vcb, Lba) : UDFGetPartNumByPartNdx(Vcb, PartNdx));
if(PartNum != UDFGetPartNumByPartNdx(Vcb, PartNdx)) {
KdPrint(("UDFUpdateVAT: Write to Write-Protected partition\n"));
UDFPrint(("UDFUpdateVAT: Write to Write-Protected partition\n"));
return STATUS_MEDIA_WRITE_PROTECTED;
}
// !!! NOTE !!!

View file

@ -120,6 +120,7 @@ extern "C" {
#define PEXTENDED_IO_STACK_LOCATION PIO_STACK_LOCATION
#define NDEBUG
#ifndef NDEBUG
#define UDF_DBG
#endif
@ -220,6 +221,13 @@ extern CCHAR DefLetter[];
))
#if !defined(UDF_DBG) && !defined(PRINT_ALWAYS)
#define UDFPrint(Args)
#else
#define UDFPrint(Args) KdPrint(Args)
#endif
#define UDFPrintErr(Args) KdPrint(Args)
//
#if !defined(UDF_DBG) && !defined(PRINT_ALWAYS)

View file

@ -103,8 +103,8 @@ DriverEntry(
HKEY hUdfRootKey;
LARGE_INTEGER delay;
// KdPrint(("UDF: Entered " VER_STR_PRODUCT_NAME " UDF DriverEntry \n"));
// KdPrint((KD_PREFIX "Build " VER_STR_PRODUCT "\n"));
// UDFPrint(("UDF: Entered " VER_STR_PRODUCT_NAME " UDF DriverEntry \n"));
// UDFPrint((KD_PREFIX "Build " VER_STR_PRODUCT "\n"));
_SEH2_TRY {
_SEH2_TRY {
@ -113,11 +113,11 @@ DriverEntry(
CrNtInit(DriverObject, RegistryPath);
//PsGetVersion(&MajorVersion, &MinorVersion, &BuildNumber, NULL);
KdPrint(("UDF: OS Version Major: %x, Minor: %x, Build number: %d\n",
UDFPrint(("UDF: OS Version Major: %x, Minor: %x, Build number: %d\n",
MajorVersion, MinorVersion, BuildNumber));
*/
#ifdef __REACTOS__
KdPrint(("UDF Init: OS should be ReactOS\n"));
UDFPrint(("UDF Init: OS should be ReactOS\n"));
#endif
// initialize the global data structure
@ -145,7 +145,7 @@ DriverEntry(
// initialize the mounted logical volume list head
InitializeListHead(&(UDFGlobalData.VCBQueue));
KdPrint(("UDF: Init memory manager\n"));
UDFPrint(("UDF: Init memory manager\n"));
// Initialize internal memory management
if(!MyAllocInit()) {
try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
@ -173,7 +173,7 @@ DriverEntry(
RtlInitUnicodeString(&UDFGlobalData.UnicodeStrSDir, L":");
RtlInitUnicodeString(&UDFGlobalData.AclName, UDF_SN_NT_ACL);
KdPrint(("UDF: Init delayed close queues\n"));
UDFPrint(("UDF: Init delayed close queues\n"));
#ifdef UDF_DELAYED_CLOSE
InitializeListHead( &UDFGlobalData.DelayedCloseQueue );
InitializeListHead( &UDFGlobalData.DirDelayedCloseQueue );
@ -193,11 +193,11 @@ DriverEntry(
UDFGlobalData.DefaultZoneSizeInNumStructs=10;
KdPrint(("UDF: Init zones\n"));
UDFPrint(("UDF: Init zones\n"));
if (!NT_SUCCESS(RC = UDFInitializeZones()))
try_return(RC);
KdPrint(("UDF: Init pointers\n"));
UDFPrint(("UDF: Init pointers\n"));
// initialize the IRP major function table, and the fast I/O table
UDFInitializeFunctionPointers(DriverObject);
@ -212,7 +212,7 @@ DriverEntry(
RtlInitUnicodeString(&DriverDeviceName, UDF_FS_NAME);
KdPrint(("UDF: Create Driver dev obj\n"));
UDFPrint(("UDF: Create Driver dev obj\n"));
if (!NT_SUCCESS(RC = IoCreateDevice(
DriverObject, // our driver object
sizeof(UDFFS_DEV_EXTENSION), // don't need an extension for this object
@ -239,7 +239,7 @@ DriverEntry(
RtlInitUnicodeString(&unicodeDeviceName, UDF_DOS_FS_NAME);
IoCreateSymbolicLink(&unicodeDeviceName, &DriverDeviceName);
KdPrint(("UDF: Create CD dev obj\n"));
UDFPrint(("UDF: Create CD dev obj\n"));
if (!NT_SUCCESS(RC = UDFCreateFsDeviceObject(UDF_FS_NAME_CD,
DriverObject,
FILE_DEVICE_CD_ROM_FILE_SYSTEM,
@ -248,7 +248,7 @@ DriverEntry(
try_return(RC);
}
#ifdef UDF_HDD_SUPPORT
KdPrint(("UDF: Create HDD dev obj\n"));
UDFPrint(("UDF: Create HDD dev obj\n"));
if (!NT_SUCCESS(RC = UDFCreateFsDeviceObject(UDF_FS_NAME_HDD,
DriverObject,
FILE_DEVICE_DISK_FILE_SYSTEM,
@ -300,18 +300,18 @@ DriverEntry(
*/
if (UDFGlobalData.UDFDeviceObject_CD) {
KdPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for CD\n"));
UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for CD\n"));
IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_CD);
}
#ifdef UDF_HDD_SUPPORT
if (UDFGlobalData.UDFDeviceObject_HDD) {
KdPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for HDD\n"));
UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for HDD\n"));
IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_HDD);
}
#endif // UDF_HDD_SUPPORT
FsRegistered = TRUE;
KdPrint(("UDF: IoRegisterFsRegistrationChange()\n"));
UDFPrint(("UDF: IoRegisterFsRegistrationChange()\n"));
IoRegisterFsRegistrationChange( DriverObject, (PDRIVER_FS_NOTIFICATION)UDFFsNotification );
// delay.QuadPart = -10000000;
@ -323,12 +323,12 @@ DriverEntry(
#if 0
if(!WinVer_IsNT) {
/*ExInitializeWorkItem(&RemountWorkQueueItem, UDFRemountAll, NULL);
KdPrint(("UDFDriverEntry: create remount thread\n"));
UDFPrint(("UDFDriverEntry: create remount thread\n"));
ExQueueWorkItem(&RemountWorkQueueItem, DelayedWorkQueue);*/
for(CdRomNumber = 0;true;CdRomNumber++) {
sprintf(deviceNameBuffer, "\\Device\\CdRom%d", CdRomNumber);
KdPrint(( "UDF: DriverEntry : dismount %s\n", deviceNameBuffer));
UDFPrint(( "UDF: DriverEntry : dismount %s\n", deviceNameBuffer));
RtlInitString(&deviceName, deviceNameBuffer);
RC = RtlAnsiStringToUnicodeString(&unicodeCdRomDeviceName, &deviceName, TRUE);
@ -358,7 +358,7 @@ DriverEntry(
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
// we encountered an exception somewhere, eat it up
KdPrint(("UDF: exception\n"));
UDFPrint(("UDF: exception\n"));
RC = _SEH2_GetExceptionCode();
} _SEH2_END;
@ -368,7 +368,7 @@ DriverEntry(
} _SEH2_FINALLY {
// start unwinding if we were unsuccessful
if (!NT_SUCCESS(RC)) {
KdPrint(("UDF: failed with status %x\n", RC));
UDFPrint(("UDF: failed with status %x\n", RC));
// Now, delete any device objects, etc. we may have created
/* if (UDFGlobalData.UDFDeviceObject) {
IoDeleteDevice(UDFGlobalData.UDFDeviceObject);
@ -598,7 +598,7 @@ UDFCreateFsDeviceObject(
RtlInitUnicodeString(&DriverDeviceName, FsDeviceName);
*DeviceObject = NULL;
KdPrint(("UDFCreateFsDeviceObject: create dev\n"));
UDFPrint(("UDFCreateFsDeviceObject: create dev\n"));
if (!NT_SUCCESS(RC = IoCreateDevice(
DriverObject, // our driver object
@ -624,7 +624,7 @@ UDFCreateFsDeviceObject(
// register the driver with the I/O Manager, pretend as if this is
// a physical disk based FSD (or in order words, this FSD manages
// logical volumes residing on physical disk drives)
/* KdPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem()\n"));
/* UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem()\n"));
IoRegisterFileSystem(*DeviceObject);*/
return(RC);
} // end UDFCreateFsDeviceObject()
@ -653,7 +653,7 @@ UDFDismountDevice(
NULL,
NULL );
KdPrint(("\n*** UDFDismountDevice: Create\n"));
UDFPrint(("\n*** UDFDismountDevice: Create\n"));
RC = ZwCreateFile( &NtFileHandle,
GENERIC_READ,
&ObjectAttributes,
@ -669,7 +669,7 @@ UDFDismountDevice(
if (!NT_SUCCESS(RC)) try_return(RC);
KdPrint(("\n*** UDFDismountDevice: QueryVolInfo\n"));
UDFPrint(("\n*** UDFDismountDevice: QueryVolInfo\n"));
RC = ZwQueryVolumeInformationFile( NtFileHandle,
&IoStatus,
Buffer,
@ -689,7 +689,7 @@ UDFDismountDevice(
UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_DVDpRW) ||
UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_DVDRAM) )) try_return(STATUS_SUCCESS);
KdPrint(("\n*** UDFDismountDevice: LockVolume\n"));
UDFPrint(("\n*** UDFDismountDevice: LockVolume\n"));
RC = ZwFsControlFile(NtFileHandle,
NULL,
NULL,
@ -703,7 +703,7 @@ UDFDismountDevice(
if (!NT_SUCCESS(RC)) try_return(RC);
KdPrint(("\n*** UDFDismountDevice: DismountVolume\n"));
UDFPrint(("\n*** UDFDismountDevice: DismountVolume\n"));
RC = ZwFsControlFile(NtFileHandle,
NULL,
NULL,
@ -717,7 +717,7 @@ UDFDismountDevice(
if (!NT_SUCCESS(RC)) try_return(RC);
KdPrint(("\n*** UDFDismountDevice: NotifyMediaChange\n"));
UDFPrint(("\n*** UDFDismountDevice: NotifyMediaChange\n"));
RC = ZwDeviceIoControlFile(NtFileHandle,
NULL,
NULL,
@ -732,7 +732,7 @@ UDFDismountDevice(
if (!NT_SUCCESS(RC)) try_return(RC);
KdPrint(("\n*** UDFDismountDevice: UnlockVolume\n"));
UDFPrint(("\n*** UDFDismountDevice: UnlockVolume\n"));
RC = ZwFsControlFile(NtFileHandle,
NULL,
NULL,
@ -744,12 +744,12 @@ UDFDismountDevice(
NULL,
NULL);
KdPrint(("\n*** UDFDismountDevice: Close\n"));
UDFPrint(("\n*** UDFDismountDevice: Close\n"));
ZwClose( NtFileHandle );
NtFileHandle = (HANDLE)-1;
KdPrint(("\n*** UDFDismountDevice: Create 2\n"));
UDFPrint(("\n*** UDFDismountDevice: Create 2\n"));
RC = ZwCreateFile( &NtFileHandle,
GENERIC_READ,
&ObjectAttributes,
@ -769,7 +769,7 @@ try_exit: NOTHING;
if (NtFileHandle != (HANDLE)-1) ZwClose( NtFileHandle );
} _SEH2_END;
KdPrint(("\n*** UDFDismountDevice: RC=%x\n",RC));
UDFPrint(("\n*** UDFDismountDevice: RC=%x\n",RC));
return RC;
}
@ -825,7 +825,7 @@ Return Value:
&& UDFGlobalData.UDFDeviceObject_HDD != DeviceObject
#endif // UDF_HDD_SUPPORT
) {
KdPrint(("\n*** UDFFSNotification \n\n"));
UDFPrint(("\n*** UDFFSNotification \n\n"));
// Acquire GlobalDataResource
UDFAcquireResourceExclusive(&(UDFGlobalData.GlobalDataResource), TRUE);
@ -845,7 +845,7 @@ Return Value:
FsNotification_ThreadId = (HANDLE)(-1);
} else {
KdPrint(("\n*** recursive UDFFSNotification call,\n can't become top-level UDF FSD \n\n"));
UDFPrint(("\n*** recursive UDFFSNotification call,\n can't become top-level UDF FSD \n\n"));
}
// Release the global resource.
@ -872,7 +872,7 @@ UDFRemountAll(
/* for(CdRomNumber = 0;true;CdRomNumber++) {
sprintf(deviceNameBuffer, "\\Device\\CdRom%d", CdRomNumber);
KdPrint(( "UDF: UDFRemountAll : dismount %s\n", deviceNameBuffer));
UDFPrint(( "UDF: UDFRemountAll : dismount %s\n", deviceNameBuffer));
RtlInitString(&deviceName, deviceNameBuffer);
RC = RtlAnsiStringToUnicodeString(&unicodeCdRomDeviceName, &deviceName, TRUE);

View file

@ -22,7 +22,7 @@ UDFDriverUnload(
// significant amount of work here deallocating stuff.
//
KdPrint( ("UDF: Unloading!!\n") );
UDFPrint( ("UDF: Unloading!!\n") );
// prevent mount oparations
UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_BEING_UNLOADED;
@ -30,7 +30,7 @@ UDFDriverUnload(
// wait for all volumes to be dismounted
delay.QuadPart = 10*1000*1000*10;
while(TRUE) {
KdPrint(("Poll...\n"));
UDFPrint(("Poll...\n"));
KeDelayExecutionThread(KernelMode, FALSE, &delay);
}

View file

@ -45,7 +45,7 @@ UDFVerifyVcb(
BOOLEAN Nop = TRUE;
BOOLEAN UnsafeIoctl = (Vcb->VCBFlags & UDF_VCB_FLAGS_UNSAFE_IOCTL) ? TRUE : FALSE;
KdPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
UDFPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
// Fail immediately if the volume is in the progress of being dismounted
// or has been marked invalid.
if (Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED) {
@ -58,7 +58,7 @@ UDFVerifyVcb(
if ( (Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA) &&
!(Vcb->Vpb->RealDevice->Flags & DO_VERIFY_VOLUME) &&
(!(Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) || UnsafeIoctl) ) {
KdPrint(("UDFVerifyVCB: UnsafeIoctl=%d, locked=%d\n", UnsafeIoctl, (Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) ? 0 : 1));
UDFPrint(("UDFVerifyVCB: UnsafeIoctl=%d, locked=%d\n", UnsafeIoctl, (Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) ? 0 : 1));
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_UNSAFE_IOCTL;
RC = UDFTSendIOCTL( IOCTL_STORAGE_CHECK_VERIFY,
Vcb,
@ -68,7 +68,7 @@ UDFVerifyVcb(
// Be safe about the count in case the driver didn't fill it in
if (Iosb.Information != sizeof(ULONG)) MediaChangeCount = 0;
KdPrint((" MediaChangeCount %d -> %d\n", Vcb->MediaChangeCount, MediaChangeCount));
UDFPrint((" MediaChangeCount %d -> %d\n", Vcb->MediaChangeCount, MediaChangeCount));
// If the volume is now an empty device, or we have receieved a
// bare STATUS_VERIFY_REQUIRED (various hardware conditions such
@ -81,7 +81,7 @@ UDFVerifyVcb(
(NT_SUCCESS(RC) && (Vcb->MediaChangeCount != MediaChangeCount)) ||
UnsafeIoctl) {
KdPrint((" set DO_VERIFY_VOLUME\n"));
UDFPrint((" set DO_VERIFY_VOLUME\n"));
Vcb->Vpb->RealDevice->Flags |= DO_VERIFY_VOLUME;
// If the volume is not mounted and we got a media change count,
@ -97,45 +97,45 @@ UDFVerifyVcb(
} else if (!NT_SUCCESS(RC)) {
// Vcb->Vpb->RealDevice->Flags |= DO_VERIFY_VOLUME;
KdPrint((" UDFNormalizeAndRaiseStatus(%x)\n", RC));
UDFPrint((" UDFNormalizeAndRaiseStatus(%x)\n", RC));
UDFNormalizeAndRaiseStatus(IrpContext,RC);
ASSERT(Nop);
}
}
KdPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
UDFPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
// The Vcb may be mounted but the underlying real device may need to be verified.
// If it does then we'll set the Iosb in the irp to be our real device
if (Vcb->Vpb->RealDevice->Flags & DO_VERIFY_VOLUME) {
KdPrint((" DO_VERIFY_VOLUME -> IoSetHardErrorOrVerifyDevice()\n"));
UDFPrint((" DO_VERIFY_VOLUME -> IoSetHardErrorOrVerifyDevice()\n"));
IoSetHardErrorOrVerifyDevice( IrpContext->Irp,
Vcb->Vpb->RealDevice );
RC = STATUS_VERIFY_REQUIRED;
KdPrint((" UDFRaiseStatus()\n"));
UDFPrint((" UDFRaiseStatus()\n"));
UDFRaiseStatus(IrpContext, RC);
ASSERT(Nop);
}
KdPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
UDFPrint(("UDFVerifyVCB: Modified=%d\n", Vcb->Modified));
if (!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)) {
KdPrint((" !UDF_VCB_FLAGS_VOLUME_MOUNTED -> IoSetHardErrorOrVerifyDevice()\n"));
UDFPrint((" !UDF_VCB_FLAGS_VOLUME_MOUNTED -> IoSetHardErrorOrVerifyDevice()\n"));
Vcb->Vpb->RealDevice->Flags |= DO_VERIFY_VOLUME;
IoSetHardErrorOrVerifyDevice( IrpContext->Irp, Vcb->Vpb->RealDevice );
RC = STATUS_WRONG_VOLUME;
KdPrint((" UDFRaiseStatus()\n"));
UDFPrint((" UDFRaiseStatus()\n"));
UDFRaiseStatus(IrpContext, RC);
// UDFRaiseStatus(IrpContext, STATUS_UNRECOGNIZED_VOLUME);
ASSERT(Nop);
}
if ((Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED)) {
KdPrint((" UDF_VCB_FLAGS_BEING_DISMOUNTED\n"));
UDFPrint((" UDF_VCB_FLAGS_BEING_DISMOUNTED\n"));
RC = STATUS_FILE_INVALID;
UDFRaiseStatus( IrpContext, RC );
ASSERT(Nop);
}
KdPrint(("UDFVerifyVcb: RC = %x\n", RC));
UDFPrint(("UDFVerifyVcb: RC = %x\n", RC));
return RC;
} // end UDFVerifyVcb()
@ -172,7 +172,7 @@ UDFVerifyVolume(
// Update the real device in the IrpContext from the Vpb. There was no available
// file object when the IrpContext was created.
// IrpContext->RealDevice = Vpb->RealDevice;
KdPrint(("UDFVerifyVolume:\n"));
UDFPrint(("UDFVerifyVolume:\n"));
// Acquire shared global access, the termination handler for the
// following try statement will free the access.
@ -182,14 +182,14 @@ UDFVerifyVolume(
_SEH2_TRY {
KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
// Check if the real device still needs to be verified. If it doesn't
// then obviously someone beat us here and already did the work
// so complete the verify irp with success. Otherwise reenable
// the real device and get to work.
if( !(Vpb->RealDevice->Flags & DO_VERIFY_VOLUME) &&
((Vcb->VCBFlags & UDF_VCB_FLAGS_MEDIA_LOCKED) && !UnsafeIoctl) ) {
KdPrint(("UDFVerifyVolume: STATUS_SUCCESS (1)\n"));
UDFPrint(("UDFVerifyVolume: STATUS_SUCCESS (1)\n"));
try_return(RC = STATUS_SUCCESS);
}
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_UNSAFE_IOCTL;
@ -204,12 +204,12 @@ UDFVerifyVolume(
// If we will allow a raw mount then return WRONG_VOLUME to
// allow the volume to be mounted by raw.
if(FlagOn( IrpSp->Flags, SL_ALLOW_RAW_MOUNT )) {
KdPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (1)\n"));
UDFPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (1)\n"));
RC = STATUS_WRONG_VOLUME;
}
if(UDFIsRawDevice(RC)) {
KdPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (2)\n"));
UDFPrint(("UDFVerifyVolume: STATUS_WRONG_VOLUME (2)\n"));
RC = STATUS_WRONG_VOLUME;
}
try_return( RC );
@ -220,8 +220,8 @@ UDFVerifyVolume(
MediaChangeCount = 0;
}
KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
KdPrint(("UDFVerifyVolume: MediaChangeCount=%x, Vcb->MediaChangeCount=%x, UnsafeIoctl=%x\n",
UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
UDFPrint(("UDFVerifyVolume: MediaChangeCount=%x, Vcb->MediaChangeCount=%x, UnsafeIoctl=%x\n",
MediaChangeCount, Vcb->MediaChangeCount, UnsafeIoctl));
// Verify that the device actually saw a change. If the driver does not
// support the MCC, then we must verify the volume in any case.
@ -229,7 +229,7 @@ UDFVerifyVolume(
(Vcb->MediaChangeCount != MediaChangeCount) ||
UnsafeIoctl ) {
KdPrint(("UDFVerifyVolume: compare\n"));
UDFPrint(("UDFVerifyVolume: compare\n"));
NewVcb = (PVCB)MyAllocatePool__(NonPagedPool,sizeof(VCB));
if(!NewVcb)
@ -251,13 +251,13 @@ UDFVerifyVolume(
NewVcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_READ_ONLY |
UDF_VCB_FLAGS_MEDIA_READ_ONLY;
// Compare physical parameters (phase 1)
KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
RC = UDFCompareVcb(Vcb,NewVcb, TRUE);
if(!NT_SUCCESS(RC)) try_return(RC);
if((Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) &&
Vcb->MountPhErrorCount > MOUNT_ERR_THRESHOLD ) {
KdPrint(("UDFVerifyVolume: it was very BAD volume. Do not perform Logical check\n"));
UDFPrint(("UDFVerifyVolume: it was very BAD volume. Do not perform Logical check\n"));
goto skip_logical_check;
}
// Initialize internal cache
@ -285,14 +285,14 @@ UDFVerifyVolume(
UDFWCacheErrorHandler);
if(!NT_SUCCESS(RC)) try_return(RC);
KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
RC = UDFGetDiskInfoAndVerify(NewVcb->TargetDeviceObject,NewVcb);
KdPrint((" NewVcb->NSRDesc=%x\n", NewVcb->NSRDesc));
UDFPrint((" NewVcb->NSRDesc=%x\n", NewVcb->NSRDesc));
if(!NT_SUCCESS(RC)) {
if((Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) &&
(NewVcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) &&
!(NewVcb->NSRDesc & VRS_ISO9660_FOUND)) {
KdPrint(("UDFVerifyVolume: both are RAW -> remount\n", Vcb->Modified));
UDFPrint(("UDFVerifyVolume: both are RAW -> remount\n", Vcb->Modified));
RC = STATUS_SUCCESS;
goto skip_logical_check;
}
@ -308,7 +308,7 @@ UDFVerifyVolume(
NewVcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_MOUNTED;
// Compare logical parameters (phase 2)
KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
RC = UDFCompareVcb(Vcb,NewVcb, FALSE);
if(!NT_SUCCESS(RC)) try_return(RC);
// We have unitialized WCache, so it is better to
@ -320,10 +320,10 @@ skip_logical_check:;
}
KdPrint(("UDFVerifyVolume: compared\n"));
KdPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
UDFPrint(("UDFVerifyVolume: compared\n"));
UDFPrint(("UDFVerifyVolume: Modified=%d\n", Vcb->Modified));
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_LOCKED)) {
KdPrint(("UDFVerifyVolume: set UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
UDFPrint(("UDFVerifyVolume: set UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_MOUNTED;
Vcb->SoftEjectReq = FALSE;
}
@ -339,7 +339,7 @@ try_exit: NOTHING;
// If we got the wrong volume, mark the Vcb as not mounted.
if(RC == STATUS_WRONG_VOLUME) {
KdPrint(("UDFVerifyVolume: clear UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
UDFPrint(("UDFVerifyVolume: clear UDF_VCB_FLAGS_VOLUME_MOUNTED\n"));
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
Vcb->WriteSecurity = FALSE;
// ASSERT(!(Vcb->EjectWaiter));
@ -352,7 +352,7 @@ try_exit: NOTHING;
if(NT_SUCCESS(RC) &&
(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_MOUNTED)){
BOOLEAN CacheInitialized = FALSE;
KdPrint((" !!! VerifyVolume - QUICK REMOUNT !!!\n"));
UDFPrint((" !!! VerifyVolume - QUICK REMOUNT !!!\n"));
// Initialize internal cache
CacheInitialized = WCacheIsInitialized__(&(Vcb->FastCache));
if(!CacheInitialized) {
@ -390,10 +390,10 @@ try_exit: NOTHING;
if(!Vcb->CDR_Mode) {
if((Vcb->TargetDeviceObject->DeviceType == FILE_DEVICE_DISK) ||
CdrwMediaClassEx_IsRAM(Vcb->MediaClassEx)) {
KdPrint(("UDFMountVolume: RAM mode\n"));
UDFPrint(("UDFMountVolume: RAM mode\n"));
Mode = WCACHE_MODE_RAM;
} else {
KdPrint(("UDFMountVolume: RW mode\n"));
UDFPrint(("UDFMountVolume: RW mode\n"));
Mode = WCACHE_MODE_RW;
}
/* if(FsDeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM) {
@ -415,10 +415,10 @@ try_exit: NOTHING;
Vcb->WriteSecurity = FALSE;
Vcb->UseExtendedFE = FALSE;
}
KdPrint(("UDFVerifyVolume: try start EjectWaiter\n"));
UDFPrint(("UDFVerifyVolume: try start EjectWaiter\n"));
RC = UDFStartEjectWaiter(Vcb);
if(!NT_SUCCESS(RC)) {
KdPrint(("UDFVerifyVolume: start EjectWaiter failed\n"));
UDFPrint(("UDFVerifyVolume: start EjectWaiter failed\n"));
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_MOUNTED;
Vcb->WriteSecurity = FALSE;
}
@ -427,7 +427,7 @@ try_exit: NOTHING;
if(NewVcb) {
// Release internal cache
KdPrint(("UDFVerifyVolume: delete NewVcb\n"));
UDFPrint(("UDFVerifyVolume: delete NewVcb\n"));
WCacheFlushAll__(&(NewVcb->FastCache),NewVcb);
WCacheRelease__(&(NewVcb->FastCache));
@ -449,7 +449,7 @@ try_exit: NOTHING;
Irp->IoStatus.Status = RC;
IoCompleteRequest(Irp,IO_DISK_INCREMENT);
KdPrint(("UDFVerifyVolume: RC = %x\n", RC));
UDFPrint(("UDFVerifyVolume: RC = %x\n", RC));
return RC;
} // end UDFVerifyVolume ()
@ -480,7 +480,7 @@ UDFPerformVerify(
NTSTATUS RC = STATUS_SUCCESS;
PIO_STACK_LOCATION IrpSp;
KdPrint(("UDFPerformVerify:\n"));
UDFPrint(("UDFPerformVerify:\n"));
if(!IrpContext) return STATUS_INVALID_PARAMETER;
if(!Irp) return STATUS_INVALID_PARAMETER;
@ -506,7 +506,7 @@ UDFPerformVerify(
Vcb = (PVCB)IrpSp->DeviceObject->DeviceExtension;
KdPrint(("UDFPerformVerify: check\n"));
UDFPrint(("UDFPerformVerify: check\n"));
// Check if the volume still thinks it needs to be verified,
// if it doesn't then we can skip doing a verify because someone
// else beat us to it.
@ -547,7 +547,7 @@ UDFPerformVerify(
(Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED)) &&
(Vcb->VCBOpenCount <= UDF_RESIDUAL_REFERENCE) )
{
KdPrint(("UDFPerformVerify: UDFCheckForDismount\n"));
UDFPrint(("UDFPerformVerify: UDFCheckForDismount\n"));
UDFAcquireResourceExclusive(&(UDFGlobalData.GlobalDataResource), TRUE);
UDFCheckForDismount( IrpContext, Vcb, FALSE );
UDFReleaseResource(&(UDFGlobalData.GlobalDataResource));
@ -559,7 +559,7 @@ UDFPerformVerify(
(IrpSp->FileObject->RelatedFileObject == NULL) &&
((RC == STATUS_SUCCESS) || (RC == STATUS_WRONG_VOLUME)) ) {
KdPrint(("UDFPerformVerify: IO_REMOUNT\n"));
UDFPrint(("UDFPerformVerify: IO_REMOUNT\n"));
Irp->IoStatus.Information = IO_REMOUNT;
@ -576,12 +576,12 @@ UDFPerformVerify(
// for a popup.
} else if ((Irp != NULL) && !NT_SUCCESS( RC )) {
KdPrint(("UDFPerformVerify: check IoIsErrorUserInduced\n"));
UDFPrint(("UDFPerformVerify: check IoIsErrorUserInduced\n"));
// Fill in the device object if required.
if (IoIsErrorUserInduced( RC ) ) {
IoSetHardErrorOrVerifyDevice( Irp, DeviceToVerify );
}
KdPrint(("UDFPerformVerify: UDFNormalizeAndRaiseStatus\n"));
UDFPrint(("UDFPerformVerify: UDFNormalizeAndRaiseStatus\n"));
UDFNormalizeAndRaiseStatus( IrpContext, RC );
}
}
@ -599,7 +599,7 @@ UDFPerformVerify(
RC = UDFExceptionHandler( IrpContext, Irp);
} _SEH2_END;
KdPrint(("UDFPerformVerify: RC = %x\n", RC));
UDFPrint(("UDFPerformVerify: RC = %x\n", RC));
return RC;
@ -637,7 +637,7 @@ UDFCheckForDismount(
BOOLEAN VcbAcquired;
ULONG ResidualReferenceCount;
KdPrint(("UDFCheckForDismount:\n"));
UDFPrint(("UDFCheckForDismount:\n"));
if(!Vcb) return FALSE;
// GlobalDataResource is already acquired
@ -737,7 +737,7 @@ UDFDismountVcb(
BOOLEAN FinalReference;
KdPrint(("UDFDismountVcb:\n"));
UDFPrint(("UDFDismountVcb:\n"));
// We should only take this path once.
ASSERT( !(Vcb->VCBFlags & UDF_VCB_FLAGS_BEING_DISMOUNTED) );
@ -856,9 +856,9 @@ UDFCompareVcb(
UDF_FILE_INFO RootFileInfo;
BOOLEAN SimpleLogicalCheck = FALSE;
KdPrint(("UDFCompareVcb:\n"));
UDFPrint(("UDFCompareVcb:\n"));
if(UDFGlobalData.UDFFlags & UDF_DATA_FLAGS_BEING_UNLOADED) {
KdPrint((" WRONG_VOLUME\n"));
UDFPrint((" WRONG_VOLUME\n"));
return STATUS_WRONG_VOLUME;
}
@ -866,7 +866,7 @@ UDFCompareVcb(
// compare physical parameters
if(PhysicalOnly) {
KdPrint((" PhysicalOnly\n"));
UDFPrint((" PhysicalOnly\n"));
if(VCB_NE(FirstLBA) ||
VCB_NE(LastLBA) ||
VCB_NE(FirstTrackNum) ||
@ -888,13 +888,13 @@ UDFCompareVcb(
// VCB_NE(xxx) ||
VCB_NE(LastSession) ) {
KdPrint((" WRONG_VOLUME (2)\n"));
UDFPrint((" WRONG_VOLUME (2)\n"));
return STATUS_WRONG_VOLUME;
}
// Note, MRWStatus can change while media is mounted (stoppped/in-progress/complete)
// We can compare only (Vcb->MRWStatus == 0) values
if((OldVcb->MRWStatus == 0) != (NewVcb->MRWStatus == 0)) {
KdPrint((" WRONG_VOLUME (4), missmatch MRW status\n"));
UDFPrint((" WRONG_VOLUME (4), missmatch MRW status\n"));
}
for(uint32 i=OldVcb->FirstTrackNum; i<=OldVcb->LastTrackNum; i++) {
if(VCB_NE(TrackMap[i].FirstLba) ||
@ -903,11 +903,11 @@ UDFCompareVcb(
VCB_NE(TrackMap[i].TrackParam) ||
VCB_NE(TrackMap[i].DataParam) ||
VCB_NE(TrackMap[i].NWA_V) ) {
KdPrint((" WRONG_VOLUME (3), missmatch trk %d\n", i));
UDFPrint((" WRONG_VOLUME (3), missmatch trk %d\n", i));
return STATUS_WRONG_VOLUME;
}
}
KdPrint((" Vcb compare Ok\n"));
UDFPrint((" Vcb compare Ok\n"));
return STATUS_SUCCESS;
}
@ -917,48 +917,48 @@ UDFCompareVcb(
// Now, we hope, that nobody changed media.
// We shall make simplified logical structure check
if(OldVcb->Modified) {
KdPrint((" Vcb SIMPLE compare on !!!MODIFIED!!! volume\n"));
UDFPrint((" Vcb SIMPLE compare on !!!MODIFIED!!! volume\n"));
ASSERT(FALSE);
SimpleLogicalCheck = TRUE;
}
// compare logical structure
if(!SimpleLogicalCheck && (OldVcb->InitVatCount != NewVcb->InitVatCount)) {
KdPrint((" InitVatCount %d != %d \n", OldVcb->InitVatCount, NewVcb->InitVatCount));
UDFPrint((" InitVatCount %d != %d \n", OldVcb->InitVatCount, NewVcb->InitVatCount));
return STATUS_WRONG_VOLUME;
}
// Compare volume creation time
if(OldVcb->VolCreationTime != NewVcb->VolCreationTime) {
KdPrint((" VolCreationTime %I64x != %I64x \n", OldVcb->VolCreationTime, NewVcb->VolCreationTime));
UDFPrint((" VolCreationTime %I64x != %I64x \n", OldVcb->VolCreationTime, NewVcb->VolCreationTime));
return STATUS_WRONG_VOLUME;
}
// Compare serial numbers
if(OldVcb->SerialNumber != NewVcb->SerialNumber) {
KdPrint((" SerialNumber %x != %x \n", OldVcb->SerialNumber, NewVcb->SerialNumber));
UDFPrint((" SerialNumber %x != %x \n", OldVcb->SerialNumber, NewVcb->SerialNumber));
return STATUS_WRONG_VOLUME;
}
// Compare volume idents
if(!SimpleLogicalCheck &&
RtlCompareUnicodeString(&(OldVcb->VolIdent),&(NewVcb->VolIdent),FALSE)) {
KdPrint((" VolIdent missmatch \n"));
UDFPrint((" VolIdent missmatch \n"));
return STATUS_WRONG_VOLUME;
}
if(SimpleLogicalCheck) {
// do not touch RootDir. It can be partially recorded
KdPrint((" SimpleLogicalCheck Ok\n"));
UDFPrint((" SimpleLogicalCheck Ok\n"));
return STATUS_SUCCESS;
}
RC = UDFOpenRootFile__(NewVcb, &(NewVcb->RootLbAddr), &RootFileInfo);
if(!NT_SUCCESS(RC)) {
KdPrint((" Can't open root file, status %x\n", RC));
UDFPrint((" Can't open root file, status %x\n", RC));
UDFCleanUpFile__(NewVcb, &RootFileInfo);
return STATUS_WRONG_VOLUME;
}
// perform exhaustive check
if(!(OldVcb->RootDirFCB)) {
KdPrint((" !(OldVcb->RootDirFCB)\n"));
UDFPrint((" !(OldVcb->RootDirFCB)\n"));
wr_vol:
UDFCloseFile__(NewVcb, &RootFileInfo);
UDFCleanUpFile__(NewVcb, &RootFileInfo);
@ -966,13 +966,13 @@ wr_vol:
}
if(!UDFCompareFileInfo(&RootFileInfo, OldVcb->RootDirFCB->FileInfo)) {
KdPrint((" !UDFCompareFileInfo\n"));
UDFPrint((" !UDFCompareFileInfo\n"));
goto wr_vol;
}
UDFCloseFile__(NewVcb, &RootFileInfo);
UDFCleanUpFile__(NewVcb, &RootFileInfo);
KdPrint(("UDFCompareVcb: Ok\n"));
UDFPrint(("UDFCompareVcb: Ok\n"));
return STATUS_SUCCESS;
#undef VCB_NE

View file

@ -92,7 +92,7 @@ UDFQueryVolInfo(
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
KdPrint(("UDFQueryVolInfo: \n"));
UDFPrint(("UDFQueryVolInfo: \n"));
FsRtlEnterFileSystem();
ASSERT(DeviceObject);
@ -164,7 +164,7 @@ UDFCommonQueryVolInfo(
_SEH2_TRY {
KdPrint(("UDFCommonQueryVolInfo: \n"));
UDFPrint(("UDFCommonQueryVolInfo: \n"));
ASSERT(PtrIrpContext);
ASSERT(Irp);
@ -306,11 +306,11 @@ UDFQueryFsVolumeInfo(
PAGED_CODE();
KdPrint((" UDFQueryFsVolumeInfo: \n"));
UDFPrint((" UDFQueryFsVolumeInfo: \n"));
// Fill in the data from the Vcb.
Buffer->VolumeCreationTime.QuadPart = Vcb->VolCreationTime;
Buffer->VolumeSerialNumber = Vcb->PhSerialNumber;
KdPrint((" SN %x\n", Vcb->PhSerialNumber));
UDFPrint((" SN %x\n", Vcb->PhSerialNumber));
Buffer->SupportsObjects = FALSE;
@ -355,7 +355,7 @@ UDFQueryFsSizeInfo(
{
PAGED_CODE();
KdPrint((" UDFQueryFsSizeInfo: \n"));
UDFPrint((" UDFQueryFsSizeInfo: \n"));
// Fill in the output buffer.
if(Vcb->BitmapModified) {
Vcb->TotalAllocUnits =
@ -377,7 +377,7 @@ UDFQueryFsSizeInfo(
if(!Buffer->BytesPerSector)
Buffer->BytesPerSector = 2048;
KdPrint((" Space: Total %I64x, Free %I64x\n",
UDFPrint((" Space: Total %I64x, Free %I64x\n",
Buffer->TotalAllocationUnits.QuadPart,
Buffer->AvailableAllocationUnits.QuadPart));
@ -407,7 +407,7 @@ UDFQueryFsFullSizeInfo(
{
PAGED_CODE();
KdPrint((" UDFQueryFsFullSizeInfo: \n"));
UDFPrint((" UDFQueryFsFullSizeInfo: \n"));
// Fill in the output buffer.
if(Vcb->BitmapModified) {
Vcb->TotalAllocUnits =
@ -430,7 +430,7 @@ UDFQueryFsFullSizeInfo(
if(!Buffer->BytesPerSector)
Buffer->BytesPerSector = 2048;
KdPrint((" Space: Total %I64x, Free %I64x\n",
UDFPrint((" Space: Total %I64x, Free %I64x\n",
Buffer->TotalAllocationUnits.QuadPart,
Buffer->ActualAvailableAllocationUnits.QuadPart));
@ -460,7 +460,7 @@ UDFQueryFsDeviceInfo(
{
PAGED_CODE();
KdPrint((" UDFQueryFsDeviceInfo: \n"));
UDFPrint((" UDFQueryFsDeviceInfo: \n"));
// Update the output buffer.
if (Vcb->TargetDeviceObject->DeviceType != FILE_DEVICE_CD_ROM && Vcb->TargetDeviceObject->DeviceType != FILE_DEVICE_DVD)
{
@ -472,7 +472,7 @@ UDFQueryFsDeviceInfo(
Buffer->Characteristics = Vcb->TargetDeviceObject->Characteristics;
}
Buffer->DeviceType = Vcb->TargetDeviceObject->DeviceType;
KdPrint((" Characteristics %x, DeviceType %x\n", Buffer->Characteristics, Buffer->DeviceType));
UDFPrint((" Characteristics %x, DeviceType %x\n", Buffer->Characteristics, Buffer->DeviceType));
// Adjust the length variable
*Length -= sizeof( FILE_FS_DEVICE_INFORMATION );
return STATUS_SUCCESS;
@ -504,7 +504,7 @@ UDFQueryFsAttributeInfo(
ULONG FsTypeTitleLen;
PAGED_CODE();
KdPrint((" UDFQueryFsAttributeInfo: \n"));
UDFPrint((" UDFQueryFsAttributeInfo: \n"));
// Fill out the fixed portion of the buffer.
Buffer->FileSystemAttributes = FILE_CASE_SENSITIVE_SEARCH |
FILE_CASE_PRESERVED_NAMES |
@ -620,7 +620,7 @@ UDFSetVolInfo(
PtrUDFIrpContext PtrIrpContext = NULL;
BOOLEAN AreWeTopLevel = FALSE;
KdPrint(("UDFSetVolInfo: \n"));
UDFPrint(("UDFSetVolInfo: \n"));
FsRtlEnterFileSystem();
ASSERT(DeviceObject);
@ -678,7 +678,7 @@ UDFCommonSetVolInfo(
_SEH2_TRY {
KdPrint(("UDFCommonSetVolInfo: \n"));
UDFPrint(("UDFCommonSetVolInfo: \n"));
ASSERT(PtrIrpContext);
ASSERT(Irp);
@ -692,7 +692,7 @@ UDFCommonSetVolInfo(
ASSERT(Ccb);
if(Ccb && Ccb->Fcb && (Ccb->Fcb->NodeIdentifier.NodeType != UDF_NODE_TYPE_VCB)) {
KdPrint((" Can't change Label on Non-volume object\n"));
UDFPrint((" Can't change Label on Non-volume object\n"));
try_return(RC = STATUS_ACCESS_DENIED);
}
@ -702,7 +702,7 @@ UDFCommonSetVolInfo(
// Reference our input parameters to make things easier
if(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK) {
KdPrint((" Can't change Label on blank volume ;)\n"));
UDFPrint((" Can't change Label on blank volume ;)\n"));
try_return(RC = STATUS_ACCESS_DENIED);
}
@ -795,10 +795,10 @@ UDFSetLabelInfo (
{
PAGED_CODE();
KdPrint((" UDFSetLabelInfo: \n"));
UDFPrint((" UDFSetLabelInfo: \n"));
if(Buffer->VolumeLabelLength > UDF_VOL_LABEL_LEN*sizeof(WCHAR)) {
// Too long Volume Label... NT doesn't like it
KdPrint((" UDFSetLabelInfo: STATUS_INVALID_VOLUME_LABEL\n"));
UDFPrint((" UDFSetLabelInfo: STATUS_INVALID_VOLUME_LABEL\n"));
return STATUS_INVALID_VOLUME_LABEL;
}
@ -812,7 +812,7 @@ UDFSetLabelInfo (
Vcb->VolIdent.Buffer[Buffer->VolumeLabelLength/sizeof(WCHAR)] = 0;
UDFSetModified(Vcb);
KdPrint((" UDFSetLabelInfo: OK\n"));
UDFPrint((" UDFSetLabelInfo: OK\n"));
return STATUS_SUCCESS;
} // end UDFSetLabelInfo ()

View file

@ -160,26 +160,26 @@ UDFCommonWrite(
switch((ULONG)TopIrp) {
case FSRTL_FSP_TOP_LEVEL_IRP:
KdPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n"));
break;
case FSRTL_CACHE_TOP_LEVEL_IRP:
KdPrint((" FSRTL_CACHE_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_CACHE_TOP_LEVEL_IRP\n"));
break;
case FSRTL_MOD_WRITE_TOP_LEVEL_IRP:
KdPrint((" FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
break;
case FSRTL_FAST_IO_TOP_LEVEL_IRP:
KdPrint((" FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
UDFPrint((" FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
BrutePoint();
break;
case NULL:
KdPrint((" NULL TOP_LEVEL_IRP\n"));
UDFPrint((" NULL TOP_LEVEL_IRP\n"));
break;
default:
if(TopIrp == Irp) {
KdPrint((" TOP_LEVEL_IRP\n"));
UDFPrint((" TOP_LEVEL_IRP\n"));
} else {
KdPrint((" RECURSIVE_IRP, TOP = %x\n", TopIrp));
UDFPrint((" RECURSIVE_IRP, TOP = %x\n", TopIrp));
}
break;
}
@ -239,7 +239,7 @@ UDFCommonWrite(
PagingIo = (Irp->Flags & IRP_PAGING_IO) ? TRUE : FALSE;
NonBufferedIo = (Irp->Flags & IRP_NOCACHE) ? TRUE : FALSE;
SynchronousIo = (FileObject->Flags & FO_SYNCHRONOUS_IO) ? TRUE : FALSE;
KdPrint((" Flags: %s; %s; %s; %s; Irp(W): %8.8x\n",
UDFPrint((" Flags: %s; %s; %s; %s; Irp(W): %8.8x\n",
CanWait ? "Wt" : "nw", PagingIo ? "Pg" : "np",
NonBufferedIo ? "NBuf" : "buff", SynchronousIo ? "Snc" : "Asc",
Irp->Flags));
@ -303,7 +303,7 @@ UDFCommonWrite(
if(PtrIrpContext->IrpContextFlags & UDF_IRP_CONTEXT_FLUSH2_REQUIRED) {
KdPrint((" UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
UDFPrint((" UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
PtrIrpContext->IrpContextFlags &= ~UDF_IRP_CONTEXT_FLUSH2_REQUIRED;
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_RAW_DISK)) {
@ -341,7 +341,7 @@ UDFCommonWrite(
try_return(RC = STATUS_INVALID_USER_BUFFER);
// Indicate, that volume contents can change after this operation
// This flag will force VerifyVolume in future
KdPrint((" set UnsafeIoctl\n"));
UDFPrint((" set UnsafeIoctl\n"));
Vcb->VCBFlags |= UDF_VCB_FLAGS_UNSAFE_IOCTL;
// Make sure, that volume will never be quick-remounted
// It is very important for ChkUdf utility.
@ -387,7 +387,7 @@ UDFCommonWrite(
// Cache Manager and/or the VMM does not want us to perform
// the write at this time. Post the request.
PtrIrpContext->IrpContextFlags |= UDF_IRP_CONTEXT_DEFERRED_WRITE;
KdPrint(("UDFCommonWrite: Defer write\n"));
UDFPrint(("UDFCommonWrite: Defer write\n"));
MmPrint((" CcDeferWrite()\n"));
CcDeferWrite(FileObject, UDFDeferredWriteCallBack, PtrIrpContext, Irp, WriteLength, IsThisADeferredWrite);
try_return(RC = STATUS_PENDING);
@ -685,7 +685,7 @@ UDFCommonWrite(
NtReqFcb->CommonFCBHeader.AllocationSize.LowPart &= ~(PAGE_SIZE-1);
}
KdPrint(("UDFCommonWrite: Set size %x (alloc size %x)\n", ByteOffset.LowPart + TruncatedLength, NtReqFcb->CommonFCBHeader.AllocationSize.LowPart));
UDFPrint(("UDFCommonWrite: Set size %x (alloc size %x)\n", ByteOffset.LowPart + TruncatedLength, NtReqFcb->CommonFCBHeader.AllocationSize.LowPart));
if (CcIsFileCached(FileObject)) {
if(ExtendFS) {
MmPrint((" CcSetFileSizes()\n"));
@ -743,7 +743,7 @@ UDFCommonWrite(
if (!FileObject->PrivateCacheMap) {
// This is the first cached I/O operation. You must ensure
// that the FCB Common FCB Header contains valid sizes at this time
KdPrint(("UDFCommonWrite: Init system cache\n"));
UDFPrint(("UDFCommonWrite: Init system cache\n"));
MmPrint((" CcInitializeCacheMap()\n"));
CcInitializeCacheMap(FileObject, (PCC_FILE_SIZES)(&(NtReqFcb->CommonFCBHeader.AllocationSize)),
FALSE, // We will not utilize pin access for this file
@ -847,11 +847,11 @@ UDFCommonWrite(
#if 1
if((ULONG)TopIrp == FSRTL_MOD_WRITE_TOP_LEVEL_IRP) {
KdPrint(("FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n"));
UDFPrint(("FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n"));
CanWait = TRUE;
} else
if((ULONG)TopIrp == FSRTL_CACHE_TOP_LEVEL_IRP) {
KdPrint(("FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n"));
UDFPrint(("FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n"));
CanWait = TRUE;
}
@ -861,7 +861,7 @@ UDFCommonWrite(
} else
{}
/* if((TopIrp != Irp)) {
KdPrint(("(TopIrp != Irp) => CanWait\n"));
UDFPrint(("(TopIrp != Irp) => CanWait\n"));
CanWait = TRUE;
} else*/
#endif
@ -872,13 +872,13 @@ UDFCommonWrite(
}
// Successful check will cause WCache lock
if(!CanWait && UDFIsFileCached__(Vcb, Fcb->FileInfo, ByteOffset.QuadPart, TruncatedLength, TRUE)) {
KdPrint(("UDFCommonWrite: Cached => CanWait\n"));
UDFPrint(("UDFCommonWrite: Cached => CanWait\n"));
CacheLocked = TRUE;
CanWait = TRUE;
}
// Send the request to lower level drivers
if(!CanWait) {
KdPrint(("UDFCommonWrite: Post physical write %x bytes at %x\n", TruncatedLength, ByteOffset.LowPart));
UDFPrint(("UDFCommonWrite: Post physical write %x bytes at %x\n", TruncatedLength, ByteOffset.LowPart));
try_return(RC = STATUS_PENDING);
}
@ -1022,7 +1022,7 @@ try_exit: NOTHING;
} // can we complete the IRP ?
} _SEH2_END; // end of "__finally" processing
KdPrint(("\n"));
UDFPrint(("\n"));
return(RC);
} // end UDFCommonWrite()
@ -1050,7 +1050,7 @@ UDFDeferredWriteCallBack(
IN PVOID Context2 // Should be Irp
)
{
KdPrint(("UDFDeferredWriteCallBack\n"));
UDFPrint(("UDFDeferredWriteCallBack\n"));
// We should typically simply post the request to our internal
// queue of posted requests (just as we would if the original write
// could not be completed because the caller could not block).