Commit fd8fae10 authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

kernel32: Improve stub for SetFileInformationByHandle.

parent 82d090dd
......@@ -1040,12 +1040,50 @@ BOOL WINAPI SetEndOfFile( HANDLE hFile )
return FALSE;
}
/***********************************************************************
* SetFileInformationByHandle (KERNEL32.@)
*/
BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS class, VOID *info, DWORD size )
{
FIXME("%p %u %p %u - stub\n", file, class, info, size);
return FALSE;
TRACE( "%p %u %p %u\n", file, class, info, size );
switch (class)
{
case FileBasicInfo:
case FileNameInfo:
case FileRenameInfo:
case FileDispositionInfo:
case FileAllocationInfo:
case FileEndOfFileInfo:
case FileStreamInfo:
case FileIdBothDirectoryInfo:
case FileIdBothDirectoryRestartInfo:
case FileIoPriorityHintInfo:
case FileFullDirectoryInfo:
case FileFullDirectoryRestartInfo:
case FileStorageInfo:
case FileAlignmentInfo:
case FileIdInfo:
case FileIdExtdDirectoryInfo:
case FileIdExtdDirectoryRestartInfo:
FIXME( "%p, %u, %p, %u\n", file, class, info, size );
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return FALSE;
case FileStandardInfo:
case FileCompressionInfo:
case FileAttributeTagInfo:
case FileRemoteProtocolInfo:
default:
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
return TRUE;
}
/***********************************************************************
* SetFilePointer (KERNEL32.@)
*/
......
......@@ -4614,18 +4614,15 @@ static void test_SetFileInformationByHandle(void)
/* invalid classes */
SetLastError(0xdeadbeef);
ret = pSetFileInformationByHandle(file, FileStandardInfo, &stdinfo, sizeof(stdinfo));
todo_wine
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError());
memset(&compressinfo, 0, sizeof(compressinfo));
SetLastError(0xdeadbeef);
ret = pSetFileInformationByHandle(file, FileCompressionInfo, &compressinfo, sizeof(compressinfo));
todo_wine
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError());
SetLastError(0xdeadbeef);
ret = pSetFileInformationByHandle(file, FileAttributeTagInfo, &fileattrinfo, sizeof(fileattrinfo));
todo_wine
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError());
memset(&protinfo, 0, sizeof(protinfo));
......@@ -4633,7 +4630,6 @@ todo_wine
protinfo.StructureSize = sizeof(protinfo);
SetLastError(0xdeadbeef);
ret = pSetFileInformationByHandle(file, FileRemoteProtocolInfo, &protinfo, sizeof(protinfo));
todo_wine
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError());
CloseHandle(file);
......
......@@ -2460,6 +2460,7 @@ WINBASEAPI VOID WINAPI SetFileApisToOEM(void);
WINBASEAPI BOOL WINAPI SetFileAttributesA(LPCSTR,DWORD);
WINBASEAPI BOOL WINAPI SetFileAttributesW(LPCWSTR,DWORD);
#define SetFileAttributes WINELIB_NAME_AW(SetFileAttributes)
WINBASEAPI BOOL WINAPI SetFileInformationByHandle(HANDLE,FILE_INFO_BY_HANDLE_CLASS,LPVOID,DWORD);
WINBASEAPI DWORD WINAPI SetFilePointer(HANDLE,LONG,LPLONG,DWORD);
WINBASEAPI BOOL WINAPI SetFilePointerEx(HANDLE,LARGE_INTEGER,LARGE_INTEGER*,DWORD);
WINADVAPI BOOL WINAPI SetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment