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
December 2020
----- 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
17 participants
131 discussions
Start a n
N
ew thread
[reactos] 03/04: [INCLUDE/IDL] Give implicit handles a more unique name
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fab4e82647e0fdae48431…
commit fab4e82647e0fdae484319f72c57ca4083a90dd7 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Thu Nov 26 16:01:08 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 13:14:13 2020 +0100 [INCLUDE/IDL] Give implicit handles a more unique name This avoids duplicated symbols when linking DLLs using more than one client or server stub --- dll/win32/netapi32/wksta_new.c | 2 +- sdk/include/reactos/idl/browser.idl | 2 +- sdk/include/reactos/idl/netdfs.acf | 2 +- sdk/include/reactos/idl/netdfs.idl | 2 +- sdk/include/reactos/idl/netlogon.idl | 2 +- sdk/include/reactos/idl/srvsvc.acf | 2 +- sdk/include/reactos/idl/srvsvc.idl | 2 +- sdk/include/reactos/idl/wkssvc.acf | 2 +- sdk/include/reactos/idl/wkssvc.idl | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dll/win32/netapi32/wksta_new.c b/dll/win32/netapi32/wksta_new.c index 1853b2052a7..4bc96d01dbd 100644 --- a/dll/win32/netapi32/wksta_new.c +++ b/dll/win32/netapi32/wksta_new.c @@ -191,7 +191,7 @@ NetpUnbind( FIXME("NetpUnbind(%p)\n", BindingHandle); - status = RpcBindingFree(&hBinding); + status = RpcBindingFree(&wkssvc_hBinding); if (status) { TRACE("RpcBindingFree returned 0x%x\n", status); diff --git a/sdk/include/reactos/idl/browser.idl b/sdk/include/reactos/idl/browser.idl index 65f2ff8f7ed..52003155294 100644 --- a/sdk/include/reactos/idl/browser.idl +++ b/sdk/include/reactos/idl/browser.idl @@ -133,7 +133,7 @@ typedef struct _BROWSER_STATISTICS_STRUCT #endif endpoint("ncacn_np:[\\pipe\\browser]") #ifndef __midl - ,implicit_handle(handle_t hBinding) + ,implicit_handle(handle_t browser_hBinding) #endif ] interface browser diff --git a/sdk/include/reactos/idl/netdfs.acf b/sdk/include/reactos/idl/netdfs.acf index fc3b35f2821..31bceacf0a4 100644 --- a/sdk/include/reactos/idl/netdfs.acf +++ b/sdk/include/reactos/idl/netdfs.acf @@ -1,5 +1,5 @@ [ - implicit_handle(handle_t hBinding) + implicit_handle(handle_t netdfs_hBinding) ] interface netdfs { diff --git a/sdk/include/reactos/idl/netdfs.idl b/sdk/include/reactos/idl/netdfs.idl index bd4ca88ce03..a1d1016c634 100644 --- a/sdk/include/reactos/idl/netdfs.idl +++ b/sdk/include/reactos/idl/netdfs.idl @@ -346,7 +346,7 @@ typedef struct _DFS_INFO_ENUM_STRUCT #endif endpoint("ncacn_np:[\\pipe\\netdfs]") #ifndef __midl - ,implicit_handle(handle_t hBinding) + ,implicit_handle(handle_t netdfs_hBinding) #endif ] interface netdfs diff --git a/sdk/include/reactos/idl/netlogon.idl b/sdk/include/reactos/idl/netlogon.idl index 808361a00a5..d1e2c8f10ae 100644 --- a/sdk/include/reactos/idl/netlogon.idl +++ b/sdk/include/reactos/idl/netlogon.idl @@ -988,7 +988,7 @@ cpp_quote("#endif") #endif endpoint("ncacn_np:[\\pipe\\netlogon]") #ifndef __midl - ,implicit_handle(handle_t hBinding) + ,implicit_handle(handle_t netlogon_hBinding) #endif ] interface logon diff --git a/sdk/include/reactos/idl/srvsvc.acf b/sdk/include/reactos/idl/srvsvc.acf index 822ee3bfcd3..81122aac71e 100644 --- a/sdk/include/reactos/idl/srvsvc.acf +++ b/sdk/include/reactos/idl/srvsvc.acf @@ -1,5 +1,5 @@ [ - implicit_handle(handle_t hBinding) + implicit_handle(handle_t srvsvc_hBinding) ] interface srvsvc { diff --git a/sdk/include/reactos/idl/srvsvc.idl b/sdk/include/reactos/idl/srvsvc.idl index 4a80140f44e..f1567c67c17 100644 --- a/sdk/include/reactos/idl/srvsvc.idl +++ b/sdk/include/reactos/idl/srvsvc.idl @@ -1060,7 +1060,7 @@ typedef [switch_type(unsigned long)] union _SERVER_ALIAS_INFO pointer_default(unique), endpoint("ncacn_np:[\\pipe\\srvsvc]") #ifndef __midl - ,implicit_handle(handle_t hBinding) + ,implicit_handle(handle_t srvsvc_hBinding) #endif ] interface srvsvc diff --git a/sdk/include/reactos/idl/wkssvc.acf b/sdk/include/reactos/idl/wkssvc.acf index 1f0682b9fe3..c97dbf3d3ca 100644 --- a/sdk/include/reactos/idl/wkssvc.acf +++ b/sdk/include/reactos/idl/wkssvc.acf @@ -1,5 +1,5 @@ [ - implicit_handle(handle_t hBinding) + implicit_handle(handle_t wkssvc_hBinding) ] interface wkssvc { diff --git a/sdk/include/reactos/idl/wkssvc.idl b/sdk/include/reactos/idl/wkssvc.idl index a456795d7dc..3f960f63725 100644 --- a/sdk/include/reactos/idl/wkssvc.idl +++ b/sdk/include/reactos/idl/wkssvc.idl @@ -354,7 +354,7 @@ typedef struct _NET_COMPUTER_NAME_ARRAY pointer_default(unique), endpoint("ncacn_np:[\\pipe\\wkssvc]") #ifndef __midl - ,implicit_handle(handle_t hBinding) + ,implicit_handle(handle_t wkssvc_hBinding) #endif ]
4 years
1
0
0
0
[reactos] 02/04: [CMAKE] Add missing dependencies on PSDK
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=762f3b9d2a68ca9b16292…
commit 762f3b9d2a68ca9b16292aa3bf64254701014bff Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Mon Dec 14 22:38:40 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 13:14:00 2020 +0100 [CMAKE] Add missing dependencies on PSDK --- dll/win32/msxml3r/CMakeLists.txt | 1 + dll/win32/mycomput/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dll/win32/msxml3r/CMakeLists.txt b/dll/win32/msxml3r/CMakeLists.txt index eab0a587596..b36ae2fd6a9 100644 --- a/dll/win32/msxml3r/CMakeLists.txt +++ b/dll/win32/msxml3r/CMakeLists.txt @@ -1,4 +1,5 @@ add_library(msxml3r MODULE msxml3r.rc) +add_dependencies(msxml3r psdk) set_module_type(msxml3r win32dll ENTRYPOINT 0) add_cd_file(TARGET msxml3r DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mycomput/CMakeLists.txt b/dll/win32/mycomput/CMakeLists.txt index add3ffa0839..28050515d77 100644 --- a/dll/win32/mycomput/CMakeLists.txt +++ b/dll/win32/mycomput/CMakeLists.txt @@ -1,7 +1,7 @@ add_library(mycomput MODULE mycomput.rc) - +add_dependencies(mycomput psdk) set_module_type(mycomput win32dll UNICODE ENTRYPOINT 0) add_cd_file(TARGET mycomput DESTINATION reactos/system32 FOR all)
4 years
1
0
0
0
[reactos] 01/04: [LIBXSLT] Fix public variable declarations when using clang-cl
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=988c682e8c324d28e4c6b…
commit 988c682e8c324d28e4c6b4982e0cbf39bdf4027f Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Wed Nov 25 10:41:52 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 12:25:55 2020 +0100 [LIBXSLT] Fix public variable declarations when using clang-cl --- sdk/include/reactos/libs/libxslt/xsltexports.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/include/reactos/libs/libxslt/xsltexports.h b/sdk/include/reactos/libs/libxslt/xsltexports.h index 99b6ac387c1..aac59e1d7a3 100644 --- a/sdk/include/reactos/libs/libxslt/xsltexports.h +++ b/sdk/include/reactos/libs/libxslt/xsltexports.h @@ -51,7 +51,11 @@ #undef XSLTCALL #if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) #define XSLTPUBFUN __declspec(dllexport) - #define XSLTPUBVAR __declspec(dllexport) + #ifndef __clang__ + #define XSLTPUBVAR __declspec(dllexport) + #else + #define XSLTPUBVAR __declspec(dllexport) extern + #endif #else #define XSLTPUBFUN #if !defined(LIBXSLT_STATIC)
4 years
1
0
0
0
[reactos] 01/01: [NTOS/FSRTL] Implement FsRtlAcquireToCreateMappedSection using filter callbacks
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bd0445dbf21ec930d235d…
commit bd0445dbf21ec930d235d30b4d8397b5348e37c7 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Mon Nov 16 09:24:58 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 11:37:53 2020 +0100 [NTOS/FSRTL] Implement FsRtlAcquireToCreateMappedSection using filter callbacks --- ntoskrnl/fsrtl/fastio.c | 54 ++++++++++++++++++++++++++++++++++++++- ntoskrnl/include/internal/fsrtl.h | 8 ++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/fsrtl/fastio.c b/ntoskrnl/fsrtl/fastio.c index c9ff2f03752..a056b67e109 100644 --- a/ntoskrnl/fsrtl/fastio.c +++ b/ntoskrnl/fsrtl/fastio.c @@ -1561,15 +1561,55 @@ FsRtlAcquireFileExclusiveCommon(IN PFILE_OBJECT FileObject, PFSRTL_COMMON_FCB_HEADER FcbHeader; PDEVICE_OBJECT DeviceObject; PFAST_IO_DISPATCH FastDispatch; + PEXTENDED_DRIVER_EXTENSION DriverExtension; + PFS_FILTER_CALLBACKS FilterCallbacks; /* Get Device Object and Fast Calls */ FcbHeader = (PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext; DeviceObject = IoGetRelatedDeviceObject(FileObject); - FastDispatch = DeviceObject->DriverObject->FastIoDispatch; /* Get master FsRtl lock */ FsRtlEnterFileSystem(); + DriverExtension = (PEXTENDED_DRIVER_EXTENSION)DeviceObject->DriverObject->DriverExtension; + FilterCallbacks = DriverExtension->FsFilterCallbacks; + + /* Check if Filter Cllbacks are supported */ + if (FilterCallbacks && FilterCallbacks->PreAcquireForSectionSynchronization) + { + NTSTATUS Status; + PVOID CompletionContext; + + FS_FILTER_CALLBACK_DATA CbData; + + RtlZeroMemory(&CbData, sizeof(CbData)); + + CbData.SizeOfFsFilterCallbackData = sizeof(CbData); + CbData.Operation = FS_FILTER_ACQUIRE_FOR_SECTION_SYNCHRONIZATION; + CbData.DeviceObject = DeviceObject; + CbData.FileObject = FileObject; + CbData.Parameters.AcquireForSectionSynchronization.PageProtection = Reserved; + CbData.Parameters.AcquireForSectionSynchronization.SyncType = SyncType; + + Status = FilterCallbacks->PreAcquireForSectionSynchronization(&CbData, &CompletionContext); + if (!NT_SUCCESS(Status)) + { + FsRtlExitFileSystem(); + return Status; + } + + /* Should we do something in-between ? */ + + if (FilterCallbacks->PostAcquireForSectionSynchronization) + { + FilterCallbacks->PostAcquireForSectionSynchronization(&CbData, Status, CompletionContext); + } + + return Status; + } + + FastDispatch = DeviceObject->DriverObject->FastIoDispatch; + /* Check if Fast Calls are supported, and check AcquireFileForNtCreateSection */ if (FastDispatch && FastDispatch->AcquireFileForNtCreateSection) @@ -1599,6 +1639,18 @@ FsRtlAcquireFileExclusive(IN PFILE_OBJECT FileObject) (VOID)FsRtlAcquireFileExclusiveCommon(FileObject, SyncTypeOther, 0); } +/* + * @implemented + */ +NTSTATUS +NTAPI +FsRtlAcquireToCreateMappedSection(_In_ PFILE_OBJECT FileObject, + _In_ ULONG SectionPageProtection) +{ + PAGED_CODE(); + + return FsRtlAcquireFileExclusiveCommon(FileObject, SyncTypeCreateSection, SectionPageProtection); +} /* * @implemented */ diff --git a/ntoskrnl/include/internal/fsrtl.h b/ntoskrnl/include/internal/fsrtl.h index 6e65bd78886..79cc3b6cfbc 100644 --- a/ntoskrnl/include/internal/fsrtl.h +++ b/ntoskrnl/include/internal/fsrtl.h @@ -140,3 +140,11 @@ FsRtlInitSystem( // extern PERESOURCE FsRtlPagingIoResources; extern PAGED_LOOKASIDE_LIST FsRtlFileLockLookasideList; + +// +// File locking routine +// +NTSTATUS +NTAPI +FsRtlAcquireToCreateMappedSection(_In_ PFILE_OBJECT FileObject, + _In_ ULONG SectionPageProtection);
4 years
1
0
0
0
[reactos] 01/01: [KMTEST] Test what happens when CcSetFileSizes is called with data still mapped at the tail od the file
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6929451500abaa7fadbb1…
commit 6929451500abaa7fadbb1c58de102a792e7ae27e Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Mon Nov 9 10:37:10 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 11:35:30 2020 +0100 [KMTEST] Test what happens when CcSetFileSizes is called with data still mapped at the tail od the file --- .../rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c | 23 ++++++++++++++++++++-- .../rostests/kmtests/ntos_cc/CcSetFileSizes_user.c | 3 ++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c b/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c index 3d23ab54bec..241312c12c5 100644 --- a/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c +++ b/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_drv.c @@ -178,7 +178,7 @@ PerformTest( Fcb->Header.FileSize.QuadPart = VACB_MAPPING_GRANULARITY - PAGE_SIZE; Fcb->Header.ValidDataLength.QuadPart = VACB_MAPPING_GRANULARITY - PAGE_SIZE; - if ((TestId > 1 && TestId < 4) || TestId == 5) + if ((TestId > 1 && TestId < 4) || TestId >= 5) { Fcb->Header.AllocationSize.QuadPart = VACB_MAPPING_GRANULARITY - PAGE_SIZE; } @@ -315,6 +315,25 @@ PerformTest( } } } + else if (TestId == 6) + { + Offset.QuadPart = 0; + KmtStartSeh(); + Ret = CcMapData(TestFileObject, &Offset, VACB_MAPPING_GRANULARITY - PAGE_SIZE, MAP_WAIT, &Bcb, (PVOID *)&Buffer); + KmtEndSeh(STATUS_SUCCESS); + + if (!skip(Ret == TRUE, "CcMapData failed\n")) + { + ok_eq_ulong(Buffer[(VACB_MAPPING_GRANULARITY - PAGE_SIZE - sizeof(ULONG)) / sizeof(ULONG)], 0xBABABABA); + } + + KmtStartSeh(); + CcSetFileSizes(TestFileObject, &NewFileSizes); + KmtEndSeh(STATUS_SUCCESS); + + if (Ret == TRUE) + CcUnpinData(Bcb); + } } } } @@ -379,7 +398,7 @@ TestMessageHandler( ok_eq_ulong((ULONG)InLength, sizeof(ULONG)); PerformTest(*(PULONG)Buffer, DeviceObject); break; - + case IOCTL_FINISH_TEST: ok_eq_ulong((ULONG)InLength, sizeof(ULONG)); CleanupTest(*(PULONG)Buffer, DeviceObject); diff --git a/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_user.c b/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_user.c index d472c5ecc98..67bcc1df89e 100644 --- a/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_user.c +++ b/modules/rostests/kmtests/ntos_cc/CcSetFileSizes_user.c @@ -24,8 +24,9 @@ START_TEST(CcSetFileSizes) * 3: copy read - FS & AS * 4: dirty VACB - only FS * 5: dirty VACB - FS & AS + * 6: CcSetFileSizes with mapped data at tail of file */ - for (TestId = 0; TestId < 6; ++TestId) + for (TestId = 0; TestId < 7; ++TestId) { Ret = KmtSendUlongToDriver(IOCTL_START_TEST, TestId); ok(Ret == ERROR_SUCCESS, "KmtSendUlongToDriver failed: %lx\n", Ret);
4 years
1
0
0
0
[reactos] 03/03: [FASTFAT_NEW] Fix ReactOS compiler workaround
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9e6866402b6ac6ec49f20…
commit 9e6866402b6ac6ec49f201afabe2a3c9f8cc702d Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Tue Dec 1 17:51:15 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 11:08:21 2020 +0100 [FASTFAT_NEW] Fix ReactOS compiler workaround --- drivers/filesystems/fastfat_new/allocsup.c | 224 ++++++++++++++--------------- 1 file changed, 112 insertions(+), 112 deletions(-) diff --git a/drivers/filesystems/fastfat_new/allocsup.c b/drivers/filesystems/fastfat_new/allocsup.c index 38c06bea2ac..c29a1efcb13 100644 --- a/drivers/filesystems/fastfat_new/allocsup.c +++ b/drivers/filesystems/fastfat_new/allocsup.c @@ -288,7 +288,7 @@ Routine Description: 1. First window with >50% free clusters 2. First empty window 3. Window with greatest number of free clusters. - + Arguments: Vcb - Supplies the Vcb for the volume @@ -305,17 +305,17 @@ Return Value: ULONG ClustersPerWindow = MAX_CLUSTER_BITMAP_SIZE; NT_ASSERT( 1 != Vcb->NumberOfWindows); - + for (i = 0; i < Vcb->NumberOfWindows; i++) { if (Vcb->Windows[i].ClustersFree == ClustersPerWindow) { - + if (-1 == FirstEmpty) { - + // // Keep note of the first empty window on the disc // - + FirstEmpty = i; } } @@ -324,7 +324,7 @@ Return Value: // // This window has the most free clusters, so far // - + MaxFree = Vcb->Windows[i].ClustersFree; Fave = i; @@ -332,9 +332,9 @@ Return Value: // If this window has >50% free clusters, then we will take it, // so don't bother considering more windows. // - + if (MaxFree >= (ClustersPerWindow >> 1)) { - + break; } } @@ -345,7 +345,7 @@ Return Value: // first empty window on the disc, if any - otherwise we'll just go with // the one with the most free clusters. // - + if ((MaxFree < (ClustersPerWindow >> 1)) && (-1 != FirstEmpty)) { Fave = FirstEmpty; @@ -354,7 +354,7 @@ Return Value: return Fave; } - + VOID FatSetupAllocationSupport ( IN PIRP_CONTEXT IrpContext, @@ -544,7 +544,7 @@ Arguments: return; } - + VOID FatTearDownAllocationSupport ( IN PIRP_CONTEXT IrpContext, @@ -613,8 +613,8 @@ Return Value: return; } - -_Requires_lock_held_(_Global_critical_region_) + +_Requires_lock_held_(_Global_critical_region_) VOID FatLookupFileAllocation ( IN PIRP_CONTEXT IrpContext, @@ -934,7 +934,7 @@ Arguments: *Allocated = FALSE; FcbOrDcb->Header.AllocationSize.QuadPart = CurrentVbo; - + DebugTrace( 0, Dbg, "New file allocation size = %08lx.\n", CurrentVbo); try_return ( NOTHING ); } @@ -1077,8 +1077,8 @@ Arguments: return; } - -_Requires_lock_held_(_Global_critical_region_) + +_Requires_lock_held_(_Global_critical_region_) VOID FatAddFileAllocation ( IN PIRP_CONTEXT IrpContext, @@ -1170,7 +1170,7 @@ Arguments: LBO FirstLboOfFile; NT_ASSERT( FcbOrDcb->FcbCondition == FcbGood ); - + FatGetDirentFromFcbOrDcb( IrpContext, FcbOrDcb, FALSE, @@ -1485,7 +1485,7 @@ Return Value: // // Inspired by a Prefix complaint. // - + NT_ASSERT( FcbOrDcb->FcbCondition == FcbGood ); // @@ -1538,7 +1538,7 @@ Return Value: DebugTrace(0, Dbg, "Desired size equals current allocation.\n", 0); DebugTrace(-1, Dbg, "FatTruncateFileAllocation -> (VOID)\n", 0); - return; + return; } UnwindInitialAllocationSize = FcbOrDcb->Header.AllocationSize.LowPart; @@ -1572,7 +1572,7 @@ Return Value: // NT_ASSERT( FcbOrDcb->FcbCondition == FcbGood ); - + FatGetDirentFromFcbOrDcb( IrpContext, FcbOrDcb, FALSE, &Dirent, &Bcb ); Dirent->FirstClusterOfFile = 0; @@ -1679,8 +1679,8 @@ Return Value: } _SEH2_END; } - -_Requires_lock_held_(_Global_critical_region_) + +_Requires_lock_held_(_Global_critical_region_) VOID FatLookupFileAllocationSize ( IN PIRP_CONTEXT IrpContext, @@ -1739,8 +1739,8 @@ Arguments: return; } - -_Requires_lock_held_(_Global_critical_region_) + +_Requires_lock_held_(_Global_critical_region_) VOID FatAllocateDiskSpace ( IN PIRP_CONTEXT IrpContext, @@ -1875,7 +1875,7 @@ Arguments: // // Make sure there are enough free clusters to start with, and - // take them now so that nobody else takes them from us. + // take them now so that nobody else takes them from us. // ExAcquireResourceSharedLite(&Vcb->ChangeBitMapResource, TRUE); @@ -1922,8 +1922,8 @@ Arguments: // Drop our shared lock on the ChangeBitMapResource, and pick it up again // exclusive in preparation for making the window swap. // - - FatUnlockFreeClusterBitMap(Vcb); + + FatUnlockFreeClusterBitMap(Vcb); ExReleaseResourceLite(&Vcb->ChangeBitMapResource); ExAcquireResourceExclusiveLite(&Vcb->ChangeBitMapResource, TRUE); FatLockFreeClusterBitMap(Vcb); @@ -1932,12 +1932,12 @@ Arguments: // // Again, test the current window against the one we want - some other - // thread could have sneaked in behind our backs and kindly set it to the one + // thread could have sneaked in behind our backs and kindly set it to the one // we need, when we dropped and reacquired the ChangeBitMapResource above. // - + if (Window != Vcb->CurrentWindow) { - + _SEH2_TRY { Wait = BooleanFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT); @@ -1947,7 +1947,7 @@ Arguments: // Change to the new window (update Vcb->CurrentWindow) and scan it // to build up a freespace bitmap etc. // - + FatExamineFatEntries( IrpContext, Vcb, 0, 0, @@ -2004,7 +2004,7 @@ Arguments: // // NOTE: Clusterhint in the Vcb is not guaranteed to be set (may be -1) // - + WindowRelativeHint = Vcb->ClusterHint; AbsoluteClusterHint = 0; @@ -2130,7 +2130,7 @@ Arguments: // it'll get converted into a true cluster number and put in Cluster, which // will be a volume relative true cluster number. // - + ULONG Index = 0; ULONG Cluster = 0; ULONG CurrentVbo = 0; @@ -2147,7 +2147,7 @@ Arguments: // Drop our shared lock on the ChangeBitMapResource, and pick it up again // exclusive in preparation for making a window swap. // - + FatUnlockFreeClusterBitMap(Vcb); ExReleaseResourceLite(&Vcb->ChangeBitMapResource); ExAcquireResourceExclusiveLite(&Vcb->ChangeBitMapResource, TRUE); @@ -2279,11 +2279,11 @@ Arguments: if ((0 == WindowRelativeHint) && (0 == ClustersFound)) { if (ClustersRemaining <= Vcb->CurrentWindow->ClustersFree) { - + // - // The remaining allocation could be satisfied entirely from this + // The remaining allocation could be satisfied entirely from this // window. We will ask only for what we need, to try and avoid - // unnecessarily fragmenting large runs of space by always using + // unnecessarily fragmenting large runs of space by always using // (part of) the largest run we can find. This call will return the // first run large enough. // @@ -2291,19 +2291,19 @@ Arguments: Index = RtlFindClearBits( &Vcb->FreeClusterBitMap, ClustersRemaining, 0); if (-1 != Index) { - + ClustersFound = ClustersRemaining; } } if (0 == ClustersFound) { - + // // Still nothing, so just take the largest free run we can find. // - + ClustersFound = RtlFindLongestRunClear( &Vcb->FreeClusterBitMap, &Index ); - + } #if DBG PreviousClear = RtlNumberOfClearBits( &Vcb->FreeClusterBitMap ); @@ -2366,7 +2366,7 @@ Arguments: ) { FaveWindow = NextWindow; - SelectedWindow = TRUE; + SelectedWindow = TRUE; } else { @@ -2394,7 +2394,7 @@ Arguments: // // Select a new window to begin allocating from // - + FaveWindow = FatSelectBestWindow( Vcb); } @@ -2403,8 +2403,8 @@ Arguments: // if (0 == Vcb->Windows[ FaveWindow].ClustersFree) { - -#ifdef _MSC_VER + +#ifdef _MSC_VER #pragma prefast( suppress: 28159, "we bugcheck here because our internal data structures are seriously corrupted if this happens" ) #endif FatBugCheck( 0, 5, 1 ); @@ -2445,7 +2445,7 @@ Arguments: FatReserveClusters( IrpContext, Vcb, (Index + 2), ClustersFound ); Cluster = Index + Window->FirstCluster; - + Window->ClustersFree -= ClustersFound; NT_ASSERT( PreviousClear - ClustersFound == Window->ClustersFree ); @@ -2593,7 +2593,7 @@ Arguments: return; } - + // // Limit our zeroing writes to 1 MB. @@ -2607,7 +2607,7 @@ FatDeallocateDiskSpace ( IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PLARGE_MCB Mcb, - IN BOOLEAN ZeroOnDeallocate + IN BOOLEAN ZeroOnDeallocate ) /*++ @@ -2697,7 +2697,7 @@ Return Value: KeInitializeEvent( &IoEvent, NotificationEvent, FALSE ); - + for ( McbIndex = 0; McbIndex < RunsInMcb; McbIndex++ ) { FatGetNextMcbEntry( Vcb, Mcb, McbIndex, &Vbo, &Lbo, &ByteCount ); @@ -2713,7 +2713,7 @@ Return Value: // if (ByteCount > MAX_ZERO_MDL_SIZE) { - Mdl = FatBuildZeroMdl( IrpContext, MAX_ZERO_MDL_SIZE); + Mdl = FatBuildZeroMdl( IrpContext, MAX_ZERO_MDL_SIZE); } else { Mdl = FatBuildZeroMdl( IrpContext, ByteCount); } @@ -2765,7 +2765,7 @@ Return Value: &Iosb ); if (IoIrp == NULL) { - NT_ASSERT( FALSE ); + NT_ASSERT( FALSE ); ZeroingStatus = STATUS_INSUFFICIENT_RESOURCES; goto try_exit2; } @@ -2792,14 +2792,14 @@ Return Value: } if (!NT_SUCCESS( ZeroingStatus )) { - NT_ASSERT( FALSE ); + NT_ASSERT( FALSE ); goto try_exit2; } // // Increment the starting offset where we will zero. // - + Lbo += MdlSizeMapped; // @@ -2811,13 +2811,13 @@ Return Value: if (ByteCountToZero < MdlSizeMapped) { MdlSizeMapped = ByteCountToZero; } - + } - + try_exit2: - + NOTHING; - + } _SEH2_FINALLY { if (!FlagOn( Mdl->MdlFlags, MDL_SOURCE_IS_NONPAGED_POOL) && @@ -2827,22 +2827,22 @@ Return Value: } IoFreeMdl( Mdl ); } _SEH2_END; - - } + + } try_exit: NOTHING; - + } _SEH2_EXCEPT(FatExceptionFilter( NULL, _SEH2_GetExceptionInformation() )) { - + // - // If we failed to zero for some reason, still go ahead and deallocate + // If we failed to zero for some reason, still go ahead and deallocate // the clusters. Otherwise we'll leak space from the volume. // - + ZeroingStatus = _SEH2_GetExceptionCode(); - + } _SEH2_END; } @@ -3155,7 +3155,7 @@ Return Value: return; } - + _Requires_lock_held_(_Global_critical_region_) VOID FatSplitAllocation ( @@ -3225,7 +3225,7 @@ Return Value: ULONG ByteCount; -#if DBG +#if DBG ULONG BytesPerCluster; #endif @@ -3237,7 +3237,7 @@ Return Value: DebugTrace( 0, Dbg, " SplitAtVbo = %8lx\n", SplitAtVbo); DebugTrace( 0, Dbg, " RemainingMcb = %p\n", RemainingMcb); -#if DBG +#if DBG BytesPerCluster = 1 << Vcb->AllocationSupport.LogOfBytesPerCluster; #endif @@ -3341,8 +3341,8 @@ Return Value: return; } - -_Requires_lock_held_(_Global_critical_region_) + +_Requires_lock_held_(_Global_critical_region_) VOID FatMergeAllocation ( IN PIRP_CONTEXT IrpContext, @@ -3464,7 +3464,7 @@ Return Value: return; } - + // // Internal support routine // @@ -3556,7 +3556,7 @@ Return Value: } } - + // // Internal support routine // @@ -3744,7 +3744,7 @@ Arguments: return; } - + _Requires_lock_held_(_Global_critical_region_) VOID FatSetFatEntry ( @@ -4130,7 +4130,7 @@ Arguments: return; } - + // // Internal support routine // @@ -4646,7 +4646,7 @@ Return Value: return; } - + // // Internal support routine // @@ -4705,7 +4705,7 @@ Return Value: DebugTrace( 0, Dbg, "Received non power of 2.\n", 0); DebugTrace(-1, Dbg, "LogOf -> %8lx\n", Log); - + #ifdef _MSC_VER #pragma prefast( suppress: 28159, "we bugcheck here because our internal data structures are seriously corrupted if this happens" ) #endif @@ -4715,7 +4715,7 @@ Return Value: return Log; } - + VOID FatExamineFatEntries( IN PIRP_CONTEXT IrpContext, @@ -4818,14 +4818,14 @@ Return Value: // // FAT32: Calculate the number of FAT entries covered by a window. This is - // equal to the number of bits in the freespace bitmap, the size of which + // equal to the number of bits in the freespace bitmap, the size of which // is hardcoded. // - + EntriesPerWindow = MAX_CLUSTER_BITMAP_SIZE; - + } else { - + EntriesPerWindow = Vcb->AllocationSupport.NumberOfClusters; } @@ -4924,44 +4924,44 @@ Return Value: // // Pick up the initial chunk of the FAT and first entry. // - + if (FatIndexBitSize == 12) { - + // // We read in the entire fat in the 12 bit case. // - + FatReadVolumeFile( IrpContext, Vcb, FatReservedBytes( &Vcb->Bpb ), FatBytesPerFat( &Vcb->Bpb ), &Bcb, (PVOID *)&FatBuffer ); - + FatLookup12BitEntry(FatBuffer, 0, &FirstFatEntry); - + } else { - + // // Read in one page of fat at a time. We cannot read in the // all of the fat we need because of cache manager limitations. // - + ULONG BytesPerEntry = FatIndexBitSize >> 3; - + FatPages = (FatReservedBytes(&Vcb->Bpb) + FatBytesPerFat(&Vcb->Bpb) + (PAGE_SIZE - 1)) / PAGE_SIZE; Page = (FatReservedBytes(&Vcb->Bpb) + StartIndex * BytesPerEntry) / PAGE_SIZE; - + Offset = Page * PAGE_SIZE; - + // // Prefetch the FAT entries in memory for optimal performance. // - + PrefetchPages = FatPages - Page; - + if (PrefetchPages > FAT_PREFETCH_PAGE_COUNT) { - + PrefetchPages = ALIGN_UP_BY(Page, FAT_PREFETCH_PAGE_COUNT) - Page; } @@ -4978,33 +4978,33 @@ Return Value: PAGE_SIZE, &Bcb, &pv); - + if (FatIndexBitSize == 32) { - + FatBuffer = (PUSHORT)((PUCHAR)pv + (FatReservedBytes(&Vcb->Bpb) + StartIndex * BytesPerEntry) % PAGE_SIZE); - + FirstFatEntry = *((PULONG)FatBuffer); FirstFatEntry = FirstFatEntry & FAT32_ENTRY_MASK; - + } else { - + FatBuffer = (PUSHORT)((PUCHAR)pv + FatReservedBytes(&Vcb->Bpb) % PAGE_SIZE) + 2; - + FirstFatEntry = *FatBuffer; } - + } - + ClusterSize = 1 << (Vcb->AllocationSupport.LogOfBytesPerCluster); - + CurrentRun = (FirstFatEntry == FAT_CLUSTER_AVAILABLE) ? FreeClusters : AllocatedClusters; - + StartIndexOfThisRun = StartIndex; - + for (FatIndex = StartIndex; FatIndex <= EndIndex; FatIndex++) { if (FatIndexBitSize == 12) { @@ -5105,8 +5105,8 @@ Return Value: FatEntry = *((PULONG)FatBuffer)++; FatEntry = FatEntry & FAT32_ENTRY_MASK; #else - FatEntry = *FatBuffer; - FatBuffer += 1; + FatEntry = *((PULONG)FatBuffer); + FatBuffer += 2; /* PUSHORT FatBuffer */ FatEntry = FatEntry & FAT32_ENTRY_MASK; #endif @@ -5173,14 +5173,14 @@ Return Value: // If the entry is marked bad, add it to the bad block MCB // - if ((SetupWindows || (Vcb->NumberOfWindows == 1)) && + if ((SetupWindows || (Vcb->NumberOfWindows == 1)) && (FatInterpretClusterType( Vcb, FatEntry ) == FatClusterBad)) { - + // // This cluster is marked bad. // Add it to the BadBlockMcb. - // - + // + Lbo = FatGetLboFromIndex( Vcb, FatIndex ); FatAddMcbEntry( Vcb, &Vcb->BadBlockMcb, BadClusterVbo, Lbo, ClusterSize ); BadClusterVbo += ClusterSize; @@ -5190,9 +5190,9 @@ Return Value: // // If we finished the scan, then we know about all the possible bad clusters. // - + SetFlag( Vcb->VcbState, VCB_STATE_FLAG_BAD_BLOCKS_POPULATED); - + // // Now we have to record the final run we encountered //
4 years
1
0
0
0
[reactos] 02/03: [FASTFAT_NEW] Tune compile options and definitions for debugging
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=57cf5cdc5d0896ca537f6…
commit 57cf5cdc5d0896ca537f6ffeb3b4bc2b56a325b7 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Mon Nov 30 14:17:41 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 11:08:06 2020 +0100 [FASTFAT_NEW] Tune compile options and definitions for debugging --- drivers/filesystems/fastfat_new/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/filesystems/fastfat_new/CMakeLists.txt b/drivers/filesystems/fastfat_new/CMakeLists.txt index 7abdce95302..c425ff0ad3e 100644 --- a/drivers/filesystems/fastfat_new/CMakeLists.txt +++ b/drivers/filesystems/fastfat_new/CMakeLists.txt @@ -38,6 +38,9 @@ list(APPEND SOURCE add_library(fastfat MODULE ${SOURCE} fastfat.rc) set_module_type(fastfat kernelmodedriver) target_link_libraries(fastfat ${PSEH_LIB} memcmp) +if(GDB AND NOT CLANG) + target_compile_options(fastfat PRIVATE -O0) +endif() add_importlibs(fastfat ntoskrnl hal) add_pch(fastfat fatprocs.h SOURCE) add_cd_file(TARGET fastfat DESTINATION reactos/system32/drivers NO_CAB FOR all)
4 years
1
0
0
0
[reactos] 01/03: [FASTFAT_NEW] Fix build
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=db34250b03344ee8940b0…
commit db34250b03344ee8940b0257ba1956266bf637ec Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Mon Nov 30 14:15:37 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 11:07:54 2020 +0100 [FASTFAT_NEW] Fix build --- drivers/filesystems/fastfat_new/allocsup.c | 6 ++++-- drivers/filesystems/fastfat_new/fatinit.c | 4 ---- drivers/filesystems/fastfat_new/strucsup.c | 12 ++++++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/filesystems/fastfat_new/allocsup.c b/drivers/filesystems/fastfat_new/allocsup.c index 4f7f8b20a43..38c06bea2ac 100644 --- a/drivers/filesystems/fastfat_new/allocsup.c +++ b/drivers/filesystems/fastfat_new/allocsup.c @@ -271,10 +271,12 @@ FatLogOf( #pragma alloc_text(PAGE, FatTruncateFileAllocation) #endif - +#ifdef __REACTOS__ +static +#endif INLINE ULONG -FatSelectBestWindow( +FatSelectBestWindow( IN PVCB Vcb ) /*++ diff --git a/drivers/filesystems/fastfat_new/fatinit.c b/drivers/filesystems/fastfat_new/fatinit.c index 09df201769f..1da067f72f3 100644 --- a/drivers/filesystems/fastfat_new/fatinit.c +++ b/drivers/filesystems/fastfat_new/fatinit.c @@ -15,10 +15,6 @@ Abstract: #include "fatprocs.h" -#ifdef __REACTOS__ -#define _Unreferenced_parameter_ -#endif - DRIVER_INITIALIZE DriverEntry; NTSTATUS diff --git a/drivers/filesystems/fastfat_new/strucsup.c b/drivers/filesystems/fastfat_new/strucsup.c index 4513be8dcb4..1efb143706d 100644 --- a/drivers/filesystems/fastfat_new/strucsup.c +++ b/drivers/filesystems/fastfat_new/strucsup.c @@ -51,6 +51,9 @@ Abstract: #define FAT_FILL_FREE 0 +#ifdef __REACTOS__ +static +#endif INLINE PCCB FatAllocateCcb ( @@ -59,6 +62,9 @@ FatAllocateCcb ( return (PCCB) FsRtlAllocatePoolWithTag( PagedPool, sizeof(CCB), TAG_CCB ); } +#ifdef __REACTOS__ +static +#endif INLINE VOID FatFreeCcb ( @@ -72,6 +78,9 @@ FatFreeCcb ( ExFreePool( Ccb ); } +#ifdef __REACTOS__ +static +#endif INLINE PFCB FatAllocateFcb ( @@ -80,6 +89,9 @@ FatAllocateFcb ( return (PFCB) FsRtlAllocatePoolWithTag( PagedPool, sizeof(FCB), TAG_FCB ); } +#ifdef __REACTOS__ +static +#endif INLINE VOID FatFreeFcb (
4 years
1
0
0
0
[reactos] 01/01: [NTOS:IO] Validate input parameters in NtQueryDirectoryFile
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef4c7ae978a6937442854…
commit ef4c7ae978a6937442854ead4a1a1c942f1edcd2 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Thu Dec 10 11:30:01 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 11:06:38 2020 +0100 [NTOS:IO] Validate input parameters in NtQueryDirectoryFile It turns out this is not the job of the FS driver --- ntoskrnl/io/iomgr/iofunc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c index 62c7799e47a..80814a70ba3 100644 --- a/ntoskrnl/io/iomgr/iofunc.c +++ b/ntoskrnl/io/iomgr/iofunc.c @@ -2052,6 +2052,26 @@ NtQueryDirectoryFile(IN HANDLE FileHandle, _SEH2_END; } + /* Check input parameters */ + + switch (FileInformationClass) + { +#define CHECK_LENGTH(class, struct) \ + case class: \ + if (Length < sizeof(struct)) \ + return STATUS_INFO_LENGTH_MISMATCH; \ + break + CHECK_LENGTH(FileDirectoryInformation, FILE_DIRECTORY_INFORMATION); + CHECK_LENGTH(FileFullDirectoryInformation, FILE_FULL_DIR_INFORMATION); + CHECK_LENGTH(FileIdFullDirectoryInformation, FILE_ID_FULL_DIR_INFORMATION); + CHECK_LENGTH(FileNamesInformation, FILE_NAMES_INFORMATION); + CHECK_LENGTH(FileBothDirectoryInformation, FILE_BOTH_DIR_INFORMATION); + CHECK_LENGTH(FileIdBothDirectoryInformation, FILE_ID_BOTH_DIR_INFORMATION); + default: + break; +#undef CHECK_LENGTH + } + /* Get File Object */ Status = ObReferenceObjectByHandle(FileHandle, FILE_LIST_DIRECTORY,
4 years
1
0
0
0
[reactos] 01/01: [NTOS:IO] Do not set Shared property of the file if we are failing in IoCheckShareAccess
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1d1dba51db2208e300570…
commit 1d1dba51db2208e300570c58ffe2272e0c34a1a8 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Mon Dec 14 15:51:15 2020 +0100 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Tue Dec 22 11:05:00 2020 +0100 [NTOS:IO] Do not set Shared property of the file if we are failing in IoCheckShareAccess --- ntoskrnl/io/iomgr/file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ntoskrnl/io/iomgr/file.c b/ntoskrnl/io/iomgr/file.c index 5004938c099..548c7f28db7 100644 --- a/ntoskrnl/io/iomgr/file.c +++ b/ntoskrnl/io/iomgr/file.c @@ -3429,11 +3429,6 @@ IoCheckShareAccess(IN ACCESS_MASK DesiredAccess, SharedWrite = (DesiredShareAccess & FILE_SHARE_WRITE) != 0; SharedDelete = (DesiredShareAccess & FILE_SHARE_DELETE) != 0; - /* Set them */ - FileObject->SharedRead = SharedRead; - FileObject->SharedWrite = SharedWrite; - FileObject->SharedDelete = SharedDelete; - /* Check if the shared access is violated */ if ((ReadAccess && (ShareAccess->SharedRead < ShareAccess->OpenCount)) || @@ -3449,6 +3444,11 @@ IoCheckShareAccess(IN ACCESS_MASK DesiredAccess, return STATUS_SHARING_VIOLATION; } + /* Set them */ + FileObject->SharedRead = SharedRead; + FileObject->SharedWrite = SharedWrite; + FileObject->SharedDelete = SharedDelete; + /* It's not, check if caller wants us to update it */ if (Update) {
4 years
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
14
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Results per page:
10
25
50
100
200