Re: [PATCH 2/2] msvcp140: Implement _File_size.
On 07/09/17 22:14, Stefan Dösinger wrote:
static int (__cdecl *p_To_wide)(const char *src, WCHAR *dst); +static ULONGLONG(__cdecl *p_File_size)(WCHAR const*); Please add a space after ULONGLONG.
+static void test_File_size(void) +{ + ULONGLONG val; + HANDLE file; + LARGE_INTEGER file_size; + WCHAR test_f1_W[] = {'t','r','2','_','t','e','s','t','_','d','i','r','/','f','1',0}; + WCHAR test_f2_W[] = {'t','r','2','_','t','e','s','t','_','d','i','r','/','f','2',0}; + WCHAR test_dir_W[] = {'t','r','2','_','t','e','s','t','_','d','i','r',0}; + WCHAR test_ne_W[] = {'t','r','2','_','t','e','s','t','_','d','i','r','/','n','e',0}; + CreateDirectoryW(test_dir_W, NULL); Could you please create the test files in temp directory? Also please rename the directory (these are no longer tr2 namespace tests). +/* _File_size, msvcp140 version. Different error handling. */ +ULONGLONG __cdecl _File_size(WCHAR const* path) +{ + WIN32_FILE_ATTRIBUTE_DATA fad; + + TRACE("(%s)\n", debugstr_w(path)); + if(!GetFileAttributesExW(path, GetFileExInfoStandard, &fad)) + return ~0ULL; + if(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + return 0; We don't need to handle the directory separately here. It will have file size set to 0 anyway.
Thanks, Piotr
participants (1)
-
Piotr Caban