Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46934 Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/kernel32/file.c | 25 +++++++++++++++++++++++++ dlls/kernel32/kernel32.spec | 4 ++-- dlls/kernel32/tests/file.c | 15 +++++++++++++++ include/winbase.h | 13 +++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 64c3e3e826..97babd77f4 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -2364,6 +2364,31 @@ BOOL WINAPI FindNextFileA( HANDLE handle, WIN32_FIND_DATAA *data ) }
+/************************************************************************** + * FindFirstStreamW (KERNEL32.@) + */ +HANDLE WINAPI FindFirstStreamW(LPCWSTR filename, STREAM_INFO_LEVELS infolevel, + void *data, DWORD flags) +{ + FIXME("(%s, %d, %p, %x): stub!\n", debugstr_w(filename), infolevel, data, flags); + + SetLastError(ERROR_HANDLE_EOF); + return INVALID_HANDLE_VALUE; +} + + +/************************************************************************** + * FindNextStreamW (KERNEL32.@) + */ +BOOL WINAPI FindNextStreamW(HANDLE handle, void *data) +{ + FIXME("(%p, %p): stub!\n", handle, data); + + SetLastError(ERROR_HANDLE_EOF); + return FALSE; +} + + /************************************************************************** * GetFileAttributesW (KERNEL32.@) */ diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 3edfe2194c..75e7cc57e7 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -488,7 +488,7 @@ # @ stub FindFirstFileTransactedW @ stdcall FindFirstFileW(wstr ptr) # @ stub FindFirstStreamTransactedW -# @ stub FindFirstStreamW +@ stdcall FindFirstStreamW(wstr long ptr long) @ stdcall FindFirstVolumeA(ptr long) @ stdcall FindFirstVolumeMountPointA(str ptr long) @ stdcall FindFirstVolumeMountPointW(wstr ptr long) @@ -497,7 +497,7 @@ @ stdcall FindNextFileA(long ptr) # @ stub FindNextFileNameW @ stdcall FindNextFileW(long ptr) -# @ stub FindNextStreamW +@ stdcall FindNextStreamW(long ptr) @ stdcall FindNextVolumeA(long ptr long) @ stub FindNextVolumeMountPointA @ stub FindNextVolumeMountPointW diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 4df31c15c7..355d7a5d4f 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -5314,6 +5314,20 @@ static void test_file_readonly_access(void) ok(ret, "DeleteFileA: error %d\n", GetLastError()); }
+static void test_find_file_stream(void) +{ + WCHAR path[] = {'C',':','\','w','i','n','d','o','w','s',0}; + HANDLE handle; + int error; + WIN32_FIND_STREAM_DATA data; + + SetLastError(0xdeadbeef); + handle = FindFirstStreamW(path, FindStreamInfoStandard, &data, 0); + error = GetLastError(); + ok(handle == INVALID_HANDLE_VALUE, "Expected INVALID_HANDLE_VALUE, got %p\n", handle); + ok(error == ERROR_HANDLE_EOF, "Expected ERROR_HANDLE_EOF, got %d\n", error); +} + START_TEST(file) { char temp_path[MAX_PATH]; @@ -5385,4 +5399,5 @@ START_TEST(file) test_post_completion(); test_overlapped_read(); test_file_readonly_access(); + test_find_file_stream(); } diff --git a/include/winbase.h b/include/winbase.h index 49d0e7ed08..c2e216cb91 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1717,6 +1717,17 @@ typedef struct _UMS_SCHEDULER_STARTUP_INFO typedef enum _RTL_UMS_SCHEDULER_REASON UMS_SCHEDULER_REASON; typedef enum _RTL_UMS_THREAD_INFO_CLASS UMS_THREAD_INFO_CLASS, *PUMS_THREAD_INFO_CLASS;
+typedef enum _STREAM_INFO_LEVELS +{ + FindStreamInfoStandard, + FindStreamInfoMaxInfoLevel +} STREAM_INFO_LEVELS; + +typedef struct _WIN32_FIND_STREAM_DATA { + LARGE_INTEGER StreamSize; + WCHAR cStreamName[MAX_PATH + 36]; +} WIN32_FIND_STREAM_DATA,*PWIN32_FIND_STREAM_DATA; + WINBASEAPI BOOL WINAPI ActivateActCtx(HANDLE,ULONG_PTR *); WINADVAPI BOOL WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID); WINADVAPI BOOL WINAPI AddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID); @@ -2002,10 +2013,12 @@ WINBASEAPI HANDLE WINAPI FindFirstFileExA(LPCSTR,FINDEX_INFO_LEVELS,LPVOID, WINBASEAPI HANDLE WINAPI FindFirstFileExW(LPCWSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD); #define FindFirstFileEx WINELIB_NAME_AW(FindFirstFileEx) WINADVAPI BOOL WINAPI FindFirstFreeAce(PACL,LPVOID*); +WINBASEAPI HANDLE WINAPI FindFirstStreamW(LPCWSTR,STREAM_INFO_LEVELS,void*,DWORD); WINBASEAPI BOOL WINAPI FindNextChangeNotification(HANDLE); WINBASEAPI BOOL WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA); WINBASEAPI BOOL WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW); #define FindNextFile WINELIB_NAME_AW(FindNextFile) +WINBASEAPI BOOL WINAPI FindNextStreamW(HANDLE,void*); WINBASEAPI BOOL WINAPI FindCloseChangeNotification(HANDLE); WINBASEAPI HRSRC WINAPI FindResourceA(HMODULE,LPCSTR,LPCSTR); WINBASEAPI HRSRC WINAPI FindResourceW(HMODULE,LPCWSTR,LPCWSTR); -- 2.21.0