Skip to content

Commit a065b8e

Browse files
committed
replace FindFirstFileW with FindFirstFileExW and regenerate bindings
1 parent 362aec6 commit a065b8e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

std/src/sys/pal/windows/c/bindings.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -2337,7 +2337,9 @@ Windows.Win32.Storage.FileSystem.FileStandardInfo
23372337
Windows.Win32.Storage.FileSystem.FileStorageInfo
23382338
Windows.Win32.Storage.FileSystem.FileStreamInfo
23392339
Windows.Win32.Storage.FileSystem.FindClose
2340-
Windows.Win32.Storage.FileSystem.FindFirstFileW
2340+
Windows.Win32.Storage.FileSystem.FindExInfoBasic
2341+
Windows.Win32.Storage.FileSystem.FindExSearchNameMatch
2342+
Windows.Win32.Storage.FileSystem.FindFirstFileExW
23412343
Windows.Win32.Storage.FileSystem.FindNextFileW
23422344
Windows.Win32.Storage.FileSystem.FlushFileBuffers
23432345
Windows.Win32.Storage.FileSystem.GetFileAttributesW

std/src/sys/pal/windows/c/windows_sys.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ windows_targets::link!("kernel32.dll" "system" fn DeviceIoControl(hdevice : HAND
2626
windows_targets::link!("kernel32.dll" "system" fn DuplicateHandle(hsourceprocesshandle : HANDLE, hsourcehandle : HANDLE, htargetprocesshandle : HANDLE, lptargethandle : *mut HANDLE, dwdesiredaccess : u32, binherithandle : BOOL, dwoptions : DUPLICATE_HANDLE_OPTIONS) -> BOOL);
2727
windows_targets::link!("kernel32.dll" "system" fn ExitProcess(uexitcode : u32) -> !);
2828
windows_targets::link!("kernel32.dll" "system" fn FindClose(hfindfile : HANDLE) -> BOOL);
29-
windows_targets::link!("kernel32.dll" "system" fn FindFirstFileW(lpfilename : PCWSTR, lpfindfiledata : *mut WIN32_FIND_DATAW) -> HANDLE);
29+
windows_targets::link!("kernel32.dll" "system" fn FindFirstFileExW(lpfilename : PCWSTR, finfolevelid : FINDEX_INFO_LEVELS, lpfindfiledata : *mut core::ffi::c_void, fsearchop : FINDEX_SEARCH_OPS, lpsearchfilter : *const core::ffi::c_void, dwadditionalflags : FIND_FIRST_EX_FLAGS) -> HANDLE);
3030
windows_targets::link!("kernel32.dll" "system" fn FindNextFileW(hfindfile : HANDLE, lpfindfiledata : *mut WIN32_FIND_DATAW) -> BOOL);
3131
windows_targets::link!("kernel32.dll" "system" fn FlushFileBuffers(hfile : HANDLE) -> BOOL);
3232
windows_targets::link!("kernel32.dll" "system" fn FormatMessageW(dwflags : FORMAT_MESSAGE_OPTIONS, lpsource : *const core::ffi::c_void, dwmessageid : u32, dwlanguageid : u32, lpbuffer : PWSTR, nsize : u32, arguments : *const *const i8) -> u32);
@@ -2501,6 +2501,9 @@ pub const FILE_WRITE_ATTRIBUTES: FILE_ACCESS_RIGHTS = 256u32;
25012501
pub const FILE_WRITE_DATA: FILE_ACCESS_RIGHTS = 2u32;
25022502
pub const FILE_WRITE_EA: FILE_ACCESS_RIGHTS = 16u32;
25032503
pub const FILE_WRITE_THROUGH: NTCREATEFILE_CREATE_OPTIONS = 2u32;
2504+
pub type FINDEX_INFO_LEVELS = i32;
2505+
pub type FINDEX_SEARCH_OPS = i32;
2506+
pub type FIND_FIRST_EX_FLAGS = u32;
25042507
pub const FIONBIO: i32 = -2147195266i32;
25052508
#[repr(C)]
25062509
#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_arch = "x86_64"))]
@@ -2565,6 +2568,8 @@ pub const FileRenameInfoEx: FILE_INFO_BY_HANDLE_CLASS = 22i32;
25652568
pub const FileStandardInfo: FILE_INFO_BY_HANDLE_CLASS = 1i32;
25662569
pub const FileStorageInfo: FILE_INFO_BY_HANDLE_CLASS = 16i32;
25672570
pub const FileStreamInfo: FILE_INFO_BY_HANDLE_CLASS = 7i32;
2571+
pub const FindExInfoBasic: FINDEX_INFO_LEVELS = 1i32;
2572+
pub const FindExSearchNameMatch: FINDEX_SEARCH_OPS = 0i32;
25682573
pub type GENERIC_ACCESS_RIGHTS = u32;
25692574
pub const GENERIC_ALL: GENERIC_ACCESS_RIGHTS = 268435456u32;
25702575
pub const GENERIC_EXECUTE: GENERIC_ACCESS_RIGHTS = 536870912u32;
@@ -3307,7 +3312,6 @@ pub struct XSAVE_FORMAT {
33073312
pub XmmRegisters: [M128A; 8],
33083313
pub Reserved4: [u8; 224],
33093314
}
3310-
33113315
#[cfg(target_arch = "arm")]
33123316
#[repr(C)]
33133317
pub struct WSADATA {

0 commit comments

Comments
 (0)