Author: akhaldi
Date: Tue Jun 9 10:40:26 2015
New Revision: 68087
URL:
http://svn.reactos.org/svn/reactos?rev=68087&view=rev
Log:
[UDFS] Fix all GCC warnings! By V. with one little change by me to keep MSVC build working
:)
Modified:
trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp
trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.h
trunk/reactos/drivers/filesystems/udfs/Include/phys_lib.cpp
trunk/reactos/drivers/filesystems/udfs/Include/regtools.cpp
trunk/reactos/drivers/filesystems/udfs/Include/regtools.h
trunk/reactos/drivers/filesystems/udfs/Include/udf_common.h
trunk/reactos/drivers/filesystems/udfs/Include/wcache_lib.cpp
trunk/reactos/drivers/filesystems/udfs/cleanup.cpp
trunk/reactos/drivers/filesystems/udfs/close.cpp
trunk/reactos/drivers/filesystems/udfs/devcntrl.cpp
trunk/reactos/drivers/filesystems/udfs/dircntrl.cpp
trunk/reactos/drivers/filesystems/udfs/env_spec.cpp
trunk/reactos/drivers/filesystems/udfs/fastio.cpp
trunk/reactos/drivers/filesystems/udfs/fileinfo.cpp
trunk/reactos/drivers/filesystems/udfs/flush.cpp
trunk/reactos/drivers/filesystems/udfs/fscntrl.cpp
trunk/reactos/drivers/filesystems/udfs/lockctrl.cpp
trunk/reactos/drivers/filesystems/udfs/misc.cpp
trunk/reactos/drivers/filesystems/udfs/pnp.cpp
trunk/reactos/drivers/filesystems/udfs/protos.h
trunk/reactos/drivers/filesystems/udfs/read.cpp
trunk/reactos/drivers/filesystems/udfs/udf_dbg.cpp
trunk/reactos/drivers/filesystems/udfs/udf_info/alloc.cpp
trunk/reactos/drivers/filesystems/udfs/udf_info/dirtree.cpp
trunk/reactos/drivers/filesystems/udfs/udf_info/extent.cpp
trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp
trunk/reactos/drivers/filesystems/udfs/udf_info/phys_eject.cpp
trunk/reactos/drivers/filesystems/udfs/udf_info/remap.cpp
trunk/reactos/drivers/filesystems/udfs/udf_info/udf_info.cpp
trunk/reactos/drivers/filesystems/udfs/udf_info/udf_rel.h
trunk/reactos/drivers/filesystems/udfs/udfinit.cpp
trunk/reactos/drivers/filesystems/udfs/volinfo.cpp
Modified: trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/I…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp [iso-8859-1] Tue Jun
9 10:40:26 2015
@@ -663,7 +663,7 @@
if (trailIndex != (newIndex - 1)) {
newIndex = trailIndex + 1;
needsCRC = TRUE;
- hasExt = FALSE; //* Trailing period does not make an extension.
+ hasExt = FALSE; // Trailing period does not make an extension.
}
}
@@ -671,10 +671,10 @@
int localExtIndex = 0;
if (hasExt) {
int maxFilenameLen;
- //* Translate extension, and store it in ext.
+ // Translate extension, and store it in ext.
for(index = 0; index<UDF_EXT_SIZE && extIndex + index +1 <
udfLen; index++ ) {
current = udfName[extIndex + index + 1];
- if (UDFIsIllegalChar(current) /*|| !UnicodeIsPrint(current)) {
+ if (UDFIsIllegalChar(current) //|| !UnicodeIsPrint(current)) {
needsCRC = TRUE;
// Replace Illegal and non-displayable chars
// with underscore.
@@ -791,7 +791,7 @@
NTSTATUS
MyAppendUnicodeToString_(
IN PUNICODE_STRING Str1,
- IN PWSTR Str2
+ IN PCWSTR Str2
#ifdef UDF_TRACK_UNICODE_STR
,IN PCHAR Tag
#endif
@@ -937,7 +937,7 @@
{
PDIR_INDEX_HDR hDirNdx = DirInfo->Dloc->DirIndex;
PDIR_INDEX_ITEM DirNdx;
- for(uint_di i=2; DirNdx = UDFDirIndex(hDirNdx,i); i++) {
+ for(uint_di i=2; (DirNdx = UDFDirIndex(hDirNdx,i)); i++) {
if(!(DirNdx->FI_Flags & UDF_FI_FLAG_SYS_ATTR) ||
(DirNdx->FI_Flags & UDF_FI_FLAG_LINKED)) return FALSE;
}
@@ -1008,7 +1008,7 @@
// UDFFlushAFile(FileInfo->Fcb, NULL, &IoStatus, 0);
hCurDirNdx = FileInfo->Dloc->DirIndex;
// check if we can delete all files
- for(i=2; CurDirNdx = UDFDirIndex(hCurDirNdx,i); i++) {
+ for(i=2; (CurDirNdx = UDFDirIndex(hCurDirNdx,i)); i++) {
// try to open Stream
if(CurDirNdx->FileInfo)
return STATUS_CANNOT_DELETE;
Modified: trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/I…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/Include/Sys_spec_lib.h [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -108,7 +108,7 @@
);
NTSTATUS MyAppendUnicodeToString_(IN PUNICODE_STRING Str1,
- IN PWSTR Str2
+ IN PCWSTR Str2
#ifdef UDF_TRACK_UNICODE_STR
,IN PCHAR Tag
#endif
Modified: trunk/reactos/drivers/filesystems/udfs/Include/phys_lib.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/I…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/Include/phys_lib.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/Include/phys_lib.cpp [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -1291,7 +1291,7 @@
{
PGET_LAST_ERROR_USER_OUT Error = NULL;
LARGE_INTEGER delay;
- OSSTATUS RC;
+// OSSTATUS RC;
uint32 i;
BOOLEAN UpdateBB = FALSE;
@@ -1361,7 +1361,7 @@
}
KdPrint(("Error recovery: sync cache\n"));
// ...flush device cache...
- RC = UDFSyncCache(Vcb);
+ UDFSyncCache(Vcb);
// wait again & retry
delay.QuadPart = -1000000; // 0.1 sec
KeDelayExecutionThread(KernelMode, FALSE, &delay);
@@ -1396,7 +1396,7 @@
KeDelayExecutionThread(KernelMode, FALSE, &delay);
KdPrint(("Error recovery: sync cache\n"));
// ...flush device cache...
- RC = UDFSyncCache(Vcb);
+ UDFSyncCache(Vcb);
// wait again & retry
delay.QuadPart = -1000000; // 0.1 sec
KeDelayExecutionThread(KernelMode, FALSE, &delay);
@@ -1519,7 +1519,7 @@
Lba+BCount <= Vcb->LastLBA+1) {
KdPrint(("bad Session in streaming mode. Lba %x, try fix-up\n",
Lba));
// ...flush device cache...
- RC = UDFSyncCache(Vcb);
+ UDFSyncCache(Vcb);
// we should wait
delay.QuadPart = -10000000; // 1 sec
KeDelayExecutionThread(KernelMode, FALSE, &delay);
@@ -1572,7 +1572,7 @@
Lba+BCount <= Vcb->LastLBA+1) {
KdPrint(("bad LBA %x in streaming mode, try fix-up\n", Lba));
// ...flush device cache...
- RC = UDFSyncCache(Vcb);
+ UDFSyncCache(Vcb);
try_return(status = STATUS_SUCCESS);
}
@@ -1595,7 +1595,7 @@
#endif //UDF_DBG
} _SEH2_END;
if(!OS_SUCCESS(status)) {
- if((Vcb->MountPhErrorCount != -1) &&
+ if((Vcb->MountPhErrorCount != (ULONG)-1) &&
(Vcb->MountPhErrorCount < 0x7fffffff)) {
Vcb->MountPhErrorCount++;
}
@@ -1647,7 +1647,7 @@
BOOLEAN ForceFP = FALSE;
BOOLEAN PacketTrack = FALSE;
BOOLEAN MRWRetry = FALSE;
- BOOLEAN ReadCapacityOk = FALSE;
+// BOOLEAN ReadCapacityOk = FALSE;
#ifdef UDF_FORMAT_MEDIA
PUDFFmtState fms = Vcb->fms;
#endif
@@ -1697,7 +1697,7 @@
// good value from ReadCapacity
KdPrint(("Update Last possible LBA %#x.\n",
CapacityBuffer.LogicalBlockAddress));
Vcb->LastPossibleLBA = CapacityBuffer.LogicalBlockAddress;
- ReadCapacityOk = TRUE;
+// ReadCapacityOk = TRUE;
#ifdef UDF_FORMAT_MEDIA
if(fms && fms->opt_disk_info) {
UserPrint(("ReadCapacity OK\n"));
@@ -2392,7 +2392,7 @@
PREAD_TOC_USER_OUT toc =
(PREAD_TOC_USER_OUT)MyAllocatePool__(NonPagedPool,max(Vcb->BlockSize,
sizeof(READ_TOC_USER_OUT)) );
PGET_LAST_SESSION_USER_OUT LastSes =
(PGET_LAST_SESSION_USER_OUT)MyAllocatePool__(NonPagedPool,sizeof(GET_LAST_SESSION_USER_OUT)
);
uint32 LocalTrackCount;
- uint32 LocalTocLength;
+// uint32 LocalTocLength;
uint32 TocEntry;
#ifdef _BROWSE_UDF_
uint32 OldTrkNum;
@@ -2479,7 +2479,7 @@
#endif //_CONSOLE
LocalTrackCount = toc->Tracks.Last_TrackSes - toc->Tracks.First_TrackSes +
1;
- LocalTocLength = PtrOffset( toc, &(toc->TrackData[LocalTrackCount + 1])
);
+// LocalTocLength = PtrOffset( toc, &(toc->TrackData[LocalTrackCount + 1])
); /* FIXME ReactOS Assume PtrOffset is not changing it's arguments? */
// Get out if there is an immediate problem with the TOC.
if(toc->Tracks.First_TrackSes > toc->Tracks.Last_TrackSes) {
@@ -2720,7 +2720,7 @@
TRUE,NULL );
if(!NT_SUCCESS(RC)) {
KdPrint(("UDFGetBlockSize: IOCTL_DISK_GET_PARTITION_INFO
failed\n"));
- if(RC = STATUS_INVALID_DEVICE_REQUEST)
+ if(RC == STATUS_INVALID_DEVICE_REQUEST) /* ReactOS Code Change (was =)
*/
RC = STATUS_UNRECOGNIZED_VOLUME;
try_return(RC);
}
@@ -3704,7 +3704,7 @@
!(Vcb->VCBFlags & UDF_VCB_FLAGS_NO_SYNC_CACHE) &&
!(Vcb->CompatFlags & UDF_VCB_IC_NO_SYNCCACHE_AFTER_WRITE)){
- OSSTATUS RC;
+// OSSTATUS RC;
RC = UDFSyncCache(Vcb);
}
@@ -3715,8 +3715,8 @@
#endif //UDF_FORMAT_MEDIA
TRUE)
{
- OSSTATUS RC;
- RC = UDFSyncCache(Vcb);
+// OSSTATUS RC;
+ UDFSyncCache(Vcb);
}
#ifdef _BROWSE_UDF_
@@ -3969,7 +3969,7 @@
return STATUS_NO_SUCH_DEVICE;
// read tail of the 1st sector if Offset is not sector_size-aligned
Lba = (uint32)(Offset >> BSh);
- if(i = (uint32)(Offset & (BS-1))) {
+ if((i = (uint32)(Offset & (BS-1)))) {
l = (BS - i) < Length ?
(BS - i) : Length;
// here we use 'ReadBytes' 'cause now it's set to zero
@@ -4161,7 +4161,7 @@
return STATUS_NO_SUCH_DEVICE;
// write tail of the 1st sector if Offset is not sector_size-aligned
Lba = (uint32)(Offset >> BSh);
- if(i = ((uint32)Offset & (BS-1))) {
+ if((i = ((uint32)Offset & (BS-1)))) {
l = (BS - i) < Length ?
(BS - i) : Length;
status = UDFWriteInSector(Vcb, Translate, Lba, i, l, Direct, Buffer,
WrittenBytes);
@@ -4276,7 +4276,11 @@
MODE_READ_WRITE_RECOVERY_PAGE Data;
CHAR Padding [16];
} RecoveryPage;
+#ifdef _MSC_VER
#pragma pack(pop,1)
+#else
+#pragma pack(pop)
+#endif
MODE_SENSE_USER_IN ModeSenseCtl;
OSSTATUS RC;
Modified: trunk/reactos/drivers/filesystems/udfs/Include/regtools.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/I…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/Include/regtools.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/Include/regtools.cpp [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -11,7 +11,7 @@
NTSTATUS
RegTGetKeyHandle(
IN HKEY hRootKey,
- IN PWCHAR KeyName,
+ IN PCWSTR KeyName,
OUT HKEY* hKey
)
{
@@ -21,9 +21,7 @@
//KdPrint(("RegTGetKeyHandle: h=%x, %S\n", hRootKey, KeyName));
- NameString.Buffer = KeyName;
- NameString.Length = wcslen(KeyName)*sizeof(WCHAR);
- NameString.MaximumLength = NameString.Length + sizeof(WCHAR);
+ RtlInitUnicodeString(&NameString, KeyName);
InitializeObjectAttributes(
&ObjectAttributes,
@@ -100,8 +98,8 @@
BOOLEAN
RegTGetDwordValue(
IN HKEY hRootKey,
- IN PWSTR RegistryPath,
- IN PWSTR Name,
+ IN PCWSTR RegistryPath,
+ IN PCWSTR Name,
IN PULONG pUlong
)
{
@@ -150,9 +148,7 @@
return FALSE;
}
- NameString.Buffer = Name;
- NameString.Length = wcslen(Name)*sizeof(WCHAR);
- NameString.MaximumLength = NameString.Length + sizeof(WCHAR);
+ RtlInitUnicodeString(&NameString, Name);
status = ZwQueryValueKey(hKey,
&NameString,
@@ -192,8 +188,8 @@
BOOLEAN
RegTGetStringValue(
IN HKEY hRootKey,
- IN PWSTR RegistryPath,
- IN PWSTR Name,
+ IN PCWSTR RegistryPath,
+ IN PCWSTR Name,
IN PWCHAR pStr,
IN ULONG MaxLen
)
@@ -240,9 +236,7 @@
return FALSE;
}
- NameString.Buffer = Name;
- NameString.Length = wcslen(Name)*sizeof(WCHAR);
- NameString.MaximumLength = NameString.Length + sizeof(WCHAR);
+ RtlInitUnicodeString(&NameString, Name);
status = ZwQueryValueKey(hKey,
&NameString,
Modified: trunk/reactos/drivers/filesystems/udfs/Include/regtools.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/I…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/Include/regtools.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/Include/regtools.h [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -16,7 +16,7 @@
NTSTATUS
RegTGetKeyHandle(
IN HKEY hRootKey,
- IN PWCHAR KeyName,
+ IN PCWSTR KeyName,
OUT HKEY* hKey
);
@@ -28,16 +28,16 @@
BOOLEAN
RegTGetDwordValue(
IN HKEY hRootKey,
- IN PWSTR RegistryPath,
- IN PWSTR Name,
+ IN PCWSTR RegistryPath,
+ IN PCWSTR Name,
IN PULONG pUlong
);
BOOLEAN
RegTGetStringValue(
IN HKEY hRootKey,
- IN PWSTR RegistryPath,
- IN PWSTR Name,
+ IN PCWSTR RegistryPath,
+ IN PCWSTR Name,
IN PWCHAR pStr,
IN ULONG MaxLen
);
Modified: trunk/reactos/drivers/filesystems/udfs/Include/udf_common.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/I…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/Include/udf_common.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/Include/udf_common.h [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -27,7 +27,7 @@
struct UDF_MEDIA_CLASS_NAMES
{
UDFFSD_MEDIA_TYPE MediaClass;
- PWCHAR ClassName;
+ PCWSTR ClassName;
};
extern struct UDF_MEDIA_CLASS_NAMES UDFMediaClassName[];
@@ -114,7 +114,7 @@
// device object when requesting a mount operation.
PDEVICE_OBJECT TargetDeviceObject;
UNICODE_STRING TargetDevName;
- PWSTR DefaultRegName;
+ PCWSTR DefaultRegName;
// the volume structure contains a pointer to the root directory FCB
PtrUDFFCB RootDirFCB;
// the complete name of the user visible drive letter we serve
Modified: trunk/reactos/drivers/filesystems/udfs/Include/wcache_lib.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/I…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/Include/wcache_lib.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/Include/wcache_lib.cpp [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -439,8 +439,10 @@
Internal routine
*/
+#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4035) // re-enable below
+#endif
ULONG
//__fastcall
@@ -566,7 +568,9 @@
}
+#ifdef _MSC_VER
#pragma warning(pop) // re-enable warning #4035
+#endif
/*
WCacheInsertRangeToList() inserts values laying in range described
@@ -823,7 +827,7 @@
Internal routine
*/
#define WCacheGetModFlag(block_array, i) \
- (((UCHAR)(block_array[i].Sector)) & WCACHE_FLAG_MODIFIED)
+ (*((PULONG)&(block_array[i].Sector)) & WCACHE_FLAG_MODIFIED)
#if 0
/*
@@ -1643,9 +1647,9 @@
// ULONG BS = Cache->BlockSize;
// ULONG PS = BS << Cache->PacketSizeSh; // packet size (bytes)
ULONG PSs = Cache->PacketSize;
- ULONG try_count = 0;
+// ULONG try_count = 0;
PW_CACHE_ENTRY block_array;
- OSSTATUS status;
+// OSSTATUS status;
ULONG FreeFrameCount = 0;
// PVOID addr;
@@ -1679,11 +1683,13 @@
try_count = 0;
}
#else
+/*
if(Cache->FrameList[frame].UpdateCount) {
try_count = MAX_TRIES_FOR_NA;
} else {
try_count = 0;
}
+*/
#endif
if(FreeFrameCount)
@@ -1700,7 +1706,7 @@
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
- status = WCacheFlushBlocksRAM(Cache, Context, block_array, List, firstPos,
lastPos, TRUE);
+ WCacheFlushBlocksRAM(Cache, Context, block_array, List, firstPos, lastPos,
TRUE);
WCacheRemoveRangeFromList(List, &(Cache->BlockCount), firstLba,
Cache->BlocksPerFrame);
WCacheRemoveRangeFromList(Cache->CachedModifiedBlocksList,
&(Cache->WriteCount), firstLba, Cache->BlocksPerFrame);
@@ -1715,7 +1721,7 @@
// remove(flush) packet
while((Cache->BlockCount + WCacheGetSortedListIndex(Cache->BlockCount, List,
ReqLba) +
BCount - WCacheGetSortedListIndex(Cache->BlockCount, List, ReqLba+BCount))
> Cache->MaxBlocks) {
- try_count = 0;
+// try_count = 0;
//Try_Another_Block:
ASSERT(Cache->FrameCount <= Cache->MaxFrames);
@@ -1734,7 +1740,7 @@
ASSERT(FALSE);
return STATUS_DRIVER_INTERNAL_ERROR;
}
- status = WCacheFlushBlocksRAM(Cache, Context, block_array, List, firstPos,
lastPos, TRUE);
+ WCacheFlushBlocksRAM(Cache, Context, block_array, List, firstPos, lastPos,
TRUE);
WCacheRemoveRangeFromList(List, &(Cache->BlockCount), Lba, PSs);
WCacheRemoveRangeFromList(Cache->CachedModifiedBlocksList,
&(Cache->WriteCount), Lba, PSs);
// check if frame is empty
@@ -1765,7 +1771,7 @@
ULONG firstPos;
ULONG lastPos;
PW_CACHE_ENTRY block_array;
- OSSTATUS status;
+// OSSTATUS status;
// remove(flush) some frames
while(Cache->FrameCount) {
@@ -1783,7 +1789,7 @@
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
- status = WCacheFlushBlocksRAM(Cache, Context, block_array, List, firstPos,
lastPos, TRUE);
+ WCacheFlushBlocksRAM(Cache, Context, block_array, List, firstPos, lastPos,
TRUE);
WCacheRemoveRangeFromList(List, &(Cache->BlockCount), firstLba,
Cache->BlocksPerFrame);
WCacheRemoveRangeFromList(Cache->CachedModifiedBlocksList,
&(Cache->WriteCount), firstLba, Cache->BlocksPerFrame);
@@ -1813,7 +1819,7 @@
ULONG firstPos;
ULONG lastPos;
PW_CACHE_ENTRY block_array;
- OSSTATUS status;
+// OSSTATUS status;
// flush frames
while(Cache->WriteCount) {
@@ -1831,7 +1837,7 @@
BrutePoint();
return STATUS_DRIVER_INTERNAL_ERROR;
}
- status = WCacheFlushBlocksRAM(Cache, Context, block_array, List, firstPos,
lastPos, FALSE);
+ WCacheFlushBlocksRAM(Cache, Context, block_array, List, firstPos, lastPos,
FALSE);
WCacheRemoveRangeFromList(Cache->CachedModifiedBlocksList,
&(Cache->WriteCount), firstLba, Cache->BlocksPerFrame);
}
@@ -2621,14 +2627,14 @@
lba_t firstLba;
lba_t* List = Cache->CachedBlocksList;
lba_t Lba;
- ULONG firstPos;
- ULONG lastPos;
+// ULONG firstPos;
+// ULONG lastPos;
ULONG BSh = Cache->BlockSizeSh;
ULONG BS = Cache->BlockSize;
ULONG PS = BS << Cache->PacketSizeSh; // packet size (bytes)
ULONG PSs = Cache->PacketSize;
PW_CACHE_ENTRY block_array;
- OSSTATUS status;
+// OSSTATUS status;
ULONG ReadBytes;
PW_CACHE_ASYNC FirstWContext = NULL;
PW_CACHE_ASYNC PrevWContext = NULL;
@@ -2640,15 +2646,15 @@
Lba = List[0] & ~(PSs-1);
frame = Lba >> Cache->BlocksPerFrameSh;
firstLba = frame << Cache->BlocksPerFrameSh;
- firstPos = WCacheGetSortedListIndex(Cache->BlockCount, List, Lba);
- lastPos = WCacheGetSortedListIndex(Cache->BlockCount, List, Lba+PSs);
+// firstPos = WCacheGetSortedListIndex(Cache->BlockCount, List, Lba);
+// lastPos = WCacheGetSortedListIndex(Cache->BlockCount, List, Lba+PSs);
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
BrutePoint();
return;
}
- status = WCacheUpdatePacket(Cache, Context, &FirstWContext,
&PrevWContext, block_array, firstLba,
+ WCacheUpdatePacket(Cache, Context, &FirstWContext, &PrevWContext,
block_array, firstLba,
Lba, BSh, BS, PS, PSs, &ReadBytes, TRUE, ASYNC_STATE_NONE);
// free memory
@@ -2688,15 +2694,15 @@
lba_t firstLba;
lba_t* List = Cache->CachedModifiedBlocksList;
lba_t Lba;
- ULONG firstPos;
- ULONG lastPos;
+// ULONG firstPos;
+// ULONG lastPos;
ULONG BSh = Cache->BlockSizeSh;
ULONG BS = Cache->BlockSize;
ULONG PS = BS << Cache->PacketSizeSh; // packet size (bytes)
ULONG PSs = Cache->PacketSize;
ULONG BFs = Cache->BlocksPerFrameSh;
PW_CACHE_ENTRY block_array;
- OSSTATUS status;
+// OSSTATUS status;
ULONG ReadBytes;
PW_CACHE_ASYNC FirstWContext = NULL;
PW_CACHE_ASYNC PrevWContext = NULL;
@@ -2710,15 +2716,15 @@
Lba = List[0] & ~(PSs-1);
frame = Lba >> BFs;
firstLba = frame << BFs;
- firstPos = WCacheGetSortedListIndex(Cache->WriteCount, List, Lba);
- lastPos = WCacheGetSortedListIndex(Cache->WriteCount, List, Lba+PSs);
+// firstPos = WCacheGetSortedListIndex(Cache->WriteCount, List, Lba);
+// lastPos = WCacheGetSortedListIndex(Cache->WriteCount, List, Lba+PSs);
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
BrutePoint();
continue;;
}
// queue modify request
- status = WCacheUpdatePacket(Cache, Context, &FirstWContext,
&PrevWContext, block_array, firstLba,
+ WCacheUpdatePacket(Cache, Context, &FirstWContext, &PrevWContext,
block_array, firstLba,
Lba, BSh, BS, PS, PSs, &ReadBytes, TRUE, ASYNC_STATE_NONE);
// clear MODIFIED flag for queued blocks
WCacheRemoveRangeFromList(List, &(Cache->WriteCount), Lba, PSs);
@@ -2827,15 +2833,15 @@
lba_t firstLba;
lba_t* List = Cache->CachedModifiedBlocksList;
lba_t Lba;
- ULONG firstPos;
- ULONG lastPos;
+// ULONG firstPos;
+// ULONG lastPos;
ULONG BSh = Cache->BlockSizeSh;
ULONG BS = Cache->BlockSize;
ULONG PS = BS << Cache->PacketSizeSh; // packet size (bytes)
ULONG PSs = Cache->PacketSize;
ULONG BFs = Cache->BlocksPerFrameSh;
PW_CACHE_ENTRY block_array;
- OSSTATUS status;
+// OSSTATUS status;
ULONG ReadBytes;
PW_CACHE_ASYNC FirstWContext = NULL;
PW_CACHE_ASYNC PrevWContext = NULL;
@@ -2850,8 +2856,8 @@
for(Lba = _Lba & ~(PSs-1);Lba < lim ; Lba += PSs) {
frame = Lba >> BFs;
firstLba = frame << BFs;
- firstPos = WCacheGetSortedListIndex(Cache->WriteCount, List, Lba);
- lastPos = WCacheGetSortedListIndex(Cache->WriteCount, List, Lba+PSs);
+// firstPos = WCacheGetSortedListIndex(Cache->WriteCount, List, Lba);
+// lastPos = WCacheGetSortedListIndex(Cache->WriteCount, List, Lba+PSs);
block_array = Cache->FrameList[frame].Frame;
if(!block_array) {
// not cached block may be requested for flush
@@ -2859,7 +2865,7 @@
continue;
}
// queue modify request
- status = WCacheUpdatePacket(Cache, Context, &FirstWContext,
&PrevWContext, block_array, firstLba,
+ WCacheUpdatePacket(Cache, Context, &FirstWContext, &PrevWContext,
block_array, firstLba,
Lba, BSh, BS, PS, PSs, &ReadBytes, TRUE, ASYNC_STATE_NONE);
// clear MODIFIED flag for queued blocks
WCacheRemoveRangeFromList(List, &(Cache->WriteCount), Lba, PSs);
Modified: trunk/reactos/drivers/filesystems/udfs/cleanup.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/cleanup.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/cleanup.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -549,7 +549,7 @@
if(!(Vcb->VCBFlags & UDF_VCB_FLAGS_VOLUME_READ_ONLY) &&
!(Fcb->FCBFlags & (UDF_FCB_DELETE_ON_CLOSE |
UDF_FCB_DELETED /*|
- UDF_FCB_DIRECTORY /*|
+ UDF_FCB_DIRECTORY |
UDF_FCB_READ_ONLY*/)) &&
!UDFIsAStreamDir(NextFileInfo)) {
LONGLONG NtTime;
@@ -719,7 +719,7 @@
ValidateFileInfo(fi);
// acquire parent
- if(ParentFI = fi->ParentFile) {
+ if((ParentFI = fi->ParentFile)) {
ParentFcb = fi->Fcb->ParentFcb;
ASSERT(ParentFcb);
ASSERT(ParentFcb->NTRequiredFCB);
@@ -734,7 +734,7 @@
}
// acquire current file/dir
// we must assure that no more threads try to reuse this object
- if(Fcb = fi->Fcb) {
+ if((Fcb = fi->Fcb)) {
UDF_CHECK_PAGING_IO_RESOURCE(Fcb->NTRequiredFCB);
UDFAcquireResourceExclusive(&(Fcb->NTRequiredFCB->MainResource),TRUE);
ASSERT_REF(Fcb->ReferenceCount >= fi->RefCount);
Modified: trunk/reactos/drivers/filesystems/udfs/close.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/close.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/close.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -150,7 +150,7 @@
BOOLEAN AcquiredGD = FALSE;
PUDF_FILE_INFO fi;
ULONG i = 0;
- ULONG clean_stat = 0;
+// ULONG clean_stat = 0;
// BOOLEAN CompleteIrp = TRUE;
BOOLEAN PostRequest = FALSE;
@@ -337,7 +337,7 @@
AdPrint(("UDF: ReferenceCount: %x\n",Fcb->ReferenceCount));
#endif // UDF_DBG
// try to clean up as long chain as it is possible
- clean_stat = UDFCleanUpFcbChain(Vcb, fi, i, TRUE);
+ UDFCleanUpFcbChain(Vcb, fi, i, TRUE);
try_exit: NOTHING;
@@ -426,7 +426,7 @@
while(fi) {
// acquire parent
- if(ParentFI = fi->ParentFile) {
+ if((ParentFI = fi->ParentFile)) {
ASSERT(fi->Fcb);
ParentFcb = fi->Fcb->ParentFcb;
ASSERT(ParentFcb);
@@ -545,7 +545,7 @@
fi->Dloc->CommonFcb = NULL;
}
- if(CleanCode = UDFCleanUpFile__(Vcb, fi)) {
+ if((CleanCode = UDFCleanUpFile__(Vcb, fi))) {
// Check, if we can uninitialize & deallocate CommonFcb part
// kill some cross links
Fcb->FileInfo = NULL;
@@ -865,12 +865,12 @@
}
// walk through SDir (if any)
- if(SDirInfo = FileInfo->Dloc->SDirInfo)
+ if((SDirInfo = FileInfo->Dloc->SDirInfo))
UDFBuildTreeItemsList(Vcb, SDirInfo, CheckItemProc,
PassedList, PassedListSize, FoundList, FoundListSize);
// walk through subsequent objects (if any)
- if(hDirNdx = FileInfo->Dloc->DirIndex) {
+ if((hDirNdx = FileInfo->Dloc->DirIndex)) {
// scan DirIndex
UDF_DIR_SCAN_CONTEXT ScanContext;
@@ -878,7 +878,7 @@
PUDF_FILE_INFO CurFileInfo;
if(UDFDirIndexInitScan(FileInfo, &ScanContext, 2)) {
- while(DirNdx = UDFDirIndexScan(&ScanContext, &CurFileInfo)) {
+ while((DirNdx = UDFDirIndexScan(&ScanContext, &CurFileInfo))) {
if(!CurFileInfo)
continue;
UDFBuildTreeItemsList(Vcb, CurFileInfo, CheckItemProc,
Modified: trunk/reactos/drivers/filesystems/udfs/devcntrl.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/devcntrl.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/devcntrl.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -884,7 +884,7 @@
// Copy the data from the Vcb.
((PCDROM_DISK_DATA_USER_OUT)(Irp->AssociatedIrp.SystemBuffer))->DiskData =
CDROM_DISK_DATA_TRACK;
for(TrackNumber=Vcb->FirstTrackNum; TrackNumber<Vcb->LastTrackNum;
TrackNumber++) {
- if(Vcb->TrackMap[TrackNumber].TrackParam & Trk_QSubChan_Type_Mask
==
+ if((Vcb->TrackMap[TrackNumber].TrackParam &
Trk_QSubChan_Type_Mask) ==
Trk_QSubChan_Type_Audio) {
((PCDROM_DISK_DATA_USER_OUT)(Irp->AssociatedIrp.SystemBuffer))->DiskData |=
CDROM_DISK_AUDIO_TRACK;
break;
@@ -1137,7 +1137,7 @@
PEXTENDED_IO_STACK_LOCATION IrpSp =
(PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation( Irp );
- PVCB Vcb;
+// PVCB Vcb;
PtrUDFFCB Fcb;
PtrUDFCCB Ccb;
PUDF_GET_FILE_ALLOCATION_MODE_OUT OutputBuffer;
@@ -1148,7 +1148,7 @@
// user volume opens.
Ccb = (PtrUDFCCB)(IrpSp->FileObject->FsContext2);
Fcb = Ccb->Fcb;
- Vcb = Fcb->Vcb;
+// Vcb = Fcb->Vcb;
Irp->IoStatus.Information = 0;
if(IrpSp->Parameters.FileSystemControl.OutputBufferLength <
sizeof(UDF_GET_FILE_ALLOCATION_MODE_OUT))
Modified: trunk/reactos/drivers/filesystems/udfs/dircntrl.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/dircntrl.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/dircntrl.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -545,6 +545,9 @@
NamesInfo->FileIndex = NextMatch;
NamesInfo->FileNameLength = FileNameBytes;
break;
+
+ default:
+ break;
}
if (FileNameBytes) {
// This is a Unicode name, we can copy the bytes directly.
@@ -634,7 +637,7 @@
#define IgnoreCase (FNM_Flags & UDF_FNM_FLAG_IGNORE_CASE)
#define ContainsWC (FNM_Flags & UDF_FNM_FLAG_CONTAINS_WC)
- for(;DirNdx = UDFDirIndex(hDirIndex, EntryNumber);EntryNumber++) {
+ for(;(DirNdx = UDFDirIndex(hDirIndex, EntryNumber));EntryNumber++) {
if(!DirNdx->FName.Buffer ||
UDFIsDeleted(DirNdx))
continue;
Modified: trunk/reactos/drivers/filesystems/udfs/env_spec.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/e…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/env_spec.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/env_spec.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -316,10 +316,14 @@
#ifdef DBG
if(UDF_SIMULATE_WRITES) {
+/* FIXME ReactOS
+ If this function is to force a read from the bufffer to simulate any segfaults, then
it makes sense.
+ Else, this forloop is useless.
UCHAR a;
for(ULONG i=0; i<Length; i++) {
a = ((PUCHAR)Buffer)[i];
}
+*/
*WrittenBytes = Length;
return STATUS_SUCCESS;
}
@@ -621,7 +625,8 @@
IN ULONG EventCode
)
{
- if(!FsRtlNotifyVolumeEvent)
+/* ReactOS FIXME This is always true, and we return anyway. */
+// if(!FsRtlNotifyVolumeEvent)
return;
//FsRtlNotifyVolumeEvent(FileObject, EventCode);
} // end UDFNotifyVolumeEvent()
Modified: trunk/reactos/drivers/filesystems/udfs/fastio.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/fastio.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/fastio.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -260,7 +260,7 @@
LONG Length = sizeof(FILE_STANDARD_INFORMATION);
PtrUDFFCB Fcb;
PtrUDFCCB Ccb;
- PtrUDFNTRequiredFCB NtReqFcb = NULL;
+// PtrUDFNTRequiredFCB NtReqFcb = NULL;
// BOOLEAN MainResourceAcquired = FALSE;
FsRtlEnterFileSystem();
@@ -277,7 +277,7 @@
ASSERT(Ccb);
Fcb = Ccb->Fcb;
ASSERT(Fcb);
- NtReqFcb = Fcb->NTRequiredFCB;
+// NtReqFcb = Fcb->NTRequiredFCB;
//Fcb->Vcb->VCBFlags |= UDF_VCB_SKIP_EJECT_CHECK;
/*
Modified: trunk/reactos/drivers/filesystems/udfs/fileinfo.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/fileinfo.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/fileinfo.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -544,7 +544,7 @@
_SEH2_TRY {
- if(*PtrReturnedLength < sizeof(FILE_BASIC_INFORMATION)) {
+ if(*PtrReturnedLength < (LONG)sizeof(FILE_BASIC_INFORMATION)) {
try_return(RC = STATUS_BUFFER_OVERFLOW);
}
@@ -619,13 +619,13 @@
{
NTSTATUS RC = STATUS_SUCCESS;
PUDF_FILE_INFO FileInfo;
- PVCB Vcb;
+// PVCB Vcb;
AdPrint(("UDFGetStandardInformation: \n"));
_SEH2_TRY {
- if(*PtrReturnedLength < sizeof(FILE_STANDARD_INFORMATION)) {
+ if(*PtrReturnedLength < (LONG)sizeof(FILE_STANDARD_INFORMATION)) {
try_return(RC = STATUS_BUFFER_OVERFLOW);
}
@@ -639,7 +639,7 @@
AdPrint(("!!!! GetStandardInfo to unopened file !!!!\n"));
try_return(RC = STATUS_INVALID_PARAMETER);
}
- Vcb = Fcb->Vcb;
+// Vcb = Fcb->Vcb;
PtrBuffer->NumberOfLinks = UDFGetFileLinkCount(FileInfo);
PtrBuffer->DeletePending = (Fcb->FCBFlags & UDF_FCB_DELETE_ON_CLOSE) ?
TRUE : FALSE;
@@ -686,7 +686,7 @@
_SEH2_TRY {
- if(*PtrReturnedLength < sizeof(FILE_NETWORK_OPEN_INFORMATION)) {
+ if(*PtrReturnedLength < (LONG)sizeof(FILE_NETWORK_OPEN_INFORMATION)) {
try_return(RC = STATUS_BUFFER_OVERFLOW);
}
@@ -752,7 +752,7 @@
_SEH2_TRY {
- if(*PtrReturnedLength < sizeof(FILE_INTERNAL_INFORMATION)) {
+ if(*PtrReturnedLength < (LONG)sizeof(FILE_INTERNAL_INFORMATION)) {
try_return(RC = STATUS_BUFFER_OVERFLOW);
}
@@ -803,7 +803,7 @@
_SEH2_TRY {
- if(*PtrReturnedLength < sizeof(FILE_EA_INFORMATION)) {
+ if(*PtrReturnedLength < (LONG)sizeof(FILE_EA_INFORMATION)) {
try_return(RC = STATUS_BUFFER_OVERFLOW);
}
@@ -903,7 +903,7 @@
IN OUT PLONG PtrReturnedLength
)
{
- if(*PtrReturnedLength < sizeof(FILE_POSITION_INFORMATION)) {
+ if(*PtrReturnedLength < (LONG)sizeof(FILE_POSITION_INFORMATION)) {
return(STATUS_BUFFER_OVERFLOW);
}
PtrBuffer->CurrentByteOffset = FileObject->CurrentByteOffset;
@@ -960,7 +960,7 @@
NTFileInfo = (PFILE_BOTH_DIR_INFORMATION)MyAllocatePool__(NonPagedPool,
sizeof(FILE_BOTH_DIR_INFORMATION)+UDF_NAME_LEN*sizeof(WCHAR));
if(!NTFileInfo) try_return(RC = STATUS_INSUFFICIENT_RESOURCES);
- for(i=2; SDirIndex = UDFDirIndex(hSDirIndex,i); i++) {
+ for(i=2; (SDirIndex = UDFDirIndex(hSDirIndex,i)); i++) {
if((SDirIndex->FI_Flags & UDF_FI_FLAG_FI_INTERNAL) ||
UDFIsDeleted(SDirIndex) ||
!SDirIndex->FName.Buffer )
@@ -1176,7 +1176,7 @@
UDFDirIndexInitScan(SDirInfo, &ScanContext, 2)) {
// Check if we can delete Streams
- while(DirNdx = UDFDirIndexScan(&ScanContext, &FileInfo)) {
+ while((DirNdx = UDFDirIndexScan(&ScanContext, &FileInfo))) {
if(!FileInfo)
continue;
if(FileInfo->Fcb) {
@@ -1631,7 +1631,7 @@
PDIR_INDEX_ITEM DirNdx;
PtrUDFNTRequiredFCB NtReqFcb = NULL;
LONGLONG OldFileSize;
- BOOLEAN ZeroBlock;
+// BOOLEAN ZeroBlock;
BOOLEAN CacheMapInitialized = FALSE;
BOOLEAN AcquiredPagingIo = FALSE;
@@ -1712,8 +1712,10 @@
// Yes. Do the FSD specific stuff i.e. increase reserved
// space on disk.
+/*
if (FileObject->PrivateCacheMap)
ZeroBlock = TRUE;
+*/
// reference file to pretend that it is opened
UDFReferenceFile__(Fcb->FileInfo);
@@ -1828,7 +1830,7 @@
UDFZeroDataEx(NtReqFcb,
OldFileSize,
PtrBuffer->EndOfFile.QuadPart - OldFileSize,
- TRUE/*CanWait, Vcb, FileObject);
+ TRUE // CanWait, Vcb, FileObject);
}*/
Fcb->NTRequiredFCB->NtReqFCBFlags |= UDF_NTREQ_FCB_MODIFIED;
Modified: trunk/reactos/drivers/filesystems/udfs/flush.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/flush.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/flush.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -293,7 +293,7 @@
)
{
BOOLEAN SetArchive = FALSE;
- BOOLEAN PurgeCache = FALSE;
+// BOOLEAN PurgeCache = FALSE;
ULONG ret_val = 0;
KdPrint(("UDFFlushAFile: \n"));
@@ -339,7 +339,7 @@
// notice, that we should purge cache
// we can't do it now, because it may cause last Close
// request & thus, structure deallocation
- PurgeCache = TRUE;
+// PurgeCache = TRUE;
#ifndef UDF_READ_ONLY_BUILD
if(Ccb) {
@@ -420,7 +420,7 @@
)
{
KdPrint(("UDFFlushADirectory: \n"));
- PDIR_INDEX_HDR hDI;
+// PDIR_INDEX_HDR hDI;
PDIR_INDEX_ITEM DI;
// BOOLEAN Referenced = FALSE;
ULONG ret_val = 0;
@@ -429,7 +429,7 @@
return 0;
if(!FI || !FI->Dloc || !FI->Dloc->DirIndex) goto SkipFlushDir;
- hDI = FI->Dloc->DirIndex;
+// hDI = FI->Dloc->DirIndex;
// Flush Security if required
_SEH2_TRY {
@@ -455,7 +455,7 @@
PUDF_FILE_INFO tempFI;
if(UDFDirIndexInitScan(FI, &ScanContext, 2)) {
- while(DI = UDFDirIndexScan(&ScanContext, &tempFI)) {
+ while((DI = UDFDirIndexScan(&ScanContext, &tempFI))) {
// Flush Dir entry
_SEH2_TRY {
if(!tempFI) continue;
Modified: trunk/reactos/drivers/filesystems/udfs/fscntrl.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/fscntrl.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/fscntrl.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -851,7 +851,7 @@
IN PVCB Vcb
)
{
- NTSTATUS RC;
+// NTSTATUS RC;
PREVENT_MEDIA_REMOVAL_USER_IN Buff;
KdPrint(("UDFStartEjectWaiter:\n"));
@@ -879,11 +879,11 @@
// prevent media removal
KdPrint(("UDFStartEjectWaiter: lock media\n"));
Buff.PreventMediaRemoval = TRUE;
- RC = UDFTSendIOCTL( IOCTL_STORAGE_MEDIA_REMOVAL,
- Vcb,
- &Buff,sizeof(PREVENT_MEDIA_REMOVAL_USER_IN),
- NULL,0,
- FALSE,NULL );
+ UDFTSendIOCTL( IOCTL_STORAGE_MEDIA_REMOVAL,
+ Vcb,
+ &Buff,sizeof(PREVENT_MEDIA_REMOVAL_USER_IN),
+ NULL,0,
+ FALSE,NULL );
Vcb->VCBFlags |= UDF_VCB_FLAGS_MEDIA_LOCKED;
}
KdPrint(("UDFStartEjectWaiter: prepare to start\n"));
@@ -1267,9 +1267,7 @@
DirNdx->FileCharacteristics = FILE_DIRECTORY;
DirNdx->FI_Flags = UDF_FI_FLAG_SYS_ATTR;
DirNdx->SysAttr = FILE_ATTRIBUTE_READONLY;
- DirNdx->FName.Buffer = L".";
- DirNdx->FName.Length =
- (DirNdx->FName.MaximumLength = sizeof(L".")) - sizeof(WCHAR);
+ RtlInitUnicodeString(&DirNdx->FName, L".");
DirNdx->FileInfo = RootFcb->FileInfo;
DirNdx->FI_Flags |= UDFBuildHashEntry(Vcb, &(DirNdx->FName),
&(DirNdx->hashes), HASH_ALL | HASH_KEEP_NAME);
@@ -1279,9 +1277,7 @@
DirNdx->FI_Flags |= UDF_FI_FLAG_FI_INTERNAL;
}
DirNdx->SysAttr = FILE_ATTRIBUTE_READONLY;
- DirNdx->FName.Buffer = L"Blank.CD";
- DirNdx->FName.Length =
- (DirNdx->FName.MaximumLength = sizeof(L"Blank.CD")) - sizeof(WCHAR);
+ RtlInitUnicodeString(&DirNdx->FName, L"Blank.CD");
DirNdx->FI_Flags |= UDFBuildHashEntry(Vcb, &(DirNdx->FName),
&(DirNdx->hashes), HASH_ALL);
RootFcb->FileInfo->Dloc->DirIndex = hDirNdx;
@@ -1820,12 +1816,12 @@
IoAcquireVpbSpinLock( &SavedIrql );
if (!(Vcb->Vpb->Flags & VPB_LOCKED) &&
- (Vcb->VolumeLockPID == -1) &&
+ (Vcb->VolumeLockPID == (ULONG)-1) &&
(Vcb->VCBOpenCount <= UDF_RESIDUAL_REFERENCE+1) &&
(Vcb->Vpb->ReferenceCount == 2)) {
// Mark volume as locked
- if(PID == -1) {
+ if(PID == (ULONG)-1) {
Vcb->Vpb->Flags |= VPB_LOCKED;
}
Vcb->VCBFlags |= UDF_VCB_FLAGS_VOLUME_LOCKED;
@@ -2075,7 +2071,7 @@
IN PIRP Irp
)
{
- NTSTATUS RC;
+// NTSTATUS RC;
PEXTENDED_IO_STACK_LOCATION IrpSp =
(PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation( Irp );
@@ -2095,7 +2091,8 @@
LARGE_INTEGER StartingLcn;
PVOLUME_BITMAP_BUFFER OutputBuffer;
ULONG i, lim;
- PULONG FSBM, Dest;
+ PULONG FSBM;
+// PULONG Dest;
ULONG LSh;
// Decode the file object, the only type of opens we accept are
@@ -2149,12 +2146,12 @@
if (OutputBufferLength < (DesiredClusters + 7) / 8) {
BytesToCopy = OutputBufferLength;
- RC = STATUS_BUFFER_OVERFLOW;
+// RC = STATUS_BUFFER_OVERFLOW;
} else {
BytesToCopy = (DesiredClusters + 7) / 8;
- RC = STATUS_SUCCESS;
+// RC = STATUS_SUCCESS;
}
UDFAcquireResourceExclusive(&(Vcb->VCBResource), TRUE );
@@ -2169,7 +2166,7 @@
lim = BytesToCopy * 8;
FSBM = (PULONG)(Vcb->FSBM_Bitmap);
LSh = Vcb->LB2B_Bits;
- Dest = (PULONG)(&OutputBuffer->Buffer[0]);
+// Dest = (PULONG)(&OutputBuffer->Buffer[0]);
for(i=StartingCluster & ~7; i<lim; i++) {
if(UDFGetFreeBit(FSBM, i<<LSh))
Modified: trunk/reactos/drivers/filesystems/udfs/lockctrl.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/l…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/lockctrl.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/lockctrl.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -109,7 +109,7 @@
NTSTATUS RC = STATUS_SUCCESS;
PIO_STACK_LOCATION IrpSp = NULL;
//IO_STATUS_BLOCK LocalIoStatus;
- BOOLEAN CompleteRequest = FALSE;
+// BOOLEAN CompleteRequest = FALSE;
BOOLEAN PostRequest = FALSE;
BOOLEAN CanWait = FALSE;
PtrUDFNTRequiredFCB NtReqFcb = NULL;
@@ -137,7 +137,7 @@
if ( (Fcb->NodeIdentifier.NodeType == UDF_NODE_TYPE_VCB) ||
(Fcb->FCBFlags & UDF_FCB_DIRECTORY)) {
- CompleteRequest = TRUE;
+// CompleteRequest = TRUE;
try_return(RC = STATUS_INVALID_PARAMETER);
}
@@ -153,7 +153,7 @@
AcquiredFCB = TRUE;
RC = FsRtlProcessFileLock(&(NtReqFcb->FileLock), Irp, NULL);
- CompleteRequest = TRUE;
+// CompleteRequest = TRUE;
try_exit: NOTHING;
@@ -253,7 +253,7 @@
// Now call the FsRtl routine to do the actual processing of the
// Lock request
- if (Results = FsRtlFastLock( &(Fcb->NTRequiredFCB->FileLock),
+ if ((Results = FsRtlFastLock( &(Fcb->NTRequiredFCB->FileLock),
FileObject,
FileOffset,
Length,
@@ -263,7 +263,7 @@
ExclusiveLock,
IoStatus,
NULL,
- FALSE )) {
+ FALSE ))) {
// Set the flag indicating if Fast I/O is possible
Fcb->NTRequiredFCB->CommonFCBHeader.IsFastIoPossible =
UDFIsFastIoPossible(Fcb);
Modified: trunk/reactos/drivers/filesystems/udfs/misc.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/m…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/misc.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/misc.cpp [iso-8859-1] Tue Jun 9 10:40:26 2015
@@ -1750,7 +1750,7 @@
typedef ULONG
(*ptrUDFGetParameter)(
IN PVCB Vcb,
- IN PWSTR Name,
+ IN PCWSTR Name,
IN ULONG DefValue
);
@@ -1759,7 +1759,7 @@
PVCB Vcb,
BOOLEAN Update,
BOOLEAN UseCfg,
- PWCHAR Name,
+ PCWSTR Name,
ULONG Flag,
BOOLEAN Default
)
@@ -1824,7 +1824,7 @@
if(!Vcb->BM_FlushPriod) {
Vcb->BM_FlushPriod = UDF_DEFAULT_BM_FLUSH_TIMEOUT;
} else
- if(Vcb->BM_FlushPriod == -1) {
+ if(Vcb->BM_FlushPriod == (ULONG)-1) {
Vcb->BM_FlushPriod = 0;
}
Vcb->Tree_FlushPriod = UDFGetParameter(Vcb, UDF_TREE_FLUSH_PERIOD_NAME,
@@ -1832,7 +1832,7 @@
if(!Vcb->Tree_FlushPriod) {
Vcb->Tree_FlushPriod = UDF_DEFAULT_TREE_FLUSH_TIMEOUT;
} else
- if(Vcb->Tree_FlushPriod == -1) {
+ if(Vcb->Tree_FlushPriod == (ULONG)-1) {
Vcb->Tree_FlushPriod = 0;
}
Vcb->SkipCountLimit = UDFGetParameter(Vcb, UDF_NO_UPDATE_PERIOD_NAME,
@@ -1982,7 +1982,7 @@
ULONG
UDFGetRegParameter(
IN PVCB Vcb,
- IN PWSTR Name,
+ IN PCWSTR Name,
IN ULONG DefValue
)
{
@@ -1996,7 +1996,7 @@
ULONG
UDFGetCfgParameter(
IN PVCB Vcb,
- IN PWSTR Name,
+ IN PCWSTR Name,
IN ULONG DefValue
)
{
@@ -2221,9 +2221,9 @@
ULONG
UDFRegCheckParameterValue(
IN PUNICODE_STRING RegistryPath,
- IN PWSTR Name,
+ IN PCWSTR Name,
IN PUNICODE_STRING PtrVolumePath,
- IN PWSTR DefaultPath,
+ IN PCWSTR DefaultPath,
IN ULONG DefValue
)
{
@@ -2357,19 +2357,19 @@
// *** Read GLOBAL_DEFAULTS from
- // \DwUdf\Parameters_Unknown\
+ // "\DwUdf\Parameters_Unknown\"
status = RegTGetDwordValue(NULL, paramPath.Buffer, Name, &val);
// *** Read DEV_CLASS_SPEC_DEFAULTS (if any) from
- // \DwUdf\Parameters_%DevClass%\
+ // "\DwUdf\Parameters_%DevClass%\"
if(DefaultPath) {
status = RegTGetDwordValue(NULL, defaultParamPath.Buffer, Name, &val);
}
// *** Read DEV_SPEC_PARAMS from (if device supports GetDevName)
- // \DwUdf\Parameters\%DevName%\
+ // "\DwUdf\Parameters\%DevName%\"
status = RegTGetDwordValue(NULL, paramDevPath.Buffer, Name, &val);
Modified: trunk/reactos/drivers/filesystems/udfs/pnp.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/p…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/pnp.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/pnp.cpp [iso-8859-1] Tue Jun 9 10:40:26 2015
@@ -414,7 +414,7 @@
// The device will be going away. Remove our lock (benign
// if we never had it).
if((Vcb->Vpb->Flags & VPB_LOCKED) ||
- (Vcb->VolumeLockPID != -1) ) {
+ (Vcb->VolumeLockPID != (ULONG)-1) ) {
Vcb->Vpb->Flags &= ~VPB_LOCKED;
Vcb->VCBFlags &= ~UDF_VCB_FLAGS_VOLUME_LOCKED;
Vcb->VolumeLockFileObject = NULL;
@@ -628,7 +628,7 @@
return RC;
}
-/*
+/*
NTSTATUS
UDFPnpCancelRemove (
PtrUDFIrpContext PtrIrpContext,
@@ -636,6 +636,7 @@
PVCB Vcb
)
+*/
/*++
Routine Description:
Modified: trunk/reactos/drivers/filesystems/udfs/protos.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/p…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/protos.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/protos.h [iso-8859-1] Tue Jun 9 10:40:26 2015
@@ -658,13 +658,13 @@
extern ULONG UDFGetRegParameter(
IN PVCB Vcb,
- IN PWSTR Name,
+ IN PCWSTR Name,
IN ULONG DefValue = 0);
extern ULONG
UDFGetCfgParameter(
IN PVCB Vcb,
- IN PWSTR Name,
+ IN PCWSTR Name,
IN ULONG DefValue
);
@@ -673,9 +673,9 @@
extern ULONG UDFRegCheckParameterValue(
IN PUNICODE_STRING RegistryPath,
- IN PWSTR Name,
+ IN PCWSTR Name,
IN PUNICODE_STRING PtrVolumePath,
- IN PWSTR DefaultPath,
+ IN PCWSTR DefaultPath,
IN ULONG DefValue = 0);
extern VOID UDFInitializeIrpContextFromLite (
Modified: trunk/reactos/drivers/filesystems/udfs/read.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/r…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/read.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/read.cpp [iso-8859-1] Tue Jun 9 10:40:26 2015
@@ -452,7 +452,7 @@
NonBufferedIo = TRUE;
}
- if(ByteOffset.HighPart == 0xFFFFFFFF) {
+ if(ByteOffset.HighPart == -1) {
if(ByteOffset.LowPart == FILE_USE_FILE_POINTER_POSITION) {
ByteOffset = FileObject->CurrentByteOffset;
}
Modified: trunk/reactos/drivers/filesystems/udfs/udf_dbg.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/u…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/udf_dbg.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/udf_dbg.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -498,12 +498,12 @@
{
PLARGE_INTEGER to;
LARGE_INTEGER dto;
- LARGE_INTEGER cto;
+// LARGE_INTEGER cto;
NTSTATUS RC;
ULONG c = 20;
dto.QuadPart = -5LL*1000000LL*10LL; // 5 sec
- cto.QuadPart = Timeout->QuadPart;
+// cto.QuadPart = Timeout->QuadPart;
if(Timeout) {
if(dto.QuadPart > Timeout->QuadPart) {
to = Timeout;
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/alloc.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/u…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/udf_info/alloc.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/udf_info/alloc.cpp [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -1151,7 +1151,7 @@
s+=Vcb->Partitions[i].PartitionLen;
}
} else {
- if(s & ((int64)1 << 64)) s=0;
+ if(s & ((int64)1 << 63)) s=0; /* FIXME ReactOS this shift value was
64, which is undefiened behavior. */
s= Vcb->LastPossibleLBA - Vcb->Partitions[0].PartitionRoot;
}
return s >> Vcb->LB2B_Bits;
@@ -1197,9 +1197,13 @@
#ifdef _X86_
+#ifdef _MSC_VER
#pragma warning(disable:4035) // re-enable below
-
+#endif
+
+#ifdef _MSC_VER
__declspec (naked)
+#endif
BOOLEAN
__fastcall
UDFGetBit__(
@@ -1233,7 +1237,9 @@
#endif
} // end UDFGetBit__()
+#ifdef _MSC_VER
__declspec (naked)
+#endif
void
__fastcall
UDFSetBit__(
@@ -1339,7 +1345,9 @@
#endif
} // end UDFSetBits__()
+#ifdef _MSC_VER
__declspec (naked)
+#endif
void
__fastcall
UDFClrBit__(
@@ -1445,5 +1453,7 @@
#endif
} // end UDFClrBits__()
+#ifdef _MSC_VER
#pragma warning(default:4035)
+#endif
#endif // _X86_
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/dirtree.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/u…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/udf_info/dirtree.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/udf_info/dirtree.cpp [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -236,11 +236,15 @@
} // end UDFDirIndexTrunc()
#if defined _X86_ && !defined UDF_LIMIT_DIR_SIZE
+#ifdef _MSC_VER
#pragma warning(disable:4035) // re-enable below
+#endif
/*
This routine returns pointer to DirIndex item with index i.
*/
+#ifdef _MSC_VER
__declspec (naked)
+#endif
PDIR_INDEX_ITEM
__fastcall
UDFDirIndex(
@@ -299,7 +303,9 @@
return NULL;
#endif
}
+#ifdef _MSC_VER
#pragma warning(default:4035)
+#endif
#endif // _X86_
/*
@@ -397,7 +403,7 @@
}
if(_FileInfo) {
- if(FileInfo = Context->DirNdx->FileInfo) {
+ if((FileInfo = Context->DirNdx->FileInfo)) {
if(FileInfo->ParentFile != Context->DirInfo) {
ParFileInfo = UDFLocateParallelFI(Context->DirInfo,
Context->i,
@@ -507,7 +513,7 @@
PDIR_INDEX_ITEM DirNdx;
PFILE_IDENT_DESC FileId;
uint32 Offset = 0;
- uint32 prevOffset = 0;
+// uint32 prevOffset = 0;
uint_di Count = 0;
OSSTATUS status;
int8* buff;
@@ -541,7 +547,7 @@
// scan Dir to get entry counter
FileId = (PFILE_IDENT_DESC)buff;
DirPrint((" ExtInfo->Length %x\n", ExtInfo->Length));
- prevOffset = 0;
+// prevOffset = 0;
while(Offset<ExtInfo->Length) {
DirPrint((" Offset %x\n", Offset));
if(!FileId->descTag.tagIdent) {
@@ -566,7 +572,7 @@
FileInfo->Dloc->DirIndex->DelCount =
Vcb->PackDirThreshold+1;
}
}
- prevOffset = Offset;
+// prevOffset = Offset;
Offset += (FileId->lengthFileIdent + FileId->lengthOfImpUse +
sizeof(FILE_IDENT_DESC) + 3) & (~((uint32)3));
FileId = (PFILE_IDENT_DESC)((buff)+Offset);
Count++;
@@ -603,7 +609,7 @@
ASSERT(PartNum != -1);
DirNdx->FileEntryLoc.logicalBlockNum =
UDFPhysLbaToPart(Vcb, PartNum,
FileInfo->Dloc->FELoc.Mapping[0].extLocation);
- if(DirNdx->FileEntryLoc.logicalBlockNum == -1) {
+ if(DirNdx->FileEntryLoc.logicalBlockNum == (ULONG)-1) {
DirPrint((" err: FileEntryLoc=-1\n"));
DbgFreePool(buff);
return STATUS_FILE_CORRUPT_ERROR;
@@ -613,9 +619,7 @@
FILE_DIRECTORY;
// DirNdx->Offset = 0;
// DirNdx->Length = 0;
- DirNdx->FName.Buffer = L".";
- DirNdx->FName.Length =
- (DirNdx->FName.MaximumLength = sizeof(L".")) - sizeof(WCHAR);
+ RtlInitUnicodeString(&DirNdx->FName, L".");
DirNdx->FileInfo = FileInfo;
DirNdx->FI_Flags |= UDF_FI_FLAG_KEEP_NAME;
DirNdx->FI_Flags |= UDFBuildHashEntry(Vcb, &(DirNdx->FName),
&(DirNdx->hashes),
@@ -623,7 +627,7 @@
Count++;
FileId = (PFILE_IDENT_DESC)buff;
status = STATUS_SUCCESS;
- prevOffset = 0;
+// prevOffset = 0;
while((Offset<ExtInfo->Length) && FileId->descTag.tagIdent) {
// add new entry to index list
if(FileId->descTag.tagIdent != TID_FILE_IDENT_DESC) {
@@ -656,9 +660,7 @@
// init 'parent' entry
// '..' points to Parent Object (if any),
// otherwise it points to the Dir itself
- DirNdx->FName.Buffer = L"..";
- DirNdx->FName.Length =
- (DirNdx->FName.MaximumLength = sizeof(L"..")) - sizeof(WCHAR);
+ RtlInitUnicodeString(&DirNdx->FName, L"..");
DirNdx->FileInfo = (FileInfo->ParentFile) ?
FileInfo->ParentFile : FileInfo;
DirNdx->FI_Flags |= UDF_FI_FLAG_KEEP_NAME;
@@ -707,7 +709,7 @@
FileId->fileCharacteristics |= FILE_DELETED;
}
#endif // UDF_CHECK_DISK_ALLOCATION
- prevOffset = Offset;
+// prevOffset = Offset;
Offset += DirNdx->Length;
FileId = (PFILE_IDENT_DESC)(((int8*)FileId)+DirNdx->Length);
Count++;
@@ -788,7 +790,7 @@
PartNum = (uint16)UDFGetPartNumByPhysLba(Vcb,
FileInfo->Dloc->FELoc.Mapping[0].extLocation);
ASSERT(PartNum != -1);
- while(DirNdx = UDFDirIndexScan(&ScanContext, NULL)) {
+ while((DirNdx = UDFDirIndexScan(&ScanContext, NULL))) {
if(UDFIsDeleted(DirNdx))
dc++;
@@ -932,7 +934,7 @@
PartNum = (uint16)UDFGetPartNumByPhysLba(Vcb,
FileInfo->Dloc->FELoc.Mapping[0].extLocation);
ASSERT(PartNum != -1);
- while(DirNdx = UDFDirIndexScan(&ScanContext, NULL)) {
+ while((DirNdx = UDFDirIndexScan(&ScanContext, NULL))) {
status = UDFReadFile__(Vcb, FileInfo, Offset = DirNdx->Offset,
l = DirNdx->Length, FALSE, Buf,
&ReadBytes);
@@ -996,7 +998,7 @@
UDFBuildHashEntry(Vcb, Name, &hashes, HASH_POSIX | HASH_ULFN);
- if(CanBe8d3 = UDFCanNameBeA8dot3(Name)) {
+ if((CanBe8d3 = UDFCanNameBeA8dot3(Name))) {
ShortName.MaximumLength = 13 * sizeof(WCHAR);
ShortName.Buffer = (PWCHAR)&ShortNameBuffer;
}
@@ -1007,7 +1009,7 @@
if(!IgnoreCase && !CanBe8d3) {
// perform case sensetive sequential directory scan
- while(DirNdx = UDFDirIndexScan(&ScanContext, NULL)) {
+ while((DirNdx = UDFDirIndexScan(&ScanContext, NULL))) {
if( (DirNdx->hashes.hPosix == hashes.hPosix) &&
DirNdx->FName.Buffer &&
(!RtlCompareUnicodeString(&(DirNdx->FName), Name, FALSE))
&&
@@ -1021,7 +1023,7 @@
if(hashes.hPosix == hashes.hLfn) {
- while(DirNdx = UDFDirIndexScan(&ScanContext, NULL)) {
+ while((DirNdx = UDFDirIndexScan(&ScanContext, NULL))) {
if(!DirNdx->FName.Buffer ||
(NotDeleted && UDFIsDeleted(DirNdx)) )
continue;
@@ -1042,7 +1044,7 @@
} else {
- while(DirNdx = UDFDirIndexScan(&ScanContext, NULL)) {
+ while((DirNdx = UDFDirIndexScan(&ScanContext, NULL))) {
// perform sequential directory scan
if(!DirNdx->FName.Buffer ||
(NotDeleted && UDFIsDeleted(DirNdx)) )
@@ -1244,7 +1246,7 @@
PUDF_DATALOC_INFO Dloc;
if(!Lba) return STATUS_INVALID_PARAMETER;
- if(Lba == (-1)) return STATUS_INVALID_PARAMETER;
+ if(Lba == (ULONG)-1) return STATUS_INVALID_PARAMETER;
UDFAcquireResourceExclusive(&(Vcb->DlocResource),TRUE);
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/extent.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/u…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/udf_info/extent.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/udf_info/extent.cpp [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -86,10 +86,12 @@
{
// uint32 Lba;
- uint32 l, d;
+ uint32 l;
+// uint32 d;
// scan extent table for suitable range (frag)
- d = (l = (Extent->extLength & UDF_EXTENT_LENGTH_MASK));
+// d = (l = (Extent->extLength & UDF_EXTENT_LENGTH_MASK));
+ l = (Extent->extLength & UDF_EXTENT_LENGTH_MASK);
if(!l) {
(*Index) = -1;
@@ -120,7 +122,7 @@
uint32 l, BSh = Vcb->BlockSizeBits;
uint32 i=0;
- while(l = ((Extent->extLength & UDF_EXTENT_LENGTH_MASK) >> BSh)) {
+ while((l = ((Extent->extLength & UDF_EXTENT_LENGTH_MASK) >> BSh))) {
if(Extent->extLocation >= lba &&
Extent->extLocation+l < lba) {
@@ -300,7 +302,8 @@
OUT PEXTENT_INFO AllocLoc
)
{
- uint32 i, lim, l, len, BSh, type;
+ uint32 i, lim, l, len, type;
+// uint32 BSh;
PEXTENT_MAP Extent, Extent2, AllocMap;
EXTENT_AD AllocExt;
PALLOC_EXT_DESC NextAllocDesc;
@@ -314,7 +317,7 @@
if(SubCallCount > ALLOC_DESC_MAX_RECURSE) return NULL;
locAddr.partitionReferenceNum = (uint16)PartNum;
- BSh = Vcb->BlockSizeBits;
+// BSh = Vcb->BlockSizeBits;
l = ((lim = (AllocDescLength/sizeof(SHORT_AD))) + 1 ) * sizeof(EXTENT_AD);
Extent = (PEXTENT_MAP)MyAllocatePoolTag__(NonPagedPool, l, MEM_EXTMAP_TAG);
if(!Extent) return NULL;
@@ -461,7 +464,8 @@
OUT PEXTENT_INFO AllocLoc // .Mapping must be intialized (non-Zero)
)
{
- uint32 i, lim, l, len, BSh, type;
+ uint32 i, lim, l, len, type;
+// uint32 BSh;
PEXTENT_MAP Extent, Extent2, AllocMap;
EXTENT_AD AllocExt;
PALLOC_EXT_DESC NextAllocDesc;
@@ -472,7 +476,7 @@
if(SubCallCount > ALLOC_DESC_MAX_RECURSE) return NULL;
- BSh = Vcb->BlockSizeBits;
+// BSh = Vcb->BlockSizeBits;
l = ((lim = (AllocDescLength/sizeof(LONG_AD))) + 1 ) * sizeof(EXTENT_AD);
Extent = (PEXTENT_MAP)MyAllocatePoolTag__(NonPagedPool, l, MEM_EXTMAP_TAG);
if(!Extent) return NULL;
@@ -598,7 +602,8 @@
OUT PEXTENT_INFO AllocLoc // .Mapping must be intialized (non-Zero)
)
{
- uint32 i, lim, l, len, BSh, type;
+ uint32 i, lim, l, len, type;
+// uint32 BSh;
PEXTENT_MAP Extent, Extent2, AllocMap;
EXTENT_AD AllocExt;
PALLOC_EXT_DESC NextAllocDesc;
@@ -609,7 +614,7 @@
if(SubCallCount > ALLOC_DESC_MAX_RECURSE) return NULL;
- BSh = Vcb->BlockSizeBits;
+// BSh = Vcb->BlockSizeBits;
l = ((lim = (AllocDescLength/sizeof(EXT_AD))) + 1 ) * sizeof(EXTENT_AD);
Extent = (PEXTENT_MAP)MyAllocatePoolTag__(NonPagedPool, l, MEM_EXTMAP_TAG);
if(!Extent) return NULL;
@@ -852,7 +857,7 @@
ValidateFileInfo(FileInfo);
ExtPrint(("UDFBuildShortAllocDescs: FE %x\n",
FileInfo->Dloc->FELoc.Mapping[0].extLocation));
// calculate length
- for(len=0; i=(Extent[len].extLength & UDF_EXTENT_LENGTH_MASK); len++, ph_len+=i)
{
+ for(len=0; (i=(Extent[len].extLength & UDF_EXTENT_LENGTH_MASK)); len++,
ph_len+=i) {
ExtPrint(("bShExt: type %x, loc %x, len %x\n",
Extent[len].extLength >> 30, Extent[len].extLocation,
Extent[len].extLength & UDF_EXTENT_LENGTH_MASK));
}
@@ -1039,7 +1044,7 @@
ExtPrint(("UDFBuildLongAllocDescs: FE %x\n",
FileInfo->Dloc->FELoc.Mapping[0].extLocation));
// calculate length
//for(len=0; i=(Extent[len].extLength & UDF_EXTENT_LENGTH_MASK); len++,
ph_len+=i);
- for(len=0; i=(Extent[len].extLength & UDF_EXTENT_LENGTH_MASK); len++, ph_len+=i)
{
+ for(len=0; (i=(Extent[len].extLength & UDF_EXTENT_LENGTH_MASK)); len++,
ph_len+=i) {
ExtPrint(("bLnExt: type %x, loc %x, len %x\n",
Extent[len].extLength >> 30, Extent[len].extLocation,
Extent[len].extLength & UDF_EXTENT_LENGTH_MASK));
}
@@ -1749,7 +1754,7 @@
j = i;
}
}
- if(j != -1) {
+ if(j != (ULONG)-1) {
i = j;
Ext->Mapping[i].extLocation = Lba;
Ext->Mapping[i].extLength = Vcb->LBlockSize |
(EXTENT_NOT_RECORDED_ALLOCATED << 30);
@@ -1828,7 +1833,7 @@
// I don't know what else comment can be added here.
// Just belive that it works
lba = UDFExtentOffsetToLba(Vcb, ExtInfo->Mapping, (Offset & ~((int64)LBS-1)),
NULL, NULL, NULL, &i);
- if(i == -1) return STATUS_INVALID_PARAMETER;
+ if(i == (ULONG)-1) return STATUS_INVALID_PARAMETER;
#ifdef UDF_DBG
check_size = UDFGetExtentLength(ExtInfo->Mapping);
ASSERT(!(check_size & (LBS-1)));
@@ -1962,7 +1967,7 @@
#endif
AdPrint(("Not->Alloc ExtInfo %x, Extent %x\n", ExtInfo, Extent));
UDFExtentOffsetToLba(Vcb, ExtInfo->Mapping, Offset, NULL, NULL, NULL, &i);
- if(i == -1) return STATUS_INVALID_PARAMETER;
+ if(i == (ULONG)-1) return STATUS_INVALID_PARAMETER;
if((Extent[i].extLength >> 30) != EXTENT_NOT_RECORDED_NOT_ALLOCATED) return
STATUS_SUCCESS;
uint32 PartNum = UDFGetPartNumByPhysLba(Vcb, Extent[0].extLocation);
@@ -2120,7 +2125,7 @@
DeadMapping[0].extLocation =
UDFExtentOffsetToLba(Vcb, ExtInfo->Mapping, Offset, NULL, NULL, NULL,
&i);
- if(i == -1) {
+ if(i == (ULONG)-1) {
BrutePoint();
return STATUS_INVALID_PARAMETER;
}
@@ -2620,7 +2625,7 @@
OUT int8** AllocData
)
{
- PEXTENT_MAP InMap;
+// PEXTENT_MAP InMap;
// uint32 i=0;
int8* Allocs;
uint16 AllocMode;
@@ -2637,7 +2642,7 @@
return STATUS_INSUFFICIENT_RESOURCES;
}
RtlZeroMemory(Allocs, InitSz);
- InMap = FileInfo->Dloc->DataLoc.Mapping;
+// InMap = FileInfo->Dloc->DataLoc.Mapping;
UDFCheckSpaceAllocation(Vcb, 0, InMap, AS_USED); // check if used
// TODO: move data from mapped locations here
@@ -2860,7 +2865,7 @@
j=0;
d = LBS >> Vcb->BlockSizeBits;
- for(i=0; l = (Mapping[i].extLength & UDF_EXTENT_LENGTH_MASK); i++) {
+ for(i=0; (l = (Mapping[i].extLength & UDF_EXTENT_LENGTH_MASK)); i++) {
base = Mapping[i].extLocation;
type = Mapping[i].extLength & UDF_EXTENT_FLAG_MASK;
for(; l>=(LONG)LBS; j++) {
@@ -2912,7 +2917,7 @@
PEXTENT_MAP Extent = ExtInfo->Mapping; // Extent array
uint32 to_read, Lba, sect_offs, flags, i;
- WCacheStartDirect__(&(Vcb->FastCache), Vcb, TRUE/*FALSE/*ForWrite*/);
+ WCacheStartDirect__(&(Vcb->FastCache), Vcb, TRUE/*FALSE*//*ForWrite*/);
if(!ExtInfo || !ExtInfo->Mapping) goto EO_IsCached;
if(!Length) {
retstat = TRUE;
@@ -3078,7 +3083,7 @@
int32 SubExtInfoSz = *_SubExtInfoSz;
int64 Length;
int64 NextOffset;
- OSSTATUS status = STATUS_BUFFER_OVERFLOW;
+// OSSTATUS status = STATUS_BUFFER_OVERFLOW;
(*_SubExtInfo) = NULL;
(*_SubExtInfoSz) = 0;
@@ -3121,7 +3126,7 @@
// prepare for reading next frag...
Length -= to_read;
if(!Length) {
- status = STATUS_SUCCESS;
+// status = STATUS_SUCCESS;
break;
}
ASSERT(to_read);
@@ -3132,8 +3137,10 @@
return STATUS_SUCCESS;
} // end UDFReadExtentLocation()
+#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4035) // re-enable below
+#endif
uint32
UDFGetZeroLength(
@@ -3150,7 +3157,9 @@
return Length*sizeof(uint32);
}
+#ifdef _MSC_VER
#pragma warning(pop) // re-enable warning #4035
+#endif
#ifndef UDF_READ_ONLY_BUILD
/*
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/u…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/udf_info/mount.cpp [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -17,7 +17,11 @@
#include "udf.h"
-/* FIXME*/
+/* FIXME */
+#ifdef XCHG_DD
+#undef XCHG_DD
+#endif
+
#define XCHG_DD(a,b) \
{ \
ULONG _temp_; \
@@ -197,13 +201,13 @@
int8* FSBM=NULL;
uint32 USl, FSl;
EXTENT_INFO FSBMExtInfo, USBMExtInfo;
- lb_addr locAddr;
+// lb_addr locAddr;
uint32 WrittenBytes;
UDF_CHECK_BITMAP_RESOURCE(Vcb);
plen = UDFPartLen(Vcb, PartNum);
- locAddr.partitionReferenceNum = (uint16)PartNum;
+// locAddr.partitionReferenceNum = (uint16)PartNum;
// prepare bitmaps for updating
status = UDFPrepareXSpaceBitmap(Vcb, &(phd->unallocatedSpaceBitmap),
&USBMExtInfo, &USBM, &USl);
@@ -996,7 +1000,7 @@
return STATUS_SUCCESS;
} // end UDFUmount__()
-/*************************************************************************
+/*************************************************************************/
/*
Find an anchor volume descriptor.
@@ -1668,9 +1672,9 @@
)
{
int8* tmp;
- int8* tmp_bm;
-// uint32 i, lim, j, lba, l, lim2, l2, k;
- uint32 i, lim, j, lba, lim2;
+// int8* tmp_bm;
+// uint32 i, l2, k, lim, j, lim2;
+ uint32 lba;
lb_addr locAddr;
OSSTATUS status;
uint16 Ident;
@@ -1684,7 +1688,7 @@
KdPrint((" UDFVerifyXSpaceBitmap: part %x\n", PartNum));
if(!(Length = (bm->extLength & UDF_EXTENT_LENGTH_MASK))) return
STATUS_SUCCESS;
- i=UDFPartStart(Vcb, PartNum);
+// i=UDFPartStart(Vcb, PartNum);
flags = bm->extLength >> 30;
if(!flags /*|| flags == EXTENT_NOT_RECORDED_ALLOCATED*/) {
tmp = (int8*)DbgAllocatePool(NonPagedPool, max(Length, Vcb->BlockSize));
@@ -1707,9 +1711,9 @@
if(!OS_SUCCESS(status = UDFReadData(Vcb, FALSE,
((uint64)lba)<<Vcb->BlockSizeBits, Length, FALSE, tmp, &ReadBytes)))
goto err_vfyxsbm_1;
UDFRegisterFsStructure(Vcb, lba, Length);
- lim = min(i + ((lim2 = ((PSPACE_BITMAP_DESC)tmp)->numOfBits) <<
Vcb->LB2B_Bits), Vcb->FSBM_BitCount);
- tmp_bm = tmp + sizeof(SPACE_BITMAP_DESC);
- j = 0;
+// lim = min(i + ((lim2 = ((PSPACE_BITMAP_DESC)tmp)->numOfBits) <<
Vcb->LB2B_Bits), Vcb->FSBM_BitCount);
+// tmp_bm = tmp + sizeof(SPACE_BITMAP_DESC);
+// j = 0;
/* for(;(l = UDFGetBitmapLen((uint32*)tmp_bm, j, lim2)) && (i<lim);) {
// expand LBlocks to Sectors...
l2 = l << Vcb->LB2B_Bits;
@@ -2364,7 +2368,7 @@
OSSTATUS RC = STATUS_SUCCESS;
int8* Buf = (int8*)MyAllocatePool__(NonPagedPool,Vcb->BlockSize);
UDF_VDS_RECORD vds[VDS_POS_LENGTH];
- GenericDesc *gd;
+// GenericDesc *gd;
uint32 i,j;
uint16 ident;
int8* Buf2 = NULL;
@@ -2416,7 +2420,7 @@
RC = UDFReadTagged(Vcb,Buf2, j, j, &ident);
if(!OS_SUCCESS(RC)) try_return(RC);
UDFRegisterFsStructure(Vcb, j, Vcb->BlockSize);
- gd = (struct GenericDesc *)Buf2;
+// gd = (struct GenericDesc *)Buf2;
if(ident == TID_PARTITION_DESC) {
RC = UDFLoadPartDesc(Vcb,Buf2);
if(!OS_SUCCESS(RC)) try_return(RC);
@@ -2465,7 +2469,7 @@
OSSTATUS RC = STATUS_SUCCESS;
int8* Buf = (int8*)MyAllocatePool__(NonPagedPool,Vcb->BlockSize);
UDF_VDS_RECORD vds[VDS_POS_LENGTH];
- GenericDesc *gd;
+// GenericDesc *gd;
uint32 i,j;
uint16 ident;
int8* Buf2 = NULL;
@@ -2502,7 +2506,7 @@
RC = UDFReadTagged(Vcb,Buf2, j, j, &ident);
if(!OS_SUCCESS(RC)) try_return(RC);
UDFRegisterFsStructure(Vcb, j, Vcb->BlockSize);
- gd = (struct GenericDesc *)Buf2;
+// gd = (struct GenericDesc *)Buf2;
if(ident == TID_PARTITION_DESC) {
RC = UDFVerifyPartDesc(Vcb,Buf2);
if(!OS_SUCCESS(RC)) try_return(RC);
@@ -2927,10 +2931,11 @@
IN uint32 Length
)
{
- BOOLEAN RC = FALSE;
//#ifdef _X86_
#ifdef _MSC_VER
+
+ BOOLEAN RC = FALSE;
uint32 len = Length;
__asm push ecx
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/phys_eject.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/u…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/udf_info/phys_eject.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/filesystems/udfs/udf_info/phys_eject.cpp [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -55,7 +55,7 @@
BOOLEAN SkipEject = FALSE;
BOOLEAN SkipFlush = FALSE;
- BOOLEAN FlushAndEject = FALSE;
+// BOOLEAN FlushAndEject = FALSE;
KdPrint((" UDFEjectReqWaiter: start\n"));
uint8 supported_evt_classes = 0;
@@ -604,7 +604,7 @@
try_return(RC);
}
}
- FlushAndEject = TRUE;
+// FlushAndEject = TRUE;
device_failure:
// Ok. Lets flush all we have in memory, dismount volume & eject disc
// Acquire Vcb resource
@@ -707,7 +707,7 @@
)
{
LARGE_INTEGER delay;
- OSSTATUS RC;
+// OSSTATUS RC;
ULONG i;
// flush system cache
@@ -731,11 +731,11 @@
KdPrint((" cleanup tray-lock (%d+2):\n", Vcb->MediaLockCount));
for(i=0; i<Vcb->MediaLockCount+2; i++) {
Buf->PreventMediaRemoval = FALSE;
- RC = UDFPhSendIOCTL(IOCTL_STORAGE_MEDIA_REMOVAL,
- Vcb->TargetDeviceObject,
- Buf,sizeof(PREVENT_MEDIA_REMOVAL_USER_IN),
- NULL,0,
- FALSE,NULL);
+ UDFPhSendIOCTL(IOCTL_STORAGE_MEDIA_REMOVAL,
+ Vcb->TargetDeviceObject,
+ Buf,sizeof(PREVENT_MEDIA_REMOVAL_USER_IN),
+ NULL,0,
+ FALSE,NULL);
KeDelayExecutionThread(KernelMode, FALSE, &delay);
}
delay.QuadPart = -2000000; // 0.2 sec
@@ -771,11 +771,11 @@
CBuff.Byte2.Flags = CloseTrkSes_Ses;
CBuff.TrackNum = 1;
- RC = UDFPhSendIOCTL(IOCTL_CDRW_CLOSE_TRK_SES,
- Vcb->TargetDeviceObject,
- &CBuff,sizeof(CLOSE_TRK_SES_USER_IN),
- &CBuff,sizeof(CLOSE_TRK_SES_USER_IN),
- FALSE, NULL );
+ UDFPhSendIOCTL(IOCTL_CDRW_CLOSE_TRK_SES,
+ Vcb->TargetDeviceObject,
+ &CBuff,sizeof(CLOSE_TRK_SES_USER_IN),
+ &CBuff,sizeof(CLOSE_TRK_SES_USER_IN),
+ FALSE, NULL );
/* } else
if(Vcb->MediaClassEx == CdMediaClass_DVDRW) {
KdPrint((" Close BG-formatted track\n"));
@@ -800,11 +800,11 @@
if(Eject &&
(Vcb->VCBFlags & UDF_VCB_FLAGS_REMOVABLE_MEDIA)) {
- RC = UDFPhSendIOCTL(IOCTL_STORAGE_EJECT_MEDIA,
- Vcb->TargetDeviceObject,
- NULL,0,
- NULL,0,
- FALSE,NULL);
+ UDFPhSendIOCTL(IOCTL_STORAGE_EJECT_MEDIA,
+ Vcb->TargetDeviceObject,
+ NULL,0,
+ NULL,0,
+ FALSE,NULL);
}
// notify media change
/* if(Vcb->VCBFlags & UDF_VCB_FLAGS_OUR_DEVICE_DRIVER) {
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/remap.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/u…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/udf_info/remap.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/udf_info/remap.cpp [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -117,7 +117,7 @@
w = InterlockedIncrement((PLONG)&(VerifyCtx->WaiterCount));
KdPrint((" %d waiters\n", w));
DbgWaitForSingleObject(&(VerifyCtx->vrfEvent), NULL);
- if(w = InterlockedDecrement((PLONG)&(VerifyCtx->WaiterCount))) {
+ if((w = InterlockedDecrement((PLONG)&(VerifyCtx->WaiterCount)))) {
KdPrint((" still %d waiters, q %d\n", w,
VerifyCtx->QueuedCount));
if(!VerifyCtx->QueuedCount) {
KdPrint((" pulse event\n", w));
@@ -543,7 +543,7 @@
{
PVCB Vcb = VerifyReq->Vcb;
ULONG ReadBytes;
- OSSTATUS RC;
+// OSSTATUS RC;
ULONG i;
ReadBytes = (ULONG)Vcb;
@@ -551,20 +551,20 @@
if(Vcb->SparingCountFree) {
WCacheStartDirect__(&(Vcb->FastCache), Vcb, TRUE);
for(i=0; i<VerifyReq->nReq; i++) {
- RC = UDFTIOVerify(Vcb,
- VerifyReq->Buffer, // Target buffer
- VerifyReq->vr[i].BCount << Vcb->BlockSizeBits,
- VerifyReq->vr[i].lba,
- &ReadBytes,
- PH_TMP_BUFFER | PH_VCB_IN_RETLEN /*| PH_LOCK_CACHE*/);
+ UDFTIOVerify(Vcb,
+ VerifyReq->Buffer, // Target buffer
+ VerifyReq->vr[i].BCount << Vcb->BlockSizeBits,
+ VerifyReq->vr[i].lba,
+ &ReadBytes,
+ PH_TMP_BUFFER | PH_VCB_IN_RETLEN /*| PH_LOCK_CACHE*/);
}
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));
- RC = UDFVRead(Vcb, VerifyReq->Buffer, VerifyReq->vr[i].BCount,
VerifyReq->vr[i].lba,
- PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER);
+ UDFVRead(Vcb, VerifyReq->Buffer, VerifyReq->vr[i].BCount,
VerifyReq->vr[i].lba,
+ PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER);
}
}
#else
@@ -775,7 +775,7 @@
buff = (uint8*)DbgAllocatePoolWithTag(NonPagedPool, Vcb->WriteBlockSize,
'bNWD' );
if(buff) {
for(i=0; i<BCount; i+=d) {
- if(!(LBA+i & (PS-1)) &&
+ if(!((LBA+i) & (PS-1)) &&
(i+PS <= BCount)) {
d = PS;
} else {
@@ -821,7 +821,7 @@
BS = Vcb->SparingBlockSize;
// use sparing table for relocation
- if(Vcb->SparingCountFree == -1) {
+ if(Vcb->SparingCountFree == (ULONG)-1) {
KdPrint(("calculate free spare areas\n"));
re_check:
KdPrint(("verify spare area\n"));
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/udf_info.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/u…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/udf_info/udf_info.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/udf_info/udf_info.cpp [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -356,11 +356,15 @@
Decides whether character passed is an illegal character for a
DOS file name.
*/
+#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4035) // re-enable below
+#endif
#ifdef _X86_
+#ifdef _MSC_VER
__declspec (naked)
+#endif
#endif // _X86_
BOOLEAN
__fastcall
@@ -398,7 +402,9 @@
#endif // _X86_
} // end UDFIsIllegalChar()
+#ifdef _MSC_VER
#pragma warning(pop) // re-enable warning #4035
+#endif
/*
Translate udfName to dosName using OSTA compliant.
@@ -881,7 +887,7 @@
/* If the name has illegal characters or and extension, it */
/* is not a DOS device name. */
-/* if (needsCRC == FALSE && extLen == 0) {
+/* if (needsCRC == FALSE && extLen == 0) { */
/* If this is the name of a DOS device, a CRC code should */
/* be appended to the file name.
if (IsDeviceName(udfName, udfLen))
@@ -976,7 +982,7 @@
{
PFILE_ENTRY FileEntry;
OSSTATUS status;
- EntityID* eID;
+// EntityID* eID;
uint32 l;
EXTENT_INFO _FEExtInfo;
uint16* lcp;
@@ -1021,11 +1027,11 @@
FileEntry->gid = Vcb->DefaultGID;
if(Extended) {
- eID = &(((PEXTENDED_FILE_ENTRY)FileEntry)->impIdent);
+// eID = &(((PEXTENDED_FILE_ENTRY)FileEntry)->impIdent);
lcp = &(((PEXTENDED_FILE_ENTRY)FileEntry)->fileLinkCount);
((PEXTENDED_FILE_ENTRY)FileEntry)->checkpoint = 1;
} else {
- eID = &(FileEntry->impIdent);
+// eID = &(FileEntry->impIdent);
lcp = &(FileEntry->fileLinkCount);
((PFILE_ENTRY)FileEntry)->checkpoint = 1;
}
@@ -1523,7 +1529,7 @@
counter = FileCounter ?
&(Vcb->numFiles) :
&(Vcb->numDirs);
- if(*counter == -1)
+ if(*counter == (ULONG)-1)
return;
if(Increase) {
UDFInterlockedIncrement((int32*)counter);
@@ -1950,13 +1956,13 @@
hCurDirNdx = DirInfo->Dloc->DirIndex;
// check if we can delete all files
- for(i=2; CurDirNdx = UDFDirIndex(hCurDirNdx,i); i++) {
+ for(i=2; (CurDirNdx = UDFDirIndex(hCurDirNdx,i)); i++) {
// try to open Stream
if(CurDirNdx->FileInfo)
return STATUS_CANNOT_DELETE;
}
// start deletion
- for(i=2; CurDirNdx = UDFDirIndex(hCurDirNdx,i); i++) {
+ for(i=2; (CurDirNdx = UDFDirIndex(hCurDirNdx,i)); i++) {
// try to open Stream
status = UDFOpenFile__(Vcb, FALSE, TRUE, NULL, DirInfo, &FileInfo, &i);
if(status == STATUS_FILE_DELETED) {
@@ -2030,7 +2036,7 @@
// some routines may send invalid Index
if(!(DirNdx = UDFDirIndex(hDirNdx,i)))
return STATUS_OBJECT_NAME_NOT_FOUND;
- if(FileInfo = DirNdx->FileInfo) {
+ if((FileInfo = DirNdx->FileInfo)) {
// file is already opened.
if((DirNdx->FileCharacteristics & FILE_DELETED) && NotDeleted) {
AdPrint((" FILE_DELETED on open\n"));
@@ -2307,7 +2313,7 @@
IsASDir = UDFIsAStreamDir(FileInfo);
- if(Dloc = FileInfo->Dloc) {
+ if((Dloc = FileInfo->Dloc)) {
#ifdef UDF_DBG
DirInfo = FileInfo->ParentFile;
@@ -2349,7 +2355,7 @@
if(Dloc->DirIndex) {
uint_di i;
- for(i=2; DirNdx = UDFDirIndex(Dloc->DirIndex,i); i++) {
+ for(i=2; (DirNdx = UDFDirIndex(Dloc->DirIndex,i)); i++) {
if(DirNdx->FileInfo) {
if(!KeepDloc) {
BrutePoint();
@@ -2433,7 +2439,7 @@
#endif //UDF_TRACK_ONDISK_ALLOCATION
if(FileInfo->Dloc->DirIndex) {
uint_di i;
- for(i=2; DirNdx = UDFDirIndex(Dloc->DirIndex,i); i++) {
+ for(i=2; (DirNdx = UDFDirIndex(Dloc->DirIndex,i)); i++) {
ASSERT(!DirNdx->FileInfo);
if(DirNdx->FName.Buffer)
MyFreePool__(DirNdx->FName.Buffer);
@@ -2736,7 +2742,7 @@
#endif // UDF_LIMIT_DIR_SIZE
// search for suitable unused entry
if(UDFDirIndexInitScan(DirInfo, &ScanContext, 2)) {
- while(DirNdx = UDFDirIndexScan(&ScanContext, NULL)) {
+ while((DirNdx = UDFDirIndexScan(&ScanContext, NULL))) {
if((DirNdx->Length == l) && UDFIsDeleted(DirNdx)
&&
!DirNdx->FileInfo ) {
// free unicode-buffer with old name
@@ -2773,7 +2779,7 @@
DirNdx->Offset = 0;
}
// new terminator is recorded by UDFDirIndexGrow()
- if( ((d = (LBS - (DirNdx->Offset + l + DirInfo->Dloc->DataLoc.Offset)
& (LBS-1) )) < sizeof(FILE_IDENT_DESC)) &&
+ if( ((d = ((LBS - (DirNdx->Offset + l + DirInfo->Dloc->DataLoc.Offset))
& (LBS-1) )) < sizeof(FILE_IDENT_DESC)) &&
d ) {
// insufficient space at the end of last sector for
// next FileIdent's tag. fill it with ImpUse data
@@ -4269,8 +4275,10 @@
This routine computes 32-bit hash based on CRC-32 from SSH
*/
+#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4035) // re-enable below
+#endif
//#ifdef _X86_
#ifdef _MSC_VER
@@ -4573,7 +4581,9 @@
} // end UDFCrc()
+#ifdef _MSC_VER
#pragma warning(pop) // re-enable warning #4035
+#endif
/*
Read the first block of a tagged descriptor & check it.
Modified: trunk/reactos/drivers/filesystems/udfs/udf_info/udf_rel.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/u…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/udf_info/udf_rel.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/udf_info/udf_rel.h [iso-8859-1] Tue Jun 9
10:40:26 2015
@@ -423,8 +423,8 @@
#define UNICODE_PERIOD 0x002E
#define UNICODE_SPACE 0x0020
-#define LBA_OUT_OF_EXTENT ((LONG)(-1))
-#define LBA_NOT_ALLOCATED ((LONG)(-2))
+#define LBA_OUT_OF_EXTENT ((ULONG)(-1))
+#define LBA_NOT_ALLOCATED ((ULONG)(-2))
typedef struct _EXT_RELOCATION_ENTRY {
uint32 extLength;
Modified: trunk/reactos/drivers/filesystems/udfs/udfinit.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/u…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/udfinit.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/udfinit.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -169,17 +169,9 @@
RegTGetKeyHandle(NULL, UDFGlobalData.SavedRegPath.Buffer, &hUdfRootKey);
- UDFGlobalData.UnicodeStrRoot.Buffer = L"\\";
//(PWCHAR)&(UDFGlobalData.UnicodeStrRootBuffer);
- UDFGlobalData.UnicodeStrRoot.Length = sizeof(WCHAR);
- UDFGlobalData.UnicodeStrRoot.MaximumLength = 2*sizeof(WCHAR);
-
- UDFGlobalData.UnicodeStrSDir.Buffer = L":";
- UDFGlobalData.UnicodeStrSDir.Length = sizeof(WCHAR);
- UDFGlobalData.UnicodeStrSDir.MaximumLength = 2*sizeof(WCHAR);
-
- UDFGlobalData.AclName.Buffer = UDF_SN_NT_ACL;
- UDFGlobalData.AclName.Length =
- (UDFGlobalData.AclName.MaximumLength = sizeof(UDF_SN_NT_ACL)) -
sizeof(WCHAR);
+ RtlInitUnicodeString(&UDFGlobalData.UnicodeStrRoot, L"\\");
+ RtlInitUnicodeString(&UDFGlobalData.UnicodeStrSDir, L":");
+ RtlInitUnicodeString(&UDFGlobalData.AclName, UDF_SN_NT_ACL);
KdPrint(("UDF: Init delayed close queues\n"));
#ifdef UDF_DELAYED_CLOSE
@@ -214,7 +206,7 @@
// create a device object representing the driver itself
// so that requests can be targeted to the driver ...
// e.g. for a disk-based FSD, "mount" requests will be sent to
- // this device object by the I/O Manager.\
+ // this device object by the I/O Manager.
// For a redirector/server, you may have applications
// send "special" IOCTL's using this device object ...
@@ -689,13 +681,13 @@
DbgCompareMemory(&Buffer->FileSystemName[0],name , sizeof(name)) ==
sizeof(name))
if (NT_SUCCESS(RC) &&
- (UDF_CHECK_FS_NAME(UDF_FS_TITLE_CDR) ||
- UDF_CHECK_FS_NAME(UDF_FS_TITLE_CDRW) ||
- UDF_CHECK_FS_NAME(UDF_FS_TITLE_DVDR) ||
- UDF_CHECK_FS_NAME(UDF_FS_TITLE_DVDRW) ||
- UDF_CHECK_FS_NAME(UDF_FS_TITLE_DVDpR) ||
- UDF_CHECK_FS_NAME(UDF_FS_TITLE_DVDpRW) ||
- UDF_CHECK_FS_NAME(UDF_FS_TITLE_DVDRAM) )) try_return(STATUS_SUCCESS);
+ (UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_CDR) ||
+ UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_CDRW) ||
+ UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_DVDR) ||
+ UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_DVDRW) ||
+ UDF_CHECK_FS_NAME((PVOID)UDF_FS_TITLE_DVDpR) ||
+ 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"));
RC = ZwFsControlFile(NtFileHandle,
@@ -874,6 +866,7 @@
UNICODE_STRING unicodeCdRomDeviceName;
LARGE_INTEGER delay;
+*/
/* delay.QuadPart = -80*10000000;
KeDelayExecutionThread(KernelMode, FALSE, &delay); //10 seconds*/
Modified: trunk/reactos/drivers/filesystems/udfs/volinfo.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/v…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/volinfo.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/volinfo.cpp [iso-8859-1] Tue Jun 9 10:40:26
2015
@@ -493,11 +493,10 @@
ULONG BytesToCopy;
NTSTATUS Status = STATUS_SUCCESS;
- PWCHAR FsTypeTitle;
+ PCWSTR FsTypeTitle;
ULONG FsTypeTitleLen;
PAGED_CODE();
-
KdPrint((" UDFQueryFsAttributeInfo: \n"));
// Fill out the fixed portion of the buffer.
Buffer->FileSystemAttributes = FILE_CASE_SENSITIVE_SEARCH |