ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
April 2019
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
32 participants
240 discussions
Start a n
N
ew thread
[reactos] 01/01: [WIN32SS][FONT] Fix font coordinate conversion CORE-15907 (#1452)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=635534005b8754ef7ad0c…
commit 635534005b8754ef7ad0c9b20b6295a362461cf6 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Apr 2 22:39:26 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Apr 2 22:39:26 2019 +0900 [WIN32SS][FONT] Fix font coordinate conversion CORE-15907 (#1452) [WIN32SS][FONT] Fix font bounding box mapping for viewport CORE-15907 --- win32ss/gdi/ntgdi/freetype.c | 45 ++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 5f9b2213ea..7e5307a716 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -5880,28 +5880,41 @@ IntExtTextOutW( // invert y axis IntEscapeMatrix(&matEscape, -lfEscapement); + matWorld.yx = -matWorld.yx; + matWorld.xy = -matWorld.xy; + // convert vecs for (i = 0; i < 9; ++i) { - POINT pt; FT_Vector_Transform(&vecs[i], &matWidth); FT_Vector_Transform(&vecs[i], &matEscape); - vecs[i].x += (Start.x << 16) + (XStart64 << 10); - vecs[i].y += (Start.y << 16) + (YStart64 << 10); - pt.x = vecs[i].x >> 16; - pt.y = vecs[i].y >> 16; + FT_Vector_Transform(&vecs[i], &matWorld); + } + vecs[2].x += DeltaX64 << 10; + vecs[2].y += DeltaY64 << 10; // upper right + vecs[3].x += DeltaX64 << 10; + vecs[3].y += DeltaY64 << 10; // lower right + vecs[6].x += DeltaX64 << 10; + vecs[6].y += DeltaY64 << 10; // underline right + vecs[8].x += DeltaX64 << 10; + vecs[8].y += DeltaY64 << 10; // strike through right + + { + POINT pt; + pt.x = Start.x + (XStart64 >> 6); + pt.y = Start.y + (YStart64 >> 6); IntLPtoDP(dc, &pt, 1); - vecs[i].x = pt.x + dc->ptlDCOrig.x; - vecs[i].y = pt.y + dc->ptlDCOrig.y; - } - vecs[2].x += DeltaX64 >> 6; - vecs[2].y += DeltaY64 >> 6; // upper right - vecs[3].x += DeltaX64 >> 6; - vecs[3].y += DeltaY64 >> 6; // lower right - vecs[6].x += DeltaX64 >> 6; - vecs[6].y += DeltaY64 >> 6; // underline right - vecs[8].x += DeltaX64 >> 6; - vecs[8].y += DeltaY64 >> 6; // strike through right + + for (i = 0; i < 9; ++i) + { + vecs[i].x += pt.x << 16; + vecs[i].y += pt.y << 16; + vecs[i].x >>= 16; + vecs[i].y >>= 16; + vecs[i].x += dc->ptlDCOrig.x; + vecs[i].y += dc->ptlDCOrig.y; + } + } if (fuOptions & ETO_OPAQUE) {
5 years, 8 months
1
0
0
0
[reactos] 01/01: [UDFS] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c334c17d69b21c517979a…
commit c334c17d69b21c517979a79220acfce20152d2d3 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Mon Aug 20 19:02:00 2018 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Tue Apr 2 10:53:23 2019 +0200 [UDFS] Fix 64 bit issues --- drivers/filesystems/udfs/Include/Sys_spec_lib.cpp | 2 +- drivers/filesystems/udfs/Include/phys_lib.cpp | 90 +++++++++++------------ drivers/filesystems/udfs/Include/phys_lib.h | 34 ++++----- drivers/filesystems/udfs/Include/wcache_lib.cpp | 38 +++++----- drivers/filesystems/udfs/Include/wcache_lib.h | 22 +++--- drivers/filesystems/udfs/close.cpp | 2 +- drivers/filesystems/udfs/create.cpp | 2 +- drivers/filesystems/udfs/env_spec.cpp | 12 +-- drivers/filesystems/udfs/env_spec.h | 16 ++-- drivers/filesystems/udfs/fastio.cpp | 4 +- drivers/filesystems/udfs/fileinfo.cpp | 2 +- drivers/filesystems/udfs/fscntrl.cpp | 4 +- drivers/filesystems/udfs/protos.h | 2 +- drivers/filesystems/udfs/read.cpp | 8 +- drivers/filesystems/udfs/udf_info/alloc.cpp | 30 ++++---- drivers/filesystems/udfs/udf_info/dirtree.cpp | 6 +- drivers/filesystems/udfs/udf_info/extent.cpp | 71 ++++++++++-------- drivers/filesystems/udfs/udf_info/mount.cpp | 34 ++++----- drivers/filesystems/udfs/udf_info/remap.cpp | 8 +- drivers/filesystems/udfs/udf_info/udf_info.cpp | 62 ++++++++-------- drivers/filesystems/udfs/udf_info/udf_info.h | 40 +++++----- drivers/filesystems/udfs/udf_info/udf_rel.h | 2 +- drivers/filesystems/udfs/write.cpp | 12 +-- 23 files changed, 257 insertions(+), 246 deletions(-) diff --git a/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp b/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp index d775e86bd2..0c21ff9389 100644 --- a/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp +++ b/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp @@ -245,7 +245,7 @@ UDFFileDirInfoToNT( UDFPrint(("@=%#x, FileDirNdx %x\n", &Vcb, FileDirNdx)); - ASSERT((ULONG)NTFileInfo > 0x1000); + ASSERT((ULONG_PTR)NTFileInfo > 0x1000); RtlZeroMemory(NTFileInfo, sizeof(FILE_BOTH_DIR_INFORMATION)); DosName.Buffer = (PWCHAR)&(NTFileInfo->ShortName); diff --git a/drivers/filesystems/udfs/Include/phys_lib.cpp b/drivers/filesystems/udfs/Include/phys_lib.cpp index dbe411dd0f..5ee90d384f 100644 --- a/drivers/filesystems/udfs/Include/phys_lib.cpp +++ b/drivers/filesystems/udfs/Include/phys_lib.cpp @@ -94,20 +94,20 @@ __fastcall UDFTIOVerify( IN void* _Vcb, IN void* Buffer, // Target buffer - IN uint32 Length, + IN SIZE_T Length, IN uint32 LBA, - OUT uint32* IOBytes, + OUT PSIZE_T IOBytes, IN uint32 Flags ) { OSSTATUS RC = STATUS_SUCCESS; uint32 i, j; - uint32 mask; + SIZE_T mask; uint32 lba0, len, lba1; PUCHAR tmp_buff; PUCHAR p; PCHAR cached_block; - uint32 tmp_wb; + SIZE_T tmp_wb; BOOLEAN need_remap; OSSTATUS final_RC = STATUS_SUCCESS; BOOLEAN zero; @@ -127,7 +127,7 @@ UDFTIOVerify( UDFAcquireResourceExclusive(&(Vcb->IoResource), TRUE); Flags |= PH_IO_LOCKED; - tmp_wb = (uint32)_Vcb; + tmp_wb = (SIZE_T)_Vcb; if(Flags & PH_EX_WRITE) { UDFPrint(("IO-Write-Verify\n")); RC = UDFTWrite(_Vcb, Buffer, Length, LBA, &tmp_wb, Flags | PH_VCB_IN_RETLEN); @@ -248,7 +248,7 @@ UDFTIOVerify( packet_ok = FALSE; if(!single_packet) { // try to read entire packet, this returs error more often then sequential reading of all blocks one by one - tmp_wb = (uint32)_Vcb; + tmp_wb = (SIZE_T)_Vcb; RC = UDFTRead(_Vcb, p, Vcb->SparingBlockSize << Vcb->BlockSizeBits, lba0+i, &tmp_wb, Flags | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER | PH_VCB_IN_RETLEN); } else { @@ -271,7 +271,7 @@ UDFTIOVerify( // even if block is cached, we have to verify if it is readable if(!packet_ok && !UDFVIsStored(Vcb, lba0+i)) { - tmp_wb = (uint32)_Vcb; + tmp_wb = (SIZE_T)_Vcb; RC = UDFTRead(_Vcb, p, Vcb->BlockSize, lba0+i, &tmp_wb, Flags | PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER | PH_VCB_IN_RETLEN); if(!OS_SUCCESS(RC)) { @@ -297,7 +297,7 @@ UDFTIOVerify( } else { if(!UDFVIsStored(Vcb, lba0+i)) { - tmp_wb = (uint32)_Vcb; + tmp_wb = (SIZE_T)_Vcb; RC = UDFTRead(_Vcb, p, Vcb->BlockSize, lba0+i, &tmp_wb, Flags | PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER | PH_VCB_IN_RETLEN); } else { @@ -363,7 +363,7 @@ do_remap: UDFPrint((" remap status %x\n", RC)); if(OS_SUCCESS(RC)) { // write to remapped area - tmp_wb = (uint32)_Vcb; + tmp_wb = (SIZE_T)_Vcb; RC = UDFTWrite(_Vcb, tmp_buff, Vcb->SparingBlockSize << Vcb->BlockSizeBits, lba1, &tmp_wb, Flags | PH_FORGET_VERIFIED | PH_READ_VERIFY_CACHE | PH_TMP_BUFFER | PH_VCB_IN_RETLEN); UDFPrint((" write status %x\n", RC)); @@ -397,7 +397,7 @@ do_remap: DbgFreePool(tmp_buff); } - tmp_wb = (uint32)_Vcb; + tmp_wb = (SIZE_T)_Vcb; if(Flags & PH_EX_WRITE) { UDFPrint(("IO-Write-Verify (2)\n")); //RC = UDFTWrite(_Vcb, Buffer, Length, LBA, &tmp_wb, Flags | PH_FORGET_VERIFIED | PH_VCB_IN_RETLEN); @@ -420,9 +420,9 @@ OSSTATUS UDFTWriteVerify( IN void* _Vcb, IN void* Buffer, // Target buffer - IN uint32 Length, + IN SIZE_T Length, IN uint32 LBA, - OUT uint32* WrittenBytes, + OUT PSIZE_T WrittenBytes, IN uint32 Flags ) { @@ -433,9 +433,9 @@ OSSTATUS UDFTReadVerify( IN void* _Vcb, IN void* Buffer, // Target buffer - IN uint32 Length, + IN SIZE_T Length, IN uint32 LBA, - OUT uint32* ReadBytes, + OUT PSIZE_T ReadBytes, IN uint32 Flags ) { @@ -453,9 +453,9 @@ OSSTATUS UDFTWrite( IN void* _Vcb, IN void* Buffer, // Target buffer - IN uint32 Length, + IN SIZE_T Length, IN uint32 LBA, - OUT uint32* WrittenBytes, + OUT PSIZE_T WrittenBytes, IN uint32 Flags ) { @@ -526,7 +526,7 @@ retry_1: try_return(RC); } if(Flags & PH_VCB_IN_RETLEN) { - (*WrittenBytes) = (ULONG)Vcb; + (*WrittenBytes) = (ULONG_PTR)Vcb; } RC = UDFPhWriteVerifySynchronous(Vcb->TargetDeviceObject, Buffer, Length, ((uint64)rLba) << Vcb->BlockSizeBits, WrittenBytes, Flags); @@ -543,7 +543,7 @@ retry_1: // write according to relocation table RelocExtent_saved = RelocExtent; for(i=0; RelocExtent->extLength; i++, RelocExtent++) { - uint32 _WrittenBytes; + SIZE_T _WrittenBytes; rLba = RelocExtent->extLocation; BCount = RelocExtent->extLength>>Vcb->BlockSizeBits; retry = UDF_WRITE_MAX_RETRY; @@ -554,7 +554,7 @@ retry_2: break; } if(Flags & PH_VCB_IN_RETLEN) { - _WrittenBytes = (ULONG)Vcb; + _WrittenBytes = (ULONG_PTR)Vcb; } RC = UDFPhWriteVerifySynchronous(Vcb->TargetDeviceObject, Buffer, RelocExtent->extLength, ((uint64)rLba) << Vcb->BlockSizeBits, &_WrittenBytes, Flags); @@ -596,9 +596,9 @@ OSSTATUS UDFTRead( IN void* _Vcb, IN void* Buffer, // Target buffer - IN uint32 Length, + IN SIZE_T Length, IN uint32 LBA, - OUT uint32* ReadBytes, + OUT PSIZE_T ReadBytes, IN uint32 Flags ) { @@ -651,7 +651,7 @@ retry_1: if(!OS_SUCCESS(RC)) return RC; // this is for !_BROWSE_UDF only #endif //_BROWSE_UDF_ if(Flags & PH_VCB_IN_RETLEN) { - (*ReadBytes) = (ULONG)Vcb; + (*ReadBytes) = (SIZE_T)Vcb; } RC = UDFPhReadSynchronous(Vcb->TargetDeviceObject, Buffer, Length, ((uint64)rLba) << Vcb->BlockSizeBits, ReadBytes, Flags); @@ -674,7 +674,7 @@ retry_1: // read according to relocation table RelocExtent_saved = RelocExtent; for(i=0; RelocExtent->extLength; i++, RelocExtent++) { - uint32 _ReadBytes; + SIZE_T _ReadBytes; rLba = RelocExtent->extLocation; if(rLba >= (Vcb->CDR_Mode ? Vcb->NWA : Vcb->LastLBA + 1)) { RtlZeroMemory(Buffer, _ReadBytes = RelocExtent->extLength); @@ -688,7 +688,7 @@ retry_2: if(!OS_SUCCESS(RC)) break; rLba = UDFFixFPAddress(Vcb, rLba); if(Flags & PH_VCB_IN_RETLEN) { - _ReadBytes = (ULONG)Vcb; + _ReadBytes = (SIZE_T)Vcb; } RC = UDFPhReadSynchronous(Vcb->TargetDeviceObject, Buffer, RelocExtent->extLength, ((uint64)rLba) << Vcb->BlockSizeBits, &_ReadBytes, Flags); @@ -731,9 +731,9 @@ UDFTReadAsync( IN void* _Vcb, IN void* _WContext, IN void* Buffer, // Target buffer - IN uint32 Length, + IN SIZE_T Length, IN uint32 LBA, - OUT uint32* ReadBytes + OUT PSIZE_T ReadBytes ) { PEXTENT_MAP RelocExtent; @@ -774,7 +774,7 @@ retry_1: // read according to relocation table RelocExtent_saved = RelocExtent; for(uint32 i=0; RelocExtent->extLength; i++, RelocExtent++) { - uint32 _ReadBytes; + SIZE_T _ReadBytes; rLba = RelocExtent->extLocation; if(rLba >= (Vcb->CDR_Mode ? Vcb->NWA : Vcb->LastLBA + 1)) { RtlZeroMemory(Buffer, _ReadBytes = RelocExtent->extLength); @@ -1157,7 +1157,7 @@ check_dvd_bg_format: && (Lba > Vcb->LastLBA)) { ULONG fLba; - ULONG WrittenBytes; + SIZE_T WrittenBytes; ULONG PSz = BCount << Vcb->BlockSizeBits; #ifdef _BROWSE_UDF_ ULONG retry; @@ -2151,7 +2151,7 @@ MRWRetry_label: } else if(Vcb->MRWStatus) { uint8* buff; - uint32 ReadBytes; + SIZE_T ReadBytes; UDFPrint((" MRW state %x\n", Vcb->MRWStatus)); @@ -2397,7 +2397,7 @@ UDFUseStandard( #ifdef _BROWSE_UDF_ uint32 OldTrkNum; uint32 TrkNum; - uint32 ReadBytes, i, len; + SIZE_T ReadBytes, i, len; #endif //_BROWSE_UDF_ #ifdef UDF_FORMAT_MEDIA PUDFFmtState fms = Vcb->fms; @@ -2879,7 +2879,7 @@ UDFCheckTrackFPAddressing( uint32 lba=0; uint32 i; uint8* Buffer; -// uint32 ReadBytes; +// SIZE_T ReadBytes; uint8 user_data; @@ -3682,7 +3682,7 @@ UDFPrepareForReadOperation( #ifdef _BROWSE_UDF_ PUCHAR tmp; OSSTATUS RC; - ULONG ReadBytes; + SIZE_T ReadBytes; #endif //_BROWSE_UDF_ #ifdef _UDF_STRUCTURES_H_ @@ -3887,7 +3887,7 @@ UDFReadSectors( IN uint32 Lba, IN uint32 BCount, OUT int8* Buffer, - OUT uint32* ReadBytes + OUT PSIZE_T ReadBytes ) { @@ -3911,12 +3911,12 @@ UDFReadInSector( IN uint32 l, // transfer length IN BOOLEAN Direct, // Disable access to non-cached data OUT int8* Buffer, - OUT uint32* ReadBytes + OUT PSIZE_T ReadBytes ) { int8* tmp_buff; OSSTATUS status; - uint32 _ReadBytes; + SIZE_T _ReadBytes; (*ReadBytes) = 0; if(WCacheIsInitialized__(&(Vcb->FastCache)) && (KeGetCurrentIrql() < DISPATCH_LEVEL)) { @@ -3953,13 +3953,13 @@ UDFReadData( IN uint32 Length, IN BOOLEAN Direct, // Disable access to non-cached data OUT int8* Buffer, - OUT uint32* ReadBytes + OUT PSIZE_T ReadBytes ) { uint32 i, l, Lba, BS=Vcb->BlockSize; uint32 BSh=Vcb->BlockSizeBits; OSSTATUS status; - uint32 _ReadBytes = 0; + SIZE_T _ReadBytes = 0; Vcb->VCBFlags |= UDF_VCB_SKIP_EJECT_CHECK; uint32 to_read; @@ -4016,7 +4016,7 @@ UDFWriteSectors( IN uint32 BCount, IN BOOLEAN Direct, // Disable access to non-cached data IN int8* Buffer, - OUT uint32* WrittenBytes + OUT PSIZE_T WrittenBytes ) { OSSTATUS status; @@ -4045,7 +4045,7 @@ UDFWriteSectors( } /* void* buffer; OSSTATUS status; - uint32 _ReadBytes; + SIZE_T _ReadBytes; (*WrittenBytes) = 0; buffer = DbgAllocatePool(NonPagedPool, Vcb->WriteBlockSize); if(!buffer) return STATUS_INSUFFICIENT_RESOURCES; @@ -4068,14 +4068,14 @@ UDFWriteInSector( IN uint32 l, // transfer length IN BOOLEAN Direct, // Disable access to non-cached data OUT int8* Buffer, - OUT uint32* WrittenBytes + OUT PSIZE_T WrittenBytes ) { int8* tmp_buff; OSSTATUS status; #ifdef _BROWSE_UDF_ - uint32 _WrittenBytes; - uint32 ReadBytes; + SIZE_T _WrittenBytes; + SIZE_T ReadBytes; if(!Vcb->Modified) { UDFSetModified(Vcb); @@ -4142,17 +4142,17 @@ UDFWriteData( IN PVCB Vcb, IN BOOLEAN Translate, // Translate Logical to Physical IN int64 Offset, - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, // setting this flag delays flushing of given // data to indefinite term IN int8* Buffer, - OUT uint32* WrittenBytes + OUT PSIZE_T WrittenBytes ) { uint32 i, l, Lba, BS=Vcb->BlockSize; uint32 BSh=Vcb->BlockSizeBits; OSSTATUS status; - uint32 _WrittenBytes; + SIZE_T _WrittenBytes; Vcb->VCBFlags |= UDF_VCB_SKIP_EJECT_CHECK; (*WrittenBytes) = 0; diff --git a/drivers/filesystems/udfs/Include/phys_lib.h b/drivers/filesystems/udfs/Include/phys_lib.h index 1ec4fe36ed..1287c4bab2 100644 --- a/drivers/filesystems/udfs/Include/phys_lib.h +++ b/drivers/filesystems/udfs/Include/phys_lib.h @@ -22,9 +22,9 @@ __fastcall UDFTIOVerify( IN void* _Vcb, IN void* Buffer, // Target buffer - IN uint32 Length, + IN SIZE_T Length, IN uint32 LBA, - OUT uint32* IOBytes, + OUT PSIZE_T IOBytes, IN uint32 Flags ); @@ -32,9 +32,9 @@ extern OSSTATUS UDFTWriteVerify( IN void* _Vcb, IN void* Buffer, // Target buffer - IN uint32 Length, + IN SIZE_T Length, IN uint32 LBA, - OUT uint32* WrittenBytes, + OUT PSIZE_T WrittenBytes, IN uint32 Flags ); @@ -42,24 +42,24 @@ extern OSSTATUS UDFTReadVerify( IN void* _Vcb, IN void* Buffer, // Target buffer - IN uint32 Length, + IN SIZE_T Length, IN uint32 LBA, - OUT uint32* ReadBytes, + OUT PSIZE_T ReadBytes, IN uint32 Flags ); extern OSSTATUS UDFTRead(PVOID _Vcb, PVOID Buffer, // Target buffer - ULONG Length, + SIZE_T Length, ULONG LBA, - PULONG ReadBytes, + PSIZE_T ReadBytes, ULONG Flags = 0); extern OSSTATUS UDFTWrite(IN PVOID _Vcb, IN PVOID Buffer, // Target buffer - IN ULONG Length, + IN SIZE_T Length, IN ULONG LBA, - OUT PULONG WrittenBytes, + OUT PSIZE_T WrittenBytes, IN ULONG Flags = 0); #define PH_TMP_BUFFER 1 @@ -126,7 +126,7 @@ extern OSSTATUS UDFDoDismountSequence(IN PVCB Vcb, #define UDFReadSectors(Vcb, Translate, Lba, BCount, Direct, Buffer, ReadBytes) \ (( WCacheIsInitialized__(&((Vcb)->FastCache)) && (KeGetCurrentIrql() < DISPATCH_LEVEL)) ? \ (WCacheReadBlocks__(&((Vcb)->FastCache), Vcb, Buffer, Lba, BCount, ReadBytes, Direct)) : \ - (UDFTRead(Vcb, Buffer, (BCount)<<((Vcb)->BlockSizeBits), Lba, ReadBytes, 0))) + (UDFTRead(Vcb, Buffer, ((SIZE_T)(BCount))<<((Vcb)->BlockSizeBits), Lba, ReadBytes, 0))) // read data inside physical sector @@ -137,7 +137,7 @@ extern OSSTATUS UDFReadInSector(IN PVCB Vcb, IN ULONG l, // transfer length IN BOOLEAN Direct, OUT PCHAR Buffer, - OUT PULONG ReadBytes); + OUT PSIZE_T ReadBytes); // read unaligned data extern OSSTATUS UDFReadData(IN PVCB Vcb, IN BOOLEAN Translate, // Translate Logical to Physical @@ -145,7 +145,7 @@ extern OSSTATUS UDFReadData(IN PVCB Vcb, IN ULONG Length, IN BOOLEAN Direct, OUT PCHAR Buffer, - OUT PULONG ReadBytes); + OUT PSIZE_T ReadBytes); #ifndef UDF_READ_ONLY_BUILD // write physical sectors @@ -156,7 +156,7 @@ OSSTATUS UDFWriteSectors(IN PVCB Vcb, IN BOOLEAN Direct, // setting this flag delays flushing of given // data to indefinite term IN PCHAR Buffer, - OUT PULONG WrittenBytes); + OUT PSIZE_T WrittenBytes); // write directly to cached sector OSSTATUS UDFWriteInSector(IN PVCB Vcb, IN BOOLEAN Translate, // Translate Logical to Physical @@ -165,16 +165,16 @@ OSSTATUS UDFWriteInSector(IN PVCB Vcb, IN ULONG l, // transfer length IN BOOLEAN Direct, OUT PCHAR Buffer, - OUT PULONG WrittenBytes); + OUT PSIZE_T WrittenBytes); // write data at unaligned offset & length OSSTATUS UDFWriteData(IN PVCB Vcb, IN BOOLEAN Translate, // Translate Logical to Physical IN LONGLONG Offset, - IN ULONG Length, + IN SIZE_T Length, IN BOOLEAN Direct, // setting this flag delays flushing of given // data to indefinite term IN PCHAR Buffer, - OUT PULONG WrittenBytes); + OUT PSIZE_T WrittenBytes); #endif //UDF_READ_ONLY_BUILD OSSTATUS UDFResetDeviceDriver(IN PVCB Vcb, diff --git a/drivers/filesystems/udfs/Include/wcache_lib.cpp b/drivers/filesystems/udfs/Include/wcache_lib.cpp index e23ae295de..d0e15b79c7 100644 --- a/drivers/filesystems/udfs/Include/wcache_lib.cpp +++ b/drivers/filesystems/udfs/Include/wcache_lib.cpp @@ -70,7 +70,7 @@ typedef struct _W_CACHE_ASYNC { PW_CACHE Cache; PVOID Buffer; PVOID Buffer2; - ULONG TransferredBytes; + SIZE_T TransferredBytes; ULONG BCount; lba_t Lba; struct _W_CACHE_ASYNC* NextWContext; @@ -119,7 +119,7 @@ WCacheInit__( // simultaneously IN ULONG MaxBlocks, // maximum number of Blocks to be kept in memory // simultaneously - IN ULONG MaxBytesToRead, // maximum IO length (split boundary) + IN SIZE_T MaxBytesToRead, // maximum IO length (split boundary) IN ULONG PacketSizeSh, // number of blocks in packet (bit shift) // Packes size = 2^PacketSizeSh IN ULONG BlockSizeSh, // Block size (bit shift) @@ -756,7 +756,7 @@ WCacheInitFrame( //Cache->FrameList[frame].AccessCount = 0; if(block_array) { - ASSERT((ULONG)block_array > 0x1000); + ASSERT((ULONG_PTR)block_array > 0x1000); WCacheInsertItemToList(Cache->CachedFramesList, &(Cache->FrameCount), frame); RtlZeroMemory(block_array, l); } else { @@ -862,7 +862,7 @@ WCacheRemoveFrame( Internal routine */ #define WCacheSectorAddr(block_array, i) \ - ((ULONG)(block_array[i].Sector) & WCACHE_ADDR_MASK) + ((ULONG_PTR)(block_array[i].Sector) & WCACHE_ADDR_MASK) /* WCacheFreeSector() releases memory block containing cached @@ -996,7 +996,7 @@ WCacheUpdatePacket( IN ULONG BS, // Block size (bytes) IN ULONG PS, // Packet size (bytes) IN ULONG PSs, // Packet size (sectors) - IN PULONG ReadBytes, // pointer to number of successfully read/written bytes + IN PSIZE_T ReadBytes, // pointer to number of successfully read/written bytes IN BOOLEAN PrefereWrite, // allow physical write (flush) of modified packet IN ULONG State // callers state ) @@ -1379,7 +1379,7 @@ WCacheCheckLimitsRW( ULONG try_count = 0; PW_CACHE_ENTRY block_array; OSSTATUS status; - ULONG ReadBytes; + SIZE_T ReadBytes; ULONG FreeFrameCount = 0; // PVOID addr; PW_CACHE_ASYNC FirstWContext = NULL; @@ -1553,7 +1553,7 @@ WCacheFlushBlocksRAM( ULONG BS = Cache->BlockSize; // ULONG PS = BS << Cache->PacketSizeSh; // packet size (bytes) ULONG PSs = Cache->PacketSize; - ULONG _WrittenBytes; + SIZE_T _WrittenBytes; OSSTATUS status = STATUS_SUCCESS; frame = List[firstPos] >> Cache->BlocksPerFrameSh; @@ -1864,7 +1864,7 @@ WCachePreReadPacket__( ULONG BSh = Cache->BlockSizeSh; ULONG BS = Cache->BlockSize; PCHAR addr; - ULONG _ReadBytes; + SIZE_T _ReadBytes; ULONG PS = Cache->PacketSize; // (in blocks) ULONG BCount = PS; ULONG i, n, err_count; @@ -2014,7 +2014,7 @@ WCacheReadBlocks__( IN PCHAR Buffer, // user-supplied buffer for read blocks IN lba_t Lba, // LBA to start read from IN ULONG BCount, // number of blocks to be read - OUT PULONG ReadBytes, // user-supplied pointer to ULONG that will + OUT PSIZE_T ReadBytes, // user-supplied pointer to ULONG that will // recieve number of actually read bytes IN BOOLEAN CachedOnly // specifies that cache is already locked ) @@ -2024,11 +2024,11 @@ WCacheReadBlocks__( OSSTATUS status = STATUS_SUCCESS; PW_CACHE_ENTRY block_array; ULONG BSh = Cache->BlockSizeSh; - ULONG BS = Cache->BlockSize; + SIZE_T BS = Cache->BlockSize; PCHAR addr; ULONG to_read, saved_to_read; // PCHAR saved_buff = Buffer; - ULONG _ReadBytes; + SIZE_T _ReadBytes; ULONG PS = Cache->PacketSize; ULONG MaxR = Cache->MaxBytesToRead; ULONG PacketMask = PS-1; // here we assume that Packet Size value is 2^n @@ -2283,7 +2283,7 @@ WCacheWriteBlocks__( IN PCHAR Buffer, // user-supplied buffer containing data to be written IN lba_t Lba, // LBA to start write from IN ULONG BCount, // number of blocks to be written - OUT PULONG WrittenBytes, // user-supplied pointer to ULONG that will + OUT PSIZE_T WrittenBytes, // user-supplied pointer to ULONG that will // recieve number of actually written bytes IN BOOLEAN CachedOnly // specifies that cache is already locked ) @@ -2296,7 +2296,7 @@ WCacheWriteBlocks__( ULONG BS = Cache->BlockSize; PCHAR addr; // PCHAR saved_buff = Buffer; - ULONG _WrittenBytes; + SIZE_T _WrittenBytes; ULONG PS = Cache->PacketSize; ULONG PacketMask = PS-1; // here we assume that Packet Size value is 2^n ULONG block_type; @@ -2634,7 +2634,7 @@ WCachePurgeAllRW( ULONG PSs = Cache->PacketSize; PW_CACHE_ENTRY block_array; // OSSTATUS status; - ULONG ReadBytes; + SIZE_T ReadBytes; PW_CACHE_ASYNC FirstWContext = NULL; PW_CACHE_ASYNC PrevWContext = NULL; ULONG chain_count = 0; @@ -2702,7 +2702,7 @@ WCacheFlushAllRW( ULONG BFs = Cache->BlocksPerFrameSh; PW_CACHE_ENTRY block_array; // OSSTATUS status; - ULONG ReadBytes; + SIZE_T ReadBytes; PW_CACHE_ASYNC FirstWContext = NULL; PW_CACHE_ASYNC PrevWContext = NULL; ULONG i; @@ -2841,7 +2841,7 @@ WCacheFlushBlocksRW( ULONG BFs = Cache->BlocksPerFrameSh; PW_CACHE_ENTRY block_array; // OSSTATUS status; - ULONG ReadBytes; + SIZE_T ReadBytes; PW_CACHE_ASYNC FirstWContext = NULL; PW_CACHE_ASYNC PrevWContext = NULL; ULONG i; @@ -2960,7 +2960,7 @@ WCacheDirect__( PW_CACHE_ENTRY block_array; ULONG BS = Cache->BlockSize; PCHAR addr; - ULONG _ReadBytes; + SIZE_T _ReadBytes; ULONG block_type; WcPrint(("WC:%sD %x (1)\n", Modified ? "W" : "R", Lba)); @@ -3206,7 +3206,7 @@ WCacheCheckLimitsR( PW_CACHE_ENTRY block_array; BOOLEAN mod; OSSTATUS status; - ULONG ReadBytes; + SIZE_T ReadBytes; ULONG MaxReloc = Cache->PacketSize; PULONG reloc_tab = Cache->reloc_tab; @@ -3324,7 +3324,7 @@ WCachePurgeAllR( PW_CACHE_ENTRY block_array; BOOLEAN mod; OSSTATUS status; - ULONG ReadBytes; + SIZE_T ReadBytes; ULONG MaxReloc = Cache->PacketSize; PULONG reloc_tab = Cache->reloc_tab; ULONG RelocCount = 0; diff --git a/drivers/filesystems/udfs/Include/wcache_lib.h b/drivers/filesystems/udfs/Include/wcache_lib.h index f1eddae0c6..cc5a2a3c88 100644 --- a/drivers/filesystems/udfs/Include/wcache_lib.h +++ b/drivers/filesystems/udfs/Include/wcache_lib.h @@ -21,32 +21,32 @@ extern "C" { typedef OSSTATUS (*PWRITE_BLOCK) (IN PVOID Context, IN PVOID Buffer, // Target buffer - IN ULONG Length, + IN SIZE_T Length, IN lba_t Lba, - OUT PULONG WrittenBytes, + OUT PSIZE_T WrittenBytes, IN uint32 Flags); typedef OSSTATUS (*PREAD_BLOCK) (IN PVOID Context, IN PVOID Buffer, // Target buffer - IN ULONG Length, + IN SIZE_T Length, IN lba_t Lba, - OUT PULONG ReadBytes, + OUT PSIZE_T ReadBytes, IN uint32 Flags); typedef OSSTATUS (*PWRITE_BLOCK_ASYNC) (IN PVOID Context, IN PVOID WContext, IN PVOID Buffer, // Target buffer - IN ULONG Length, + IN SIZE_T Length, IN lba_t Lba, - OUT PULONG WrittenBytes, + OUT PSIZE_T WrittenBytes, IN BOOLEAN FreeBuffer); typedef OSSTATUS (*PREAD_BLOCK_ASYNC) (IN PVOID Context, IN PVOID WContext, IN PVOID Buffer, // Source buffer - IN ULONG Length, + IN SIZE_T Length, IN lba_t Lba, - OUT PULONG ReadBytes); + OUT PSIZE_T ReadBytes); /*typedef BOOLEAN (*PCHECK_BLOCK) (IN PVOID Context, IN lba_t Lba);*/ @@ -208,7 +208,7 @@ typedef struct _W_CACHE { OSSTATUS WCacheInit__(IN PW_CACHE Cache, IN ULONG MaxFrames, IN ULONG MaxBlocks, - IN ULONG MaxBytesToRead, + IN SIZE_T MaxBytesToRead, IN ULONG PacketSizeSh, // number of blocks in packet (bit shift) IN ULONG BlockSizeSh, // bit shift IN ULONG BlocksPerFrameSh,// bit shift @@ -230,7 +230,7 @@ OSSTATUS WCacheWriteBlocks__(IN PW_CACHE Cache, IN PCHAR Buffer, IN lba_t Lba, IN ULONG BCount, - OUT PULONG WrittenBytes, + OUT PSIZE_T WrittenBytes, IN BOOLEAN CachedOnly); // read cached OSSTATUS WCacheReadBlocks__(IN PW_CACHE Cache, @@ -238,7 +238,7 @@ OSSTATUS WCacheReadBlocks__(IN PW_CACHE Cache, IN PCHAR Buffer, IN lba_t Lba, IN ULONG BCount, - OUT PULONG ReadBytes, + OUT PSIZE_T ReadBytes, IN BOOLEAN CachedOnly); // flush blocks OSSTATUS WCacheFlushBlocks__(IN PW_CACHE Cache, diff --git a/drivers/filesystems/udfs/close.cpp b/drivers/filesystems/udfs/close.cpp index a75954e143..e8e0b620b7 100644 --- a/drivers/filesystems/udfs/close.cpp +++ b/drivers/filesystems/udfs/close.cpp @@ -1007,7 +1007,7 @@ UDFCloseAllXXXDelayedInDir( if(CurFileInfo && (Fcb = CurFileInfo->Fcb)) { NtReqFcb = Fcb->NTRequiredFCB; - ASSERT((ULONG)NtReqFcb > 0x1000); + ASSERT((ULONG_PTR)NtReqFcb > 0x1000); // ASSERT((ULONG)(NtReqFcb->SectionObject) > 0x1000); if(!(NtReqFcb->NtReqFCBFlags & UDF_NTREQ_FCB_DELETED) && (NtReqFcb->NtReqFCBFlags & UDF_NTREQ_FCB_MODIFIED)) { diff --git a/drivers/filesystems/udfs/create.cpp b/drivers/filesystems/udfs/create.cpp index 75f209f4b5..3c777e8f49 100644 --- a/drivers/filesystems/udfs/create.cpp +++ b/drivers/filesystems/udfs/create.cpp @@ -1116,7 +1116,7 @@ op_vol_accs_dnd: // get next path part... TmpBuffer = TailName.Buffer; TailName.Buffer = UDFDissectName(TailName.Buffer,&(CurName.Length) ); - TailName.Length -= (USHORT)((ULONG)(TailName.Buffer) - (ULONG)TmpBuffer); + TailName.Length -= (USHORT)((ULONG_PTR)(TailName.Buffer) - (ULONG_PTR)TmpBuffer); CurName.Buffer = TailName.Buffer - CurName.Length; CurName.Length *= sizeof(WCHAR); CurName.MaximumLength = CurName.Length + sizeof(WCHAR); diff --git a/drivers/filesystems/udfs/env_spec.cpp b/drivers/filesystems/udfs/env_spec.cpp index 3f866080df..9201815aea 100644 --- a/drivers/filesystems/udfs/env_spec.cpp +++ b/drivers/filesystems/udfs/env_spec.cpp @@ -130,9 +130,9 @@ NTAPI UDFPhReadSynchronous( PDEVICE_OBJECT DeviceObject, // the physical device object PVOID Buffer, - ULONG Length, + SIZE_T Length, LONGLONG Offset, - PULONG ReadBytes, + PSIZE_T ReadBytes, ULONG Flags ) { @@ -276,9 +276,9 @@ NTAPI UDFPhWriteSynchronous( PDEVICE_OBJECT DeviceObject, // the physical device object PVOID Buffer, - ULONG Length, + SIZE_T Length, LONGLONG Offset, - PULONG WrittenBytes, + PSIZE_T WrittenBytes, ULONG Flags ) { @@ -422,9 +422,9 @@ NTSTATUS UDFPhWriteVerifySynchronous( PDEVICE_OBJECT DeviceObject, // the physical device object PVOID Buffer, - ULONG Length, + SIZE_T Length, LONGLONG Offset, - PULONG WrittenBytes, + PSIZE_T WrittenBytes, ULONG Flags ) { diff --git a/drivers/filesystems/udfs/env_spec.h b/drivers/filesystems/udfs/env_spec.h index 9ac343a639..203809eb6f 100644 --- a/drivers/filesystems/udfs/env_spec.h +++ b/drivers/filesystems/udfs/env_spec.h @@ -22,25 +22,25 @@ extern NTSTATUS NTAPI UDFPhReadSynchronous( PDEVICE_OBJECT DeviceObject, PVOID Buffer, - ULONG Length, + SIZE_T Length, LONGLONG Offset, - PULONG ReadBytes, + PSIZE_T ReadBytes, ULONG Flags); extern NTSTATUS NTAPI UDFPhWriteSynchronous( PDEVICE_OBJECT DeviceObject, // the physical device object PVOID Buffer, - ULONG Length, + SIZE_T Length, LONGLONG Offset, - PULONG WrittenBytes, + PSIZE_T WrittenBytes, ULONG Flags); /* extern NTSTATUS UDFPhWriteVerifySynchronous( PDEVICE_OBJECT DeviceObject, // the physical device object PVOID Buffer, - ULONG Length, + SIZE_T Length, LONGLONG Offset, - PULONG WrittenBytes, + PSIZE_T WrittenBytes, ULONG Flags); */ #define UDFPhWriteVerifySynchronous UDFPhWriteSynchronous @@ -122,7 +122,7 @@ __inline VOID UDFNotifyFullReportChange( } #define CollectStatisticsEx(VCB, Field, a) { \ - ((VCB)->Statistics[KeGetCurrentProcessorNumber()].Common.##Field) += a; \ + ((VCB)->Statistics[KeGetCurrentProcessorNumber()].Common.##Field) += (ULONG)a; \ } #define CollectStatistics2(VCB, Field) { \ @@ -149,7 +149,7 @@ NTSTATUS NTAPI UDFSyncCompletionRoutine2(IN PDEVICE_OBJECT DeviceObject, #define OSGetCurrentThread() PsGetCurrentThread() -#define GetCurrentPID() ((ULONG)PsGetCurrentProcessId()) +#define GetCurrentPID() HandleToUlong(PsGetCurrentProcessId()) #endif // _UDF_ENV_SPEC_H_ diff --git a/drivers/filesystems/udfs/fastio.cpp b/drivers/filesystems/udfs/fastio.cpp index 66a07dfee7..f7f53b301a 100644 --- a/drivers/filesystems/udfs/fastio.cpp +++ b/drivers/filesystems/udfs/fastio.cpp @@ -440,7 +440,7 @@ BOOLEAN NTAPI UDFAcqLazyWrite( // Now, set the lazy-writer thread id. ASSERT(!(NtReqFcb->LazyWriterThreadID)); - NtReqFcb->LazyWriterThreadID = (unsigned int)(PsGetCurrentThread()); + NtReqFcb->LazyWriterThreadID = HandleToUlong(PsGetCurrentThreadId()); ASSERT(IoGetTopLevelIrp() == NULL); IoSetTopLevelIrp((PIRP)FSRTL_CACHE_TOP_LEVEL_IRP); @@ -481,7 +481,7 @@ UDFRelLazyWrite( // Remove the current thread-id from the NT_REQ_FCB // and release the MainResource. - ASSERT((NtReqFcb->LazyWriterThreadID) == (unsigned int)PsGetCurrentThread()); + ASSERT((NtReqFcb->LazyWriterThreadID) == HandleToUlong(PsGetCurrentThreadId())); NtReqFcb->LazyWriterThreadID = 0; // Release the acquired resource. diff --git a/drivers/filesystems/udfs/fileinfo.cpp b/drivers/filesystems/udfs/fileinfo.cpp index cb87cf42c5..46fadac398 100644 --- a/drivers/filesystems/udfs/fileinfo.cpp +++ b/drivers/filesystems/udfs/fileinfo.cpp @@ -137,7 +137,7 @@ UDFCommonFileInfo( TmPrint(("UDFCommonFileInfo: irp %x\n", Irp)); TopIrp = IoGetTopLevelIrp(); - switch((ULONG)TopIrp) { + switch((ULONG_PTR)TopIrp) { case FSRTL_FSP_TOP_LEVEL_IRP: UDFPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n")); break; diff --git a/drivers/filesystems/udfs/fscntrl.cpp b/drivers/filesystems/udfs/fscntrl.cpp index 2dd3e5d4be..d18ae74e9b 100644 --- a/drivers/filesystems/udfs/fscntrl.cpp +++ b/drivers/filesystems/udfs/fscntrl.cpp @@ -1111,7 +1111,7 @@ unwind_3: if(NT_SUCCESS(RC)) { int8* buff; - uint32 len; + SIZE_T len; PUDF_FILE_INFO CfgFileInfo = NULL; RC = UDFOpenFile__(Vcb, FALSE, TRUE, &LocalPath, RootFcb->FileInfo, &CfgFileInfo, NULL); @@ -1686,7 +1686,7 @@ UDFIsPathnameValid( // get next path part... TmpBuffer = PathName.Buffer; PathName.Buffer = UDFDissectName(PathName.Buffer,&(CurName.Length) ); - PathName.Length -= (USHORT)((ULONG)(PathName.Buffer) - (ULONG)TmpBuffer); + PathName.Length -= (USHORT)((ULONG_PTR)(PathName.Buffer) - (ULONG_PTR)TmpBuffer); CurName.Buffer = PathName.Buffer - CurName.Length; CurName.Length *= sizeof(WCHAR); CurName.MaximumLength -= CurName.Length; diff --git a/drivers/filesystems/udfs/protos.h b/drivers/filesystems/udfs/protos.h index f118b741d6..401b8645fd 100644 --- a/drivers/filesystems/udfs/protos.h +++ b/drivers/filesystems/udfs/protos.h @@ -784,7 +784,7 @@ extern OSSTATUS UDFDoDismountSequence(IN PVCB Vcb, #define UDFReadSectors(Vcb, Translate, Lba, BCount, Direct, Buffer, ReadBytes) \ (( WCacheIsInitialized__(&((Vcb)->FastCache)) && (KeGetCurrentIrql() < DISPATCH_LEVEL)) ? \ (WCacheReadBlocks__(&((Vcb)->FastCache), Vcb, Buffer, Lba, BCount, ReadBytes, Direct)) : \ - (UDFTRead(Vcb, Buffer, (BCount)<<((Vcb)->BlockSizeBits), Lba, ReadBytes, 0))) + (UDFTRead(Vcb, Buffer, ((SIZE_T)(BCount))<<((Vcb)->BlockSizeBits), Lba, ReadBytes, 0))) // read data inside physical sector diff --git a/drivers/filesystems/udfs/read.cpp b/drivers/filesystems/udfs/read.cpp index 5f60bd57b2..088f9f6b62 100644 --- a/drivers/filesystems/udfs/read.cpp +++ b/drivers/filesystems/udfs/read.cpp @@ -235,7 +235,7 @@ UDFCommonRead( PIO_STACK_LOCATION IrpSp = NULL; LARGE_INTEGER ByteOffset; ULONG ReadLength = 0, TruncatedLength = 0; - ULONG NumberBytesRead = 0; + SIZE_T NumberBytesRead = 0; PFILE_OBJECT FileObject = NULL; PtrUDFFCB Fcb = NULL; PtrUDFCCB Ccb = NULL; @@ -262,7 +262,7 @@ UDFCommonRead( _SEH2_TRY { TopIrp = IoGetTopLevelIrp(); - switch((ULONG)TopIrp) { + switch((ULONG_PTR)TopIrp) { case FSRTL_FSP_TOP_LEVEL_IRP: UDFPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n")); break; @@ -684,11 +684,11 @@ UDFCommonRead( MmPrint((" Read NonBufferedIo\n")); #if 1 - if((ULONG)TopIrp == FSRTL_MOD_WRITE_TOP_LEVEL_IRP) { + if((ULONG_PTR)TopIrp == FSRTL_MOD_WRITE_TOP_LEVEL_IRP) { UDFPrint(("FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n")); CanWait = TRUE; } else - if((ULONG)TopIrp == FSRTL_CACHE_TOP_LEVEL_IRP) { + if((ULONG_PTR)TopIrp == FSRTL_CACHE_TOP_LEVEL_IRP) { UDFPrint(("FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n")); CanWait = TRUE; } diff --git a/drivers/filesystems/udfs/udf_info/alloc.cpp b/drivers/filesystems/udfs/udf_info/alloc.cpp index 49905fb61a..a7e9816736 100644 --- a/drivers/filesystems/udfs/udf_info/alloc.cpp +++ b/drivers/filesystems/udfs/udf_info/alloc.cpp @@ -324,12 +324,12 @@ EO_gpl: #if defined (_X86_) && defined (_MSC_VER) __declspec (naked) -uint32 +SIZE_T __stdcall UDFGetBitmapLen( uint32* Bitmap, - uint32 Offs, - uint32 Lim // NOT included + SIZE_T Offs, + SIZE_T Lim // NOT included ) { _asm { @@ -491,12 +491,12 @@ exit_count: #else // NO X86 optimization , use generic C/C++ -uint32 +SIZE_T __stdcall UDFGetBitmapLen( uint32* Bitmap, - uint32 Offs, - uint32 Lim // NOT included + SIZE_T Offs, + SIZE_T Lim // NOT included ) { ASSERT(Offs <= Lim); @@ -505,8 +505,8 @@ UDFGetBitmapLen( } BOOLEAN bit = UDFGetBit(Bitmap, Offs); - uint32 i=Offs>>5; - uint32 len=0; + SIZE_T i=Offs>>5; + SIZE_T len=0; uint8 j=(uint8)(Offs&31); uint8 lLim=(uint8)(Lim&31); @@ -552,7 +552,7 @@ While_3: This routine scans disc free space Bitmap for minimal suitable extent. It returns maximal available extent if no long enough extents found. */ -uint32 +SIZE_T UDFFindMinSuitableExtent( IN PVCB Vcb, IN uint32 Length, // in blocks @@ -562,14 +562,14 @@ UDFFindMinSuitableExtent( IN uint8 AllocFlags ) { - uint32 i, len; + SIZE_T i, len; uint32* cur; - uint32 best_lba=0; - uint32 best_len=0; - uint32 max_lba=0; - uint32 max_len=0; + SIZE_T best_lba=0; + SIZE_T best_len=0; + SIZE_T max_lba=0; + SIZE_T max_len=0; BOOLEAN align = FALSE; - uint32 PS = Vcb->WriteBlockSize >> Vcb->BlockSizeBits; + SIZE_T PS = Vcb->WriteBlockSize >> Vcb->BlockSizeBits; UDF_CHECK_BITMAP_RESOURCE(Vcb); diff --git a/drivers/filesystems/udfs/udf_info/dirtree.cpp b/drivers/filesystems/udfs/udf_info/dirtree.cpp index d20e353966..8f4b3ee26c 100644 --- a/drivers/filesystems/udfs/udf_info/dirtree.cpp +++ b/drivers/filesystems/udfs/udf_info/dirtree.cpp @@ -519,7 +519,7 @@ UDFIndexDirectory( int8* buff; PEXTENT_INFO ExtInfo; // Extent array for directory uint16 PartNum; - uint32 ReadBytes; + SIZE_T ReadBytes; uint16 valueCRC; if(!FileInfo) return STATUS_INVALID_PARAMETER; @@ -753,7 +753,7 @@ UDFPackDirectory__( uint32 Offset, curOffset; int8* Buf; OSSTATUS status; - uint32 ReadBytes; + SIZE_T ReadBytes; int8* storedFI; PUDF_FILE_INFO curFileInfo; PDIR_INDEX_ITEM DirNdx, DirNdx2; @@ -901,7 +901,7 @@ UDFReTagDirectory( uint32 Offset; int8* Buf; OSSTATUS status; - uint32 ReadBytes; + SIZE_T ReadBytes; PUDF_FILE_INFO curFileInfo; PDIR_INDEX_ITEM DirNdx; UDF_DIR_SCAN_CONTEXT ScanContext; diff --git a/drivers/filesystems/udfs/udf_info/extent.cpp b/drivers/filesystems/udfs/udf_info/extent.cpp index f949cf1d52..db4f23fa5b 100644 --- a/drivers/filesystems/udfs/udf_info/extent.cpp +++ b/drivers/filesystems/udfs/udf_info/extent.cpp @@ -30,7 +30,7 @@ UDFExtentOffsetToLba( IN PEXTENT_MAP Extent, // Extent array IN int64 Offset, // offset in extent OUT uint32* SectorOffset, - OUT uint32* AvailLength, // available data in this block + OUT PSIZE_T AvailLength, // available data in this block OUT uint32* Flags, OUT uint32* Index ) @@ -79,7 +79,7 @@ uint32 UDFNextExtentToLba( IN PVCB Vcb, IN PEXTENT_MAP Extent, // Extent array - OUT uint32* AvailLength, // available data in this block + OUT PSIZE_T AvailLength, // available data in this block OUT uint32* Flags, OUT uint32* Index ) @@ -306,7 +306,7 @@ UDFShortAllocDescToMapping( EXTENT_AD AllocExt; PALLOC_EXT_DESC NextAllocDesc; lb_addr locAddr; - uint32 ReadBytes; + SIZE_T ReadBytes; EXTENT_INFO NextAllocLoc; BOOLEAN w2k_compat = FALSE; @@ -467,7 +467,7 @@ UDFLongAllocDescToMapping( PEXTENT_MAP Extent, Extent2, AllocMap; EXTENT_AD AllocExt; PALLOC_EXT_DESC NextAllocDesc; - uint32 ReadBytes; + SIZE_T ReadBytes; EXTENT_INFO NextAllocLoc; ExtPrint(("UDFLongAllocDescToMapping: len=%x\n", AllocDescLength)); @@ -605,7 +605,7 @@ UDFExtAllocDescToMapping( PEXTENT_MAP Extent, Extent2, AllocMap; EXTENT_AD AllocExt; PALLOC_EXT_DESC NextAllocDesc; - uint32 ReadBytes; + SIZE_T ReadBytes; EXTENT_INFO NextAllocLoc; ExtPrint(("UDFExtAllocDescToMapping: len=%x\n", AllocDescLength)); @@ -799,7 +799,7 @@ UDFReadMappingFromXEntry( } default : { // case ICB_FLAG_AD_IN_ICB Extent = NULL; - *Offset = (uint32)AllocDescs - (uint32)XEntry; + *Offset = (uintptr_t)AllocDescs - (uintptr_t)XEntry; AllocLoc->Offset=0; AllocLoc->Length=0; if(AllocLoc->Mapping) MyFreePool__(AllocLoc->Mapping); @@ -1959,8 +1959,8 @@ UDFMarkNotAllocatedAsAllocated( uint32 BSh = Vcb->BlockSizeBits; OSSTATUS status; EXTENT_INFO TmpExtInf; - uint32 aLen, sLen; - uint32 LBS = Vcb->LBlockSize; + SIZE_T aLen, sLen; + SIZE_T LBS = Vcb->LBlockSize; // I don't know what else comment can be added here. // Just belive that it works /*lba = */ @@ -2112,7 +2112,7 @@ UDFMarkAllocatedAsNotXXX( uint32 target_flags = Deallocate ? EXTENT_NOT_RECORDED_NOT_ALLOCATED : EXTENT_NOT_RECORDED_ALLOCATED; - uint32 LBS = Vcb->LBlockSize; + SIZE_T LBS = Vcb->LBlockSize; EXTENT_MAP DeadMapping[2]; // I don't know what else comment can be added here. // Just belive that it works @@ -2237,13 +2237,15 @@ UDFResizeExtent( OUT PEXTENT_INFO ExtInfo ) { - uint32 i, flags, lba, lim; + uint32 i, flags, lba; + SIZE_T lim; int64 l; OSSTATUS status; EXTENT_INFO TmpExtInf; EXTENT_MAP TmpMapping[2]; - uint32 s, req_s, pe, BSh, LBS, PS; - LBS = Vcb->LBlockSize; + uint32 s, pe, BSh, PS; + SIZE_T req_s; + SIZE_T LBS = Vcb->LBlockSize; BSh = Vcb->BlockSizeBits; PS = Vcb->WriteBlockSize >> Vcb->BlockSizeBits; uint32 MaxGrow = (UDF_MAX_EXTENT_LENGTH & ~(LBS-1)); @@ -2920,7 +2922,8 @@ UDFIsExtentCached( { BOOLEAN retstat = FALSE; PEXTENT_MAP Extent = ExtInfo->Mapping; // Extent array - uint32 to_read, Lba, sect_offs, flags, i; + SIZE_T to_read; + uint32 Lba, sect_offs, flags, i; WCacheStartDirect__(&(Vcb->FastCache), Vcb, TRUE/*FALSE*//*ForWrite*/); if(!ExtInfo || !ExtInfo->Mapping) goto EO_IsCached; @@ -2969,14 +2972,15 @@ UDFReadExtentCached( IN int64 Offset, // offset in extent IN uint32 Length, OUT int8* Buffer, - OUT uint32* ReadBytes + OUT PSIZE_T ReadBytes ) { (*ReadBytes) = 0; if(!ExtInfo || !ExtInfo->Mapping) return STATUS_INVALID_PARAMETER; PEXTENT_MAP Extent = ExtInfo->Mapping; // Extent array - uint32 to_read, Lba, sect_offs, flags, _ReadBytes; + uint32 to_read, Lba, sect_offs, flags; + SIZE_T _ReadBytes; OSSTATUS status; // prevent reading out of data space if(Offset > ExtInfo->Length) return STATUS_END_OF_FILE; @@ -3015,27 +3019,30 @@ UDFReadExtent( IN PVCB Vcb, IN PEXTENT_INFO ExtInfo, // Extent array IN int64 Offset, // offset in extent - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, OUT int8* Buffer, - OUT uint32* ReadBytes + OUT PSIZE_T ReadBytes ) { (*ReadBytes) = 0; if(!ExtInfo || !ExtInfo->Mapping) return STATUS_INVALID_PARAMETER; - ASSERT((uint32)Buffer > 0x1000); + ASSERT((uintptr_t)Buffer > 0x1000); AdPrint(("Read ExtInfo %x, Mapping %x\n", ExtInfo, ExtInfo->Mapping)); PEXTENT_MAP Extent = ExtInfo->Mapping; // Extent array - uint32 to_read, Lba, sect_offs, flags, _ReadBytes; + SIZE_T to_read, _ReadBytes; + uint32 Lba, sect_offs, flags; + uint32 index; OSSTATUS status; // prevent reading out of data space if(Offset > ExtInfo->Length) return STATUS_END_OF_FILE; if(Offset+Length > ExtInfo->Length) Length = (uint32)(ExtInfo->Length - Offset); Offset += ExtInfo->Offset; // used for in-ICB data // read maximal possible part of each frag of extent - Lba = UDFExtentOffsetToLba(Vcb, Extent, Offset, §_offs, &to_read, &flags, &_ReadBytes); + Lba = UDFExtentOffsetToLba(Vcb, Extent, Offset, §_offs, &to_read, &flags, &index); + _ReadBytes = index; while(Length) { // EOF check if(Lba == LBA_OUT_OF_EXTENT) return STATUS_END_OF_FILE; @@ -3057,7 +3064,8 @@ UDFReadExtent( ASSERT(to_read); Buffer += to_read; // Offset += to_read; - Lba = UDFNextExtentToLba(Vcb, Extent, &to_read, &flags, &_ReadBytes); + Lba = UDFNextExtentToLba(Vcb, Extent, &to_read, &flags, &index); + _ReadBytes = index; sect_offs = 0; } return STATUS_SUCCESS; @@ -3084,7 +3092,8 @@ UDFReadExtentLocation( PEXTENT_MAP Extent = ExtInfo->Mapping; // Extent array PEXTENT_MAP SubExtInfo; - uint32 to_read, Lba, sect_offs, flags, Skip_MapEntries; + SIZE_T to_read; + uint32 Lba, sect_offs, flags, Skip_MapEntries; int32 SubExtInfoSz = *_SubExtInfoSz; int64 Length; int64 NextOffset; @@ -3175,20 +3184,20 @@ UDFWriteExtent( IN PVCB Vcb, IN PEXTENT_INFO ExtInfo, // Extent array IN int64 Offset, // offset in extent - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, // setting this flag delays flushing of given // data to indefinite term IN int8* Buffer, - OUT uint32* WrittenBytes + OUT PSIZE_T WrittenBytes ) { if(!ExtInfo || !ExtInfo->Mapping) return STATUS_INVALID_PARAMETER; PEXTENT_MAP Extent = ExtInfo->Mapping; // Extent array - uint32 to_write, Lba, sect_offs, flags; + uint32 Lba, sect_offs, flags; OSSTATUS status; - uint32 _WrittenBytes; + SIZE_T to_write, _WrittenBytes; BOOLEAN reread_lba; // BOOLEAN already_prepared = FALSE; // BOOLEAN prepare = !Buffer; @@ -3326,21 +3335,21 @@ UDFZeroExtent( IN PVCB Vcb, IN PEXTENT_INFO ExtInfo, // Extent array IN int64 Offset, // offset in extent - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Deallocate, // deallocate frag or just mark as unrecorded IN BOOLEAN Direct, // setting this flag delays flushing of given // data to indefinite term - OUT uint32* WrittenBytes + OUT PSIZE_T WrittenBytes ) { if(!ExtInfo || !ExtInfo->Mapping) return STATUS_INVALID_PARAMETER; PEXTENT_MAP Extent = ExtInfo->Mapping; // Extent array - uint32 to_write, Lba, sect_offs, flags; + uint32 Lba, sect_offs, flags; OSSTATUS status; - uint32 _WrittenBytes; - uint32 LBS = Vcb->LBlockSize; + SIZE_T to_write, _WrittenBytes; + SIZE_T LBS = Vcb->LBlockSize; AdPrint(("Zero ExtInfo %x, Mapping %x\n", ExtInfo, ExtInfo->Mapping)); diff --git a/drivers/filesystems/udfs/udf_info/mount.cpp b/drivers/filesystems/udfs/udf_info/mount.cpp index 2cbaccc506..72c3329093 100644 --- a/drivers/filesystems/udfs/udf_info/mount.cpp +++ b/drivers/filesystems/udfs/udf_info/mount.cpp @@ -64,7 +64,7 @@ UDFPrepareXSpaceBitmap( lb_addr locAddr; int8* _XSBM; uint16 Ident; - uint32 ReadBytes; + SIZE_T ReadBytes; uint32 PartNum; if(!(XSpaceBitmap->extLength)) { @@ -202,7 +202,7 @@ UDFUpdateXSpaceBitmaps( uint32 USl, FSl; EXTENT_INFO FSBMExtInfo, USBMExtInfo; // lb_addr locAddr; - uint32 WrittenBytes; + SIZE_T WrittenBytes; UDF_CHECK_BITMAP_RESOURCE(Vcb); @@ -304,7 +304,7 @@ UDFUpdatePartDesc( PartitionDesc *p = (PartitionDesc *)Buf; uint32 i; // PartNdx tag* PTag; - uint32 WrittenBytes; + SIZE_T WrittenBytes; for(i=0; i<Vcb->PartitionMaps; i++) { @@ -344,7 +344,7 @@ UDFUpdateUSpaceDesc( ) { PUNALLOC_SPACE_DESC usd; - uint32 WrittenBytes; + SIZE_T WrittenBytes; usd = (PUNALLOC_SPACE_DESC)Buf; usd->numAllocDescs = 0; @@ -365,7 +365,7 @@ UDFUpdateLogicalVolInt( { OSSTATUS RC = STATUS_SUCCESS; uint32 i, len; - uint32 WrittenBytes; + SIZE_T WrittenBytes; // uint32 lvid_count = 0; uint32 pSize; tag* PTag; @@ -469,7 +469,7 @@ UDFUpdateSparingTable( OSSTATUS status2 = STATUS_SUCCESS; uint32 i=0, BC, BC2; PSPARING_TABLE SparTable; - uint32 ReadBytes; + SIZE_T ReadBytes; // uint32 n,m; // BOOLEAN merged; BOOLEAN sorted; @@ -605,7 +605,7 @@ UDFUpdateLogicalVol( #define CUR_IDENT_SZ (sizeof(lvd->logicalVolIdent)) dstring CS0[CUR_IDENT_SZ]; uint16 ident; - uint32 WrittenBytes; + SIZE_T WrittenBytes; OSSTATUS status = STATUS_SUCCESS; // OSSTATUS status2 = STATUS_SUCCESS; @@ -761,7 +761,7 @@ UDFSetDstring( ) { uint8* CS0; - uint32 len = Length-1; + SIZE_T len = Length-1; UDFCompressUnicode(UName, &CS0, &len); if(!CS0) @@ -809,7 +809,7 @@ UDFUpdateVolIdent( OSSTATUS status; dstring CS0[CUR_IDENT_SZ]; uint16 ident; - uint32 WrittenBytes; + SIZE_T WrittenBytes; if(!pvoldesc) return STATUS_INSUFFICIENT_RESOURCES; @@ -1115,7 +1115,7 @@ UDFFindVRS( uint32 BeginOffset = Vcb->FirstLBA; OSSTATUS RC; int8* buffer = (int8*)MyAllocatePool__(NonPagedPool,Vcb->BlockSize); - uint32 ReadBytes; + SIZE_T ReadBytes; if(!buffer) return 0; // Relative to First LBA in Last Session @@ -1244,7 +1244,7 @@ UDFLoadLogicalVolInt( { OSSTATUS RC = STATUS_SUCCESS; uint32 len; - uint32 _ReadBytes; + SIZE_T _ReadBytes; int8* Buf = NULL; uint16 ident; LogicalVolIntegrityDescImpUse* LVID_iUse; @@ -1580,8 +1580,8 @@ UDFAddXSpaceBitmap( OSSTATUS status; uint16 Ident; uint32 flags; - uint32 Length; - uint32 ReadBytes; + SIZE_T Length; + SIZE_T ReadBytes; BOOLEAN bit_set; UDF_CHECK_BITMAP_RESOURCE(Vcb); @@ -1680,7 +1680,7 @@ UDFVerifyXSpaceBitmap( uint16 Ident; uint32 flags; uint32 Length; - uint32 ReadBytes; + SIZE_T ReadBytes; // BOOLEAN bit_set; UDF_CHECK_BITMAP_RESOURCE(Vcb); @@ -1775,7 +1775,7 @@ UDFDelXSpaceBitmap( uint16 Ident; uint32 flags; uint32 Length; - uint32 ReadBytes; + SIZE_T ReadBytes; if(!(Length = (bm->extLength & UDF_EXTENT_LENGTH_MASK))) return STATUS_SUCCESS; i=0; @@ -2791,7 +2791,7 @@ UDFLoadSparingTable( uint32 i=0, BC, BC2; PSPARING_TABLE SparTable; uint32 TabSize, NewSize; - uint32 ReadBytes; + SIZE_T ReadBytes; uint32 SparTableLoc; #ifdef UDF_TRACK_FS_STRUCTURES uint32 j; @@ -2991,7 +2991,7 @@ UDFGetDiskInfoAndVerify( PFILE_SET_DESC FileSetDesc = NULL; int8* Buf = NULL; - uint32 ReadBytes; + SIZE_T ReadBytes; UDFPrint(("UDFGetDiskInfoAndVerify\n")); _SEH2_TRY { diff --git a/drivers/filesystems/udfs/udf_info/remap.cpp b/drivers/filesystems/udfs/udf_info/remap.cpp index 646f7eb606..d86953aa0b 100644 --- a/drivers/filesystems/udfs/udf_info/remap.cpp +++ b/drivers/filesystems/udfs/udf_info/remap.cpp @@ -227,7 +227,7 @@ UDFVWrite( IN void* Buffer, // Target buffer IN uint32 BCount, IN uint32 LBA, -// OUT uint32* WrittenBytes, +// OUT PSIZE_T WrittenBytes, IN uint32 Flags ) { @@ -544,11 +544,11 @@ UDFVWorkItem( { PUDF_VERIFY_REQ VerifyReq = (PUDF_VERIFY_REQ)Context; PVCB Vcb = VerifyReq->Vcb; - ULONG ReadBytes; + SIZE_T ReadBytes; // OSSTATUS RC; ULONG i; - ReadBytes = (ULONG)Vcb; + ReadBytes = (SIZE_T)Vcb; #if 1 if(Vcb->SparingCountFree) { WCacheStartDirect__(&(Vcb->FastCache), Vcb, TRUE); @@ -768,7 +768,7 @@ UDFCheckArea( { uint8* buff; OSSTATUS RC; - uint32 ReadBytes; + SIZE_T ReadBytes; uint32 i, d; BOOLEAN ext_ok = TRUE; EXTENT_MAP Map[2]; diff --git a/drivers/filesystems/udfs/udf_info/udf_info.cpp b/drivers/filesystems/udfs/udf_info/udf_info.cpp index 6f29d88e5f..38576beab2 100644 --- a/drivers/filesystems/udfs/udf_info/udf_info.cpp +++ b/drivers/filesystems/udfs/udf_info/udf_info.cpp @@ -170,7 +170,7 @@ __fastcall UDFDecompressUnicode( IN OUT PUNICODE_STRING UName, IN uint8* CS0, - IN uint32 Length, + IN SIZE_T Length, OUT uint16* valueCRC ) { @@ -240,7 +240,7 @@ __fastcall UDFCompressUnicode( IN PUNICODE_STRING UName, IN OUT uint8** _CS0, - IN OUT uint32* Length + IN OUT PSIZE_T Length ) { uint8* CS0; @@ -1115,7 +1115,8 @@ UDFBuildFileIdent( { PFILE_IDENT_DESC FileId; uint8* CS0; - uint32 Nlen, l; + SIZE_T Nlen; + uint32 l; // prepare filename UDFCompressUnicode(fn, &CS0, &Nlen); if(!CS0) return STATUS_INSUFFICIENT_RESOURCES; @@ -1605,18 +1606,18 @@ UDFWriteFile__( IN PVCB Vcb, IN PUDF_FILE_INFO FileInfo, IN int64 Offset, - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, IN int8* Buffer, - OUT uint32* WrittenBytes + OUT PSIZE_T WrittenBytes ) { int64 t, elen; OSSTATUS status; int8* OldInIcb = NULL; ValidateFileInfo(FileInfo); - uint32 ReadBytes; - uint32 _WrittenBytes; + SIZE_T ReadBytes; + SIZE_T _WrittenBytes; PUDF_DATALOC_INFO Dloc; // unwind staff BOOLEAN WasInIcb = FALSE; @@ -1689,7 +1690,7 @@ UDFWriteFile__( Vcb->LowFreeSpace ? "LowSpace" : "")); if(UDFIsADirectory(FileInfo) && !WasInIcb && !Vcb->LowFreeSpace) { FileInfo->Dloc->DataLoc.Flags |= EXTENT_FLAG_ALLOC_SEQUENTIAL; - status = UDFResizeExtent(Vcb, PartNum, (t*2+Vcb->WriteBlockSize-1) & ~(Vcb->WriteBlockSize-1), FALSE, &(Dloc->DataLoc)); + status = UDFResizeExtent(Vcb, PartNum, (t*2+Vcb->WriteBlockSize-1) & ~(SIZE_T)(Vcb->WriteBlockSize-1), FALSE, &(Dloc->DataLoc)); if(OS_SUCCESS(status)) { AdPrint((" preallocated space for Dir\n")); FileInfo->Dloc->DataLoc.Flags |= EXTENT_FLAG_PREALLOCATED; @@ -2019,7 +2020,7 @@ UDFOpenFile__( PDIR_INDEX_ITEM DirNdx; PUDF_FILE_INFO FileInfo; PUDF_FILE_INFO ParFileInfo; - uint32 ReadBytes; + SIZE_T ReadBytes; *_FileInfo = NULL; if(!hDirNdx) return STATUS_NOT_A_DIRECTORY; @@ -2597,7 +2598,7 @@ UDFCreateFile__( PUDF_FILE_INFO FileInfo; *_FileInfo = NULL; BOOLEAN undel = FALSE; - uint32 ReadBytes; + SIZE_T ReadBytes; // BOOLEAN PackDir = FALSE; BOOLEAN FEAllocated = FALSE; @@ -2904,10 +2905,10 @@ UDFReadFile__( IN PVCB Vcb, IN PUDF_FILE_INFO FileInfo, IN int64 Offset, // offset in extent - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, OUT int8* Buffer, - OUT uint32* ReadBytes + OUT PSIZE_T ReadBytes ) { ValidateFileInfo(FileInfo); @@ -2925,9 +2926,9 @@ UDFZeroFile__( IN PVCB Vcb, IN PUDF_FILE_INFO FileInfo, IN int64 Offset, // offset in extent - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, - OUT uint32* ReadBytes + OUT PSIZE_T ReadBytes ) { ValidateFileInfo(FileInfo); @@ -2944,9 +2945,9 @@ UDFSparseFile__( IN PVCB Vcb, IN PUDF_FILE_INFO FileInfo, IN int64 Offset, // offset in extent - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, - OUT uint32* ReadBytes + OUT PSIZE_T ReadBytes ) { ValidateFileInfo(FileInfo); @@ -2966,7 +2967,8 @@ UDFPadLastSector( if(!ExtInfo || !(ExtInfo->Mapping) || !(ExtInfo->Length)) return STATUS_INVALID_PARAMETER; PEXTENT_MAP Extent = ExtInfo->Mapping; // Extent array - uint32 to_write, Lba, sect_offs, flags, WrittenBytes; + SIZE_T to_write, WrittenBytes; + uint32 Lba, sect_offs, flags; OSSTATUS status; // Length should not be zero int64 Offset = ExtInfo->Length + ExtInfo->Offset; @@ -3201,7 +3203,7 @@ UDFRenameMoveFile__( (j==FileInfo->Index) ) { // case-only rename uint8* CS0; - uint32 Nlen, /* l, FIXME ReactOS */ IUl; + SIZE_T Nlen, /* l, FIXME ReactOS */ IUl; // prepare filename UDFCompressUnicode(fn, &CS0, &Nlen); @@ -3390,7 +3392,7 @@ UDFRecordDirectory__( UDF_DATALOC_INFO Dloc; UNICODE_STRING PName; uint32 PartNum; - uint32 WrittenBytes; + SIZE_T WrittenBytes; PDIR_INDEX_ITEM CurDirNdx; uint32 lba; @@ -3469,7 +3471,7 @@ UDFResizeFile__( IN int64 NewLength ) { - uint32 WrittenBytes; + SIZE_T WrittenBytes; OSSTATUS status; uint32 PartNum; int8* OldInIcb = NULL; @@ -3607,7 +3609,7 @@ UDFLoadVAT( PUDF_FILE_INFO VatFileInfo; uint32 len, i=0, j, to_read; uint32 Offset, hdrOffset; - uint32 ReadBytes; + SIZE_T ReadBytes; uint32 root; uint16 PartNum; // uint32 VatFirstLba = 0; @@ -3867,7 +3869,7 @@ UDFFlushFE( { int8* NewAllocDescs; OSSTATUS status; - uint32 WrittenBytes; + SIZE_T WrittenBytes; uint16 AllocMode; uint32 lba; @@ -4055,7 +4057,7 @@ UDFFlushFI( PUDF_FILE_INFO DirInfo = FileInfo->ParentFile; PDIR_INDEX_ITEM DirNdx; OSSTATUS status; - uint32 WrittenBytes; + SIZE_T WrittenBytes; // use WrittenBytes variable to store LBA of FI to be recorded #define lba WrittenBytes @@ -4524,7 +4526,7 @@ uint16 __fastcall UDFCrc( IN uint8* Data, // ECX - IN uint32 Size // EDX + IN SIZE_T Size // EDX ) { #if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) @@ -4594,7 +4596,7 @@ UDFReadTagged( // icbtag* Icb = (icbtag*)(Buf+1); uint8 checksum; unsigned int i; - uint32 ReadBytes; + SIZE_T ReadBytes; int8* tb; // Read the block @@ -4836,7 +4838,7 @@ UDFCreateRootFile__( LONG_AD FEicb; PUDF_FILE_INFO FileInfo; *_FileInfo = NULL; - uint32 ReadBytes; + SIZE_T ReadBytes; FileInfo = (PUDF_FILE_INFO)MyAllocatePoolTag__(UDF_FILE_INFO_MT,sizeof(UDF_FILE_INFO), MEM_FINF_TAG); *_FileInfo = FileInfo; @@ -5040,7 +5042,7 @@ UDFRecordVAT( uint32 hdrOffset, hdrOffsetNew; uint32 hdrLen; OSSTATUS status; - uint32 ReadBytes; + SIZE_T ReadBytes; uint32 len; uint16 PartNdx = (uint16)Vcb->VatPartNdx; uint16 PartNum = UDFGetPartNumByPartNdx(Vcb, PartNdx); @@ -5363,8 +5365,8 @@ UDFConvertFEToNonInICB( int8* OldInIcb = NULL; uint32 OldLen; ValidateFileInfo(FileInfo); - uint32 ReadBytes; - uint32 _WrittenBytes; + SIZE_T ReadBytes; + SIZE_T _WrittenBytes; PUDF_DATALOC_INFO Dloc; // ASSERT(FileInfo->RefCount >= 1); @@ -5462,7 +5464,7 @@ UDFConvertFEToExtended( PFILE_ENTRY FileEntry; uint32 Length, NewLength, l; OSSTATUS status; - uint32 ReadBytes; + SIZE_T ReadBytes; if(!FileInfo) return STATUS_INVALID_PARAMETER; ValidateFileInfo(FileInfo); diff --git a/drivers/filesystems/udfs/udf_info/udf_info.h b/drivers/filesystems/udfs/udf_info/udf_info.h index c1ef02233d..2aeeb01d9e 100644 --- a/drivers/filesystems/udfs/udf_info/udf_info.h +++ b/drivers/filesystems/udfs/udf_info/udf_info.h @@ -24,7 +24,7 @@ UDFExtentOffsetToLba(IN PVCB Vcb, IN PEXTENT_AD Extent, // Extent array IN int64 Offset, // offset in extent OUT uint32* SectorOffset, - OUT uint32* AvailLength, // available data in this block + OUT PSIZE_T AvailLength, // available data in this block OUT uint32* Flags, OUT uint32* Index); @@ -44,10 +44,10 @@ UDFLocateLbaInExtent( OSSTATUS UDFReadExtent(IN PVCB Vcb, IN PEXTENT_INFO ExtInfo, // Extent array IN int64 Offset, // offset in extent - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, OUT int8* Buffer, - OUT uint32* ReadBytes); + OUT PSIZE_T ReadBytes); // builds mapping for specified amount of data at any offset from specified extent. OSSTATUS UDFReadExtentLocation(IN PVCB Vcb, @@ -64,7 +64,7 @@ int64 UDFGetExtentLength(IN PEXTENT_MAP Extent); // Extent array void __fastcall UDFDecompressUnicode(IN OUT PUNICODE_STRING UName, IN uint8* CS0, - IN uint32 Length, + IN SIZE_T Length, OUT uint16* valueCRC); // calculate hashes for directory search uint8 UDFBuildHashEntry(IN PVCB Vcb, @@ -241,17 +241,17 @@ __fastcall UDFDOSName100(IN OUT PUNICODE_STRING DosName, // return length of bit-chain starting from Offs bit #ifdef _X86_ -uint32 +SIZE_T __stdcall UDFGetBitmapLen( #else // NO X86 optimization , use generic C/C++ -uint32 UDFGetBitmapLen( +SIZE_T UDFGetBitmapLen( #endif // _X86_ uint32* Bitmap, - uint32 Offs, - uint32 Lim); + SIZE_T Offs, + SIZE_T Lim); // scan disc free space bitmap for minimal suitable extent -uint32 UDFFindMinSuitableExtent(IN PVCB Vcb, +SIZE_T UDFFindMinSuitableExtent(IN PVCB Vcb, IN uint32 Length, // in blocks IN uint32 SearchStart, IN uint32 SearchLim, @@ -468,7 +468,7 @@ OSSTATUS UDFLoadExtInfo(IN PVCB Vcb, void __fastcall UDFCompressUnicode(IN PUNICODE_STRING UName, IN OUT uint8** _CS0, - IN OUT uint32* Length); + IN OUT PSIZE_T Length); // build FileIdent for specified FileEntry. OSSTATUS UDFBuildFileIdent(IN PVCB Vcb, IN PUNICODE_STRING fn, @@ -520,21 +520,21 @@ __inline OSSTATUS UDFMarkRecordedAsAllocated(IN PVCB Vcb, OSSTATUS UDFWriteExtent(IN PVCB Vcb, IN PEXTENT_INFO ExtInfo, // Extent array IN int64 Offset, // offset in extent - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, // setting this flag delays flushing of given // data to indefinite term IN int8* Buffer, - OUT uint32* WrittenBytes); + OUT PSIZE_T WrittenBytes); // deallocate/zero data at any offset from specified extent. OSSTATUS UDFZeroExtent(IN PVCB Vcb, IN PEXTENT_INFO ExtInfo, // Extent array IN int64 Offset, // offset in extent - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Deallocate, // deallocate frag or just mark as unrecorded IN BOOLEAN Direct, // setting this flag delays flushing of given // data to indefinite term - OUT uint32* WrittenBytes); + OUT PSIZE_T WrittenBytes); #define UDFZeroExtent__(Vcb, Ext, Off, Len, Dir, WB) \ UDFZeroExtent(Vcb, Ext, Off, Len, FALSE, Dir, WB) @@ -619,10 +619,10 @@ void UDFChangeFileCounter(IN PVCB Vcb, OSSTATUS UDFWriteFile__(IN PVCB Vcb, IN PUDF_FILE_INFO FileInfo, IN int64 Offset, - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, IN int8* Buffer, - OUT uint32* WrittenBytes); + OUT PSIZE_T WrittenBytes); // mark file as deleted & decrease file link counter. OSSTATUS UDFUnlinkFile__(IN PVCB Vcb, IN PUDF_FILE_INFO FileInfo, @@ -666,10 +666,10 @@ __inline OSSTATUS UDFReadFile__(IN PVCB Vcb, IN PUDF_FILE_INFO FileInfo, IN int64 Offset, // offset in extent - IN uint32 Length, + IN SIZE_T Length, IN BOOLEAN Direct, OUT int8* Buffer, - OUT uint32* ReadBytes) + OUT PSIZE_T ReadBytes) { ValidateFileInfo(FileInfo); @@ -862,7 +862,7 @@ __fastcall crc32(IN uint8* s, // calculate a 16-bit CRC checksum using ITU-T V.41 polynomial uint16 __fastcall UDFCrc(IN uint8* Data, - IN uint32 Size); + IN SIZE_T Size); // read the first block of a tagged descriptor & check it OSSTATUS UDFReadTagged(IN PVCB Vcb, IN int8* Buf, @@ -1277,7 +1277,7 @@ UDFVWrite( IN void* Buffer, // Target buffer IN uint32 BCount, IN uint32 LBA, -// OUT uint32* WrittenBytes, +// OUT PSIZE_T WrittenBytes, IN uint32 Flags ); diff --git a/drivers/filesystems/udfs/udf_info/udf_rel.h b/drivers/filesystems/udfs/udf_info/udf_rel.h index 3031c1faa9..c8000ad3bc 100644 --- a/drivers/filesystems/udfs/udf_info/udf_rel.h +++ b/drivers/filesystems/udfs/udf_info/udf_rel.h @@ -516,7 +516,7 @@ typedef struct _UDF_ALLOCATION_CACHE_ITEM { #define UDF_MAX_LVID_CHAIN_LENGTH 1024 #define UDF_LVID_TTL 1024 -#define UDF_NO_EXTENT_MAP ((PEXTENT_MAP)0xffffffff) +#define UDF_NO_EXTENT_MAP ((PEXTENT_MAP)(ULONG_PTR)~0ULL) #define UDF_FLUSH_FLAGS_LITE (0x80000000) diff --git a/drivers/filesystems/udfs/write.cpp b/drivers/filesystems/udfs/write.cpp index ceaa69bda0..60854a7724 100644 --- a/drivers/filesystems/udfs/write.cpp +++ b/drivers/filesystems/udfs/write.cpp @@ -117,7 +117,7 @@ UDFCommonWrite( PIO_STACK_LOCATION IrpSp = NULL; LARGE_INTEGER ByteOffset; ULONG WriteLength = 0, TruncatedLength = 0; - ULONG NumberBytesWritten = 0; + SIZE_T NumberBytesWritten = 0; PFILE_OBJECT FileObject = NULL; PtrUDFFCB Fcb = NULL; PtrUDFCCB Ccb = NULL; @@ -158,7 +158,7 @@ UDFCommonWrite( TopIrp = IoGetTopLevelIrp(); - switch((ULONG)TopIrp) { + switch((ULONG_PTR)TopIrp) { case FSRTL_FSP_TOP_LEVEL_IRP: UDFPrint((" FSRTL_FSP_TOP_LEVEL_IRP\n")); break; @@ -525,7 +525,7 @@ UDFCommonWrite( // Determine if we were called by the lazywriter. // We reuse 'IsThisADeferredWrite' here to decrease stack usage - IsThisADeferredWrite = (NtReqFcb->LazyWriterThreadID == (uint32)PsGetCurrentThread()); + IsThisADeferredWrite = (NtReqFcb->LazyWriterThreadID == HandleToUlong(PsGetCurrentThreadId())); // Acquire the appropriate FCB resource if(PagingIo) { @@ -576,7 +576,7 @@ UDFCommonWrite( // This clause determines if the top level request was // in the FastIo path. - if ((ULONG)TopIrp > FSRTL_MAX_TOP_LEVEL_IRP_FLAG) { + if ((ULONG_PTR)TopIrp > FSRTL_MAX_TOP_LEVEL_IRP_FLAG) { PIO_STACK_LOCATION IrpStack; ASSERT( TopIrp->Type == IO_TYPE_IRP ); @@ -846,11 +846,11 @@ UDFCommonWrite( } #if 1 - if((ULONG)TopIrp == FSRTL_MOD_WRITE_TOP_LEVEL_IRP) { + if((ULONG_PTR)TopIrp == FSRTL_MOD_WRITE_TOP_LEVEL_IRP) { UDFPrint(("FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n")); CanWait = TRUE; } else - if((ULONG)TopIrp == FSRTL_CACHE_TOP_LEVEL_IRP) { + if((ULONG_PTR)TopIrp == FSRTL_CACHE_TOP_LEVEL_IRP) { UDFPrint(("FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n")); CanWait = TRUE; }
5 years, 8 months
1
0
0
0
[reactos] 01/01: [NETAPI32] Fix NetUserEnum to work on x64
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=be97da34accdf65aafade…
commit be97da34accdf65aafaded60c3be1131a2b3cd97 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Mar 10 22:19:12 2019 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Tue Apr 2 01:45:51 2019 +0200 [NETAPI32] Fix NetUserEnum to work on x64 The previous implementation used the resume_handle parameter to return a pointer to the active enumeration context, but resume_handle is a DWORD. To support 64 bit pointers, the enumeration context is inserted into a global linked list and given a unique 32 bit value as identifier for later lookup. The way the function is implemented, leaking a data structure while the MSDN description does not indicate that, seems a little questionable in general, but that is something that I leave to the original author to investigate. --- dll/win32/netapi32/netapi32.c | 2 + dll/win32/netapi32/netapi32.h | 3 ++ dll/win32/netapi32/user.c | 100 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 95 insertions(+), 10 deletions(-) diff --git a/dll/win32/netapi32/netapi32.c b/dll/win32/netapi32/netapi32.c index 5775aa46bd..576da6a37a 100644 --- a/dll/win32/netapi32/netapi32.c +++ b/dll/win32/netapi32/netapi32.c @@ -26,6 +26,8 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) switch (fdwReason) { case DLL_PROCESS_ATTACH: + InitializeListHead(&g_EnumContextListHead); + InitializeCriticalSection(&g_EnumContextListLock); DisableThreadLibraryCalls(hinstDLL); NetBIOSInit(); NetBTInit(); diff --git a/dll/win32/netapi32/netapi32.h b/dll/win32/netapi32/netapi32.h index 50b5255d6a..451865707f 100644 --- a/dll/win32/netapi32/netapi32.h +++ b/dll/win32/netapi32/netapi32.h @@ -30,6 +30,9 @@ #include "nbnamecache.h" #include "netbios.h" +extern LIST_ENTRY g_EnumContextListHead; +extern CRITICAL_SECTION g_EnumContextListLock; + NET_API_STATUS WINAPI NetpNtStatusToApiStatus(NTSTATUS Status); diff --git a/dll/win32/netapi32/user.c b/dll/win32/netapi32/user.c index a867b786ec..699ae839b8 100644 --- a/dll/win32/netapi32/user.c +++ b/dll/win32/netapi32/user.c @@ -36,6 +36,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(netapi32); typedef struct _ENUM_CONTEXT { + LIST_ENTRY ListLink; + ULONG EnumHandle; + SAM_HANDLE ServerHandle; SAM_HANDLE BuiltinDomainHandle; SAM_HANDLE AccountDomainHandle; @@ -50,6 +53,9 @@ typedef struct _ENUM_CONTEXT } ENUM_CONTEXT, *PENUM_CONTEXT; +LIST_ENTRY g_EnumContextListHead; +CRITICAL_SECTION g_EnumContextListLock; +LONG g_EnumContextHandle = 0; static ULONG @@ -2662,6 +2668,86 @@ done: return ApiStatus; } +static +NET_API_STATUS +AllocateEnumContext( + PENUM_CONTEXT *AllocatedEnumContext) +{ + NET_API_STATUS ApiStatus; + PENUM_CONTEXT EnumContext; + + /* Allocate the context structure */ + ApiStatus = NetApiBufferAllocate(sizeof(ENUM_CONTEXT), (PVOID*)&EnumContext); + if (ApiStatus != NERR_Success) + return ApiStatus; + + /* Initialize the fields */ + EnumContext->EnumerationContext = 0; + EnumContext->Buffer = NULL; + EnumContext->Count = 0; + EnumContext->Index = 0; + EnumContext->BuiltinDone = FALSE; + + /* Set a "unique" handle */ + EnumContext->EnumHandle = InterlockedIncrement(&g_EnumContextHandle); + if (EnumContext->EnumHandle == 0) + { + EnumContext->EnumHandle = InterlockedIncrement(&g_EnumContextHandle); + } + + /* Insert the context in the list */ + EnterCriticalSection(&g_EnumContextListLock); + InsertTailList(&g_EnumContextListHead, &EnumContext->ListLink); + LeaveCriticalSection(&g_EnumContextListLock); + + *AllocatedEnumContext = EnumContext; + return NERR_Success; +} + +static +VOID +FreeEnumContext( + PENUM_CONTEXT EnumContext) + +{ + /* Remove the context from the list */ + EnterCriticalSection(&g_EnumContextListLock); + RemoveEntryList(&EnumContext->ListLink); + LeaveCriticalSection(&g_EnumContextListLock); + + /* Free it */ + NetApiBufferFree(EnumContext); +} + +static +PENUM_CONTEXT +LookupEnumContext( + SAM_ENUMERATE_HANDLE EnumerationHandle) +{ + PENUM_CONTEXT FoundEnumContext = NULL; + PLIST_ENTRY ListEntry; + + /* Acquire the list lock */ + EnterCriticalSection(&g_EnumContextListLock); + + /* Search the list for the handle */ + for (ListEntry = g_EnumContextListHead.Flink; + ListEntry != &g_EnumContextListHead; + ListEntry = ListEntry->Flink) + { + PENUM_CONTEXT EnumContext = CONTAINING_RECORD(ListEntry, ENUM_CONTEXT, ListLink); + if (EnumContext->EnumHandle == EnumerationHandle) + { + FoundEnumContext = EnumContext; + break; + } + } + + /* Release the list lock */ + LeaveCriticalSection(&g_EnumContextListLock); + + return FoundEnumContext; +} /************************************************************ * NetUserEnum (NETAPI32.@) @@ -2699,20 +2785,14 @@ NetUserEnum(LPCWSTR servername, if (resume_handle != NULL && *resume_handle != 0) { - EnumContext = (PENUM_CONTEXT)*resume_handle; + EnumContext = LookupEnumContext(*resume_handle); } else { - ApiStatus = NetApiBufferAllocate(sizeof(ENUM_CONTEXT), (PVOID*)&EnumContext); + ApiStatus = AllocateEnumContext(&EnumContext); if (ApiStatus != NERR_Success) goto done; - EnumContext->EnumerationContext = 0; - EnumContext->Buffer = NULL; - EnumContext->Count = 0; - EnumContext->Index = 0; - EnumContext->BuiltinDone = FALSE; - Status = SamConnect((servername != NULL) ? &ServerName : NULL, &EnumContext->ServerHandle, SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN, @@ -2892,7 +2972,7 @@ done: SamFreeMemory(EnumContext->Buffer); } - NetApiBufferFree(EnumContext); + FreeEnumContext(EnumContext); EnumContext = NULL; } } @@ -2901,7 +2981,7 @@ done: SamCloseHandle(UserHandle); if (resume_handle != NULL) - *resume_handle = (DWORD_PTR)EnumContext; + *resume_handle = EnumContext ? EnumContext->EnumHandle : 0; *bufptr = (LPBYTE)Buffer;
5 years, 8 months
1
0
0
0
[reactos] 01/01: [SETUPAPI] Use ClassInstallReserved field instead of Reserved to store a pointer.
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=61e35141e8dafec355cd8…
commit 61e35141e8dafec355cd8cd96e060a82c0b3155c Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Wed Feb 28 20:14:28 2018 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Mon Apr 1 22:20:39 2019 +0200 [SETUPAPI] Use ClassInstallReserved field instead of Reserved to store a pointer. The Reserved field is ULONG and we need ULONG_PTR. ClassInstallReserved was unused so far. I have no idea whether this is correct, but it cannot be more incorrect than what we had. --- dll/win32/setupapi/devinst.c | 4 ++-- dll/win32/setupapi/driver.c | 22 +++++++++++----------- dll/win32/setupapi/interface.c | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dll/win32/setupapi/devinst.c b/dll/win32/setupapi/devinst.c index f9a307e07c..e396b5ddfc 100644 --- a/dll/win32/setupapi/devinst.c +++ b/dll/win32/setupapi/devinst.c @@ -5233,7 +5233,7 @@ SetupDiRegisterCoDeviceInstallers( if (!Result) goto cleanup; - SelectedDriver = (struct DriverInfoElement *)InstallParams.Reserved; + SelectedDriver = (struct DriverInfoElement *)InstallParams.ClassInstallReserved; if (SelectedDriver == NULL) { SetLastError(ERROR_NO_DRIVER_SELECTED); @@ -5436,7 +5436,7 @@ SetupDiInstallDevice( goto cleanup; } - SelectedDriver = (struct DriverInfoElement *)InstallParams.Reserved; + SelectedDriver = (struct DriverInfoElement *)InstallParams.ClassInstallReserved; if (SelectedDriver == NULL) { SetLastError(ERROR_NO_DRIVER_SELECTED); diff --git a/dll/win32/setupapi/driver.c b/dll/win32/setupapi/driver.c index 2b4476df1a..3ead218522 100644 --- a/dll/win32/setupapi/driver.c +++ b/dll/win32/setupapi/driver.c @@ -1247,7 +1247,7 @@ SetupDiDestroyDriverInfoList( driverInfo = CONTAINING_RECORD(ListEntry, struct DriverInfoElement, ListEntry); DestroyDriverInfoElement(driverInfo); } - InstallParams.Reserved = 0; + InstallParams.ClassInstallReserved = 0; InstallParams.Flags &= ~(DI_DIDCLASS | DI_MULTMFGS); InstallParams.FlagsEx &= ~DI_FLAGSEX_DIDINFOLIST; ret = SetupDiSetDeviceInstallParamsW(DeviceInfoSet, NULL, &InstallParams); @@ -1265,14 +1265,14 @@ SetupDiDestroyDriverInfoList( { ListEntry = RemoveHeadList(&deviceInfo->DriverListHead); driverInfo = CONTAINING_RECORD(ListEntry, struct DriverInfoElement, ListEntry); - if ((PVOID)InstallParamsSet.Reserved == driverInfo) + if ((PVOID)InstallParamsSet.ClassInstallReserved == driverInfo) { - InstallParamsSet.Reserved = 0; + InstallParamsSet.ClassInstallReserved = 0; SetupDiSetDeviceInstallParamsW(DeviceInfoSet, NULL, &InstallParamsSet); } DestroyDriverInfoElement(driverInfo); } - InstallParams.Reserved = 0; + InstallParams.ClassInstallReserved = 0; InstallParams.Flags &= ~DI_DIDCOMPAT; InstallParams.FlagsEx &= ~DI_FLAGSEX_DIDCOMPATINFO; ret = SetupDiSetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, &InstallParams); @@ -1503,7 +1503,7 @@ SetupDiGetSelectedDriverW( if (SetupDiGetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, &InstallParams)) { struct DriverInfoElement *driverInfo; - driverInfo = (struct DriverInfoElement *)InstallParams.Reserved; + driverInfo = (struct DriverInfoElement *)InstallParams.ClassInstallReserved; if (driverInfo == NULL) SetLastError(ERROR_NO_DRIVER_SELECTED); else @@ -1613,12 +1613,12 @@ SetupDiSetSelectedDriverW( if (DeviceInfoData) { - pDriverInfo = (struct DriverInfoElement **)&((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams.Reserved; + pDriverInfo = (struct DriverInfoElement **)&((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams.ClassInstallReserved; ListHead = &((struct DeviceInfo *)DeviceInfoData->Reserved)->DriverListHead; } else { - pDriverInfo = (struct DriverInfoElement **)&((struct DeviceInfoSet *)DeviceInfoSet)->InstallParams.Reserved; + pDriverInfo = (struct DriverInfoElement **)&((struct DeviceInfoSet *)DeviceInfoSet)->InstallParams.ClassInstallReserved; ListHead = &((struct DeviceInfoSet *)DeviceInfoSet)->DriverListHead; } @@ -2032,7 +2032,7 @@ SetupDiGetDriverInstallParamsW( if (SetupDiGetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, &InstallParams)) { struct DriverInfoElement *driverInfo; - driverInfo = (struct DriverInfoElement *)InstallParams.Reserved; + driverInfo = (struct DriverInfoElement *)InstallParams.ClassInstallReserved; if (driverInfo == NULL) SetLastError(ERROR_NO_DRIVER_SELECTED); else @@ -2106,9 +2106,9 @@ SetupDiInstallDriverFiles( SetLastError(ERROR_INVALID_HANDLE); else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA)) SetLastError(ERROR_INVALID_USER_BUFFER); - else if (DeviceInfoData && ((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams.Reserved == 0) + else if (DeviceInfoData && ((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams.ClassInstallReserved == 0) SetLastError(ERROR_NO_DRIVER_SELECTED); - else if (!DeviceInfoData && ((struct DeviceInfoSet *)DeviceInfoSet)->InstallParams.Reserved == 0) + else if (!DeviceInfoData && ((struct DeviceInfoSet *)DeviceInfoSet)->InstallParams.ClassInstallReserved == 0) SetLastError(ERROR_NO_DRIVER_SELECTED); else { @@ -2125,7 +2125,7 @@ SetupDiInstallDriverFiles( if (!ret) goto done; - SelectedDriver = (struct DriverInfoElement *)InstallParams.Reserved; + SelectedDriver = (struct DriverInfoElement *)InstallParams.ClassInstallReserved; if (!SelectedDriver) { SetLastError(ERROR_NO_DRIVER_SELECTED); diff --git a/dll/win32/setupapi/interface.c b/dll/win32/setupapi/interface.c index f080d51828..09b84d519a 100644 --- a/dll/win32/setupapi/interface.c +++ b/dll/win32/setupapi/interface.c @@ -454,7 +454,7 @@ SetupDiInstallDeviceInterfaces( if (!Result) goto cleanup; - SelectedDriver = (struct DriverInfoElement *)InstallParams.Reserved; + SelectedDriver = (struct DriverInfoElement *)InstallParams.ClassInstallReserved; if (SelectedDriver == NULL) { SetLastError(ERROR_NO_DRIVER_SELECTED);
5 years, 8 months
1
0
0
0
[reactos] 01/01: Revert "[DXG] Define GUIDs only once", to fix MSVC build
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0c4d21a5a1c4e2e533d9d…
commit 0c4d21a5a1c4e2e533d9df43969a9c8ec88ecb94 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Mon Apr 1 18:00:59 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon Apr 1 18:00:59 2019 +0200 Revert "[DXG] Define GUIDs only once", to fix MSVC build This reverts commit 3a78dd4b3158cd535d561e7a95fbb55863a1a669. --- win32ss/reactx/dxg/dxg_int.h | 1 + win32ss/reactx/dxg/main.c | 14 -------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/win32ss/reactx/dxg/dxg_int.h b/win32ss/reactx/dxg/dxg_int.h index b2dd3b7d4d..fa9c3170a8 100644 --- a/win32ss/reactx/dxg/dxg_int.h +++ b/win32ss/reactx/dxg/dxg_int.h @@ -19,6 +19,7 @@ #include <wingdi.h> #include <winddi.h> #include <ddkernel.h> +#include <initguid.h> #include <ddrawi.h> #include <ntgdityp.h> #include <psfuncs.h> diff --git a/win32ss/reactx/dxg/main.c b/win32ss/reactx/dxg/main.c index deeb49260c..7bcd329b9e 100644 --- a/win32ss/reactx/dxg/main.c +++ b/win32ss/reactx/dxg/main.c @@ -8,20 +8,6 @@ * 15/10-2007 Magnus Olsen */ -#include <ntifs.h> - -/* Win32 Headers */ -#define WINBASEAPI -#define STARTF_USESIZE 2 -#define STARTF_USEPOSITION 4 -#define INTERNAL_CALL NTAPI -#define NT_BUILD_ENVIRONMENT - -#include <windef.h> -#include <winerror.h> -#include <wingdi.h> -#include <winddi.h> -#include <initguid.h> #include <dxg_int.h> #include "dxg_driver.h"
5 years, 8 months
1
0
0
0
[reactos] 01/01: [CMAKE] Enable -fno-aggressive-loop-optimizations only for GCC 4.8(+)
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef3ded6b973aa04dda0cb…
commit ef3ded6b973aa04dda0cbf8b5e3378e1257e6a5d Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Mon Apr 1 17:29:07 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon Apr 1 17:32:07 2019 +0200 [CMAKE] Enable -fno-aggressive-loop-optimizations only for GCC 4.8(+) Previously, it was also enabled for GCC > 4.7, ie for example for GCC 4.7.1 --- sdk/cmake/gcc.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index bd29a0f98e..bf6cb1cc58 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -46,6 +46,8 @@ add_compile_flags("-nostdinc") if(GCC_VERSION VERSION_GREATER 4.7) add_compile_flags("-mstackrealign") +endif() +if(NOT GCC_VERSION VERSION_LESS 4.8) add_compile_flags("-fno-aggressive-loop-optimizations") endif()
5 years, 8 months
1
0
0
0
[reactos] 12/12: [RAPPS] Fix compilation
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2f46ab2104ee2e426d995…
commit 2f46ab2104ee2e426d995e75ea9bea1c161a5d3b Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sat Mar 30 23:04:46 2019 +0100 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon Apr 1 11:38:32 2019 +0200 [RAPPS] Fix compilation DPA_Search() function requires 6 parameters, not 4! --- base/applications/rapps/include/rosui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/rapps/include/rosui.h b/base/applications/rapps/include/rosui.h index 0d7cd296b3..378e677c05 100644 --- a/base/applications/rapps/include/rosui.h +++ b/base/applications/rapps/include/rosui.h @@ -114,7 +114,7 @@ public: INT Search(T* item, INT iStart, UINT uFlags) { - return DPA_Search(m_hDpa, s_OnCompareItems, (LPARAM)this); + return DPA_Search(m_hDpa, item, 0, s_OnCompareItems, (LPARAM)this, 0); } };
5 years, 8 months
1
0
0
0
[reactos] 11/12: [SETUPAPI] SetupDiGetDeviceInfoListClass: fix buffer overflow (and return correct results)
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6cc607bac293451d78942…
commit 6cc607bac293451d7894204a8c32ef53b769fadb Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sat Mar 30 22:31:21 2019 +0100 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon Apr 1 11:38:32 2019 +0200 [SETUPAPI] SetupDiGetDeviceInfoListClass: fix buffer overflow (and return correct results) --- dll/win32/setupapi/devinst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/setupapi/devinst.c b/dll/win32/setupapi/devinst.c index 10ffd29251..f9a307e07c 100644 --- a/dll/win32/setupapi/devinst.c +++ b/dll/win32/setupapi/devinst.c @@ -4440,7 +4440,7 @@ SetupDiGetDeviceInfoListClass( SetLastError(ERROR_NO_ASSOCIATED_CLASS); else { - memcpy(&ClassGuid, &list->ClassGuid, sizeof(GUID)); + *ClassGuid = list->ClassGuid; ret = TRUE; }
5 years, 8 months
1
0
0
0
[reactos] 10/12: [USERENV] Initialize variable before using it
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=faa938e9dc8a50a9852a0…
commit faa938e9dc8a50a9852a0075f2a1ca0b2be7f89c Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sat Mar 30 22:32:41 2019 +0100 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon Apr 1 11:38:32 2019 +0200 [USERENV] Initialize variable before using it --- dll/win32/userenv/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/userenv/profile.c b/dll/win32/userenv/profile.c index 6c9d29ee26..6e829527b2 100644 --- a/dll/win32/userenv/profile.c +++ b/dll/win32/userenv/profile.c @@ -357,7 +357,7 @@ CheckForGuestsAndAdmins( PTOKEN_GROUPS pGroupInfo = NULL; PSID pAdministratorsSID = NULL; PSID pGuestsSID = NULL; - DWORD i, dwSize; + DWORD i, dwSize = 0; DWORD dwError = ERROR_SUCCESS; DPRINT("CheckForGuestsAndAdmins(%p %p)\n", hToken, pdwState);
5 years, 8 months
1
0
0
0
[reactos] 09/12: [GLU32] Prevent a warning when comparing 'this' against 0
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6a1c78b37b94954610828…
commit 6a1c78b37b9495461082891bc5cf46bac7f0a0af Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sun Mar 31 10:40:06 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon Apr 1 11:38:32 2019 +0200 [GLU32] Prevent a warning when comparing 'this' against 0 --- dll/opengl/glu32/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dll/opengl/glu32/CMakeLists.txt b/dll/opengl/glu32/CMakeLists.txt index f9e0a4793c..df3a5bb5af 100644 --- a/dll/opengl/glu32/CMakeLists.txt +++ b/dll/opengl/glu32/CMakeLists.txt @@ -121,6 +121,8 @@ set_module_type(glu32 win32dll) if(NOT MSVC) add_target_compile_flags(glu32 "-Wno-write-strings -Wno-unused-but-set-variable") + # Prevent a warning when comparing 'this' against 0 + set_source_files_properties(src/libnurbs/internals/arc.cc PROPERTIES COMPILE_FLAGS "-Wno-nonnull-compare") elseif(USE_CLANG_CL) add_target_compile_flags(glu32 "-Wno-self-assign -Wno-unused-function -Wno-microsoft-include") add_target_compile_flags(glu32 "-Wno-deprecated-register -Wno-tautological-undefined-compare")
5 years, 8 months
1
0
0
0
← Newer
1
...
20
21
22
23
24
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Results per page:
10
25
50
100
200