static BOOL (WINAPI *pReplaceFileW)(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPVOID, LPVOID);
static UINT (WINAPI *pGetSystemWindowsDirectoryA)(LPSTR, UINT);
static BOOL (WINAPI *pGetVolumeNameForVolumeMountPointA)(LPCSTR, LPSTR, DWORD);
+static DWORD (WINAPI *pQueueUserAPC)(PAPCFUNC pfnAPC, HANDLE hThread, ULONG_PTR dwData);
/* keep filename and filenameW the same */
static const char filename[] = "testfile.xxx";
pReplaceFileW=(void*)GetProcAddress(hkernel32, "ReplaceFileW");
pGetSystemWindowsDirectoryA=(void*)GetProcAddress(hkernel32, "GetSystemWindowsDirectoryA");
pGetVolumeNameForVolumeMountPointA = (void *) GetProcAddress(hkernel32, "GetVolumeNameForVolumeMountPointA");
+ pQueueUserAPC = (void *) GetProcAddress(hkernel32, "QueueUserAPC");
}
static void test__hread( void )
ok( 0 != memory_object, "LocalAlloc fails. (Could be out of memory.)\n" );
contents = LocalLock( memory_object );
+ ok( NULL != contents, "LocalLock whines\n" );
filehandle = _lopen( filename, OF_READ );
contents = LocalLock( memory_object );
-
ok( NULL != contents, "LocalLock whines\n" );
ok( bytes_written == _hread( filehandle, contents, bytes_written), "read length differ from write length\n" );
ok( 0 != memory_object, "LocalAlloc fails, could be out of memory\n" );
contents = LocalLock( memory_object );
+ ok( NULL != contents, "LocalLock whines\n" );
filehandle = _lopen( filename, OF_READ );
contents = LocalLock( memory_object );
-
ok( NULL != contents, "LocalLock whines\n" );
ok( bytes_written == _hread( filehandle, contents, bytes_written), "read length differ from write length\n" );
ret = DeleteFileA(filename);
ok(ret, "DeleteFileA: error %d\n", GetLastError());
+ SetLastError(0xdeadbeef);
+ hFile = CreateFileA("c:\\*.*", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ ok(hFile == INVALID_HANDLE_VALUE, "hFile should have been INVALID_HANDLE_VALUE\n");
+ ok(GetLastError() == ERROR_INVALID_NAME ||
+ broken(GetLastError() == ERROR_FILE_NOT_FOUND), /* Win98 */
+ "LastError should have been ERROR_INVALID_NAME or ERROR_FILE_NOT_FOUND but got %u\n", GetLastError());
+
/* get windows drive letter */
ret = GetWindowsDirectory(windowsdir, sizeof(windowsdir));
ok(ret < sizeof(windowsdir), "windowsdir is abnormally long!\n");
static void test_LockFile(void)
{
- HANDLE handle;
+ HANDLE handle, handle2;
DWORD written;
OVERLAPPED overlapped;
int limited_LockFile;
ok(0,"couldn't create file \"%s\" (err=%d)\n",filename,GetLastError());
return;
}
+ handle2 = CreateFileA( filename, GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
+ OPEN_EXISTING, 0, 0 );
+ if (handle2 == INVALID_HANDLE_VALUE)
+ {
+ ok( 0, "couldn't open file \"%s\" (err=%d)\n", filename, GetLastError() );
+ goto cleanup;
+ }
ok( WriteFile( handle, sillytext, strlen(sillytext), &written, NULL ), "write failed\n" );
ok( LockFile( handle, 0, 0, 0, 0 ), "LockFile failed\n" );
"UnlockFileEx 150,100 again succeeded\n" );
}
+ /* shared lock can overlap exclusive if handles are equal */
+ S(U(overlapped)).Offset = 300;
+ ok( LockFileEx( handle, LOCKFILE_EXCLUSIVE_LOCK, 0, 100, 0, &overlapped ),
+ "LockFileEx exclusive 300,100 failed\n" );
+ ok( !LockFileEx( handle2, LOCKFILE_FAIL_IMMEDIATELY, 0, 100, 0, &overlapped ),
+ "LockFileEx handle2 300,100 succeeded\n" );
+ ret = LockFileEx( handle, LOCKFILE_FAIL_IMMEDIATELY, 0, 100, 0, &overlapped );
+ ok( ret, "LockFileEx 300,100 failed\n" );
+ ok( UnlockFileEx( handle, 0, 100, 0, &overlapped ), "UnlockFileEx 300,100 failed\n" );
+ /* exclusive lock is removed first */
+ ok( LockFileEx( handle2, LOCKFILE_FAIL_IMMEDIATELY, 0, 100, 0, &overlapped ),
+ "LockFileEx handle2 300,100 failed\n" );
+ ok( UnlockFileEx( handle2, 0, 100, 0, &overlapped ), "UnlockFileEx 300,100 failed\n" );
+ if (ret)
+ ok( UnlockFileEx( handle, 0, 100, 0, &overlapped ), "UnlockFileEx 300,100 failed\n" );
+
ret = LockFile( handle, 0, 0x10000000, 0, 0xf0000000 );
if (ret)
{
ok( UnlockFile( handle, 100, 0, 0, 0 ), "UnlockFile 100,0 failed\n" );
+ CloseHandle( handle2 );
+cleanup:
CloseHandle( handle );
DeleteFileA( filename );
}
nt->FileHeader.Machine = IMAGE_FILE_MACHINE_AMD64;
#elif defined __powerpc__
nt->FileHeader.Machine = IMAGE_FILE_MACHINE_POWERPC;
+#elif defined __sparc__
+ nt->FileHeader.Machine = IMAGE_FILE_MACHINE_SPARC;
+#elif defined __arm__
+ nt->FileHeader.Machine = IMAGE_FILE_MACHINE_ARMV7;
#else
# error You must specify the machine type
#endif
nt->FileHeader.NumberOfSections = 1;
- nt->FileHeader.SizeOfOptionalHeader = IMAGE_SIZEOF_NT_OPTIONAL_HEADER;
+ nt->FileHeader.SizeOfOptionalHeader = sizeof(IMAGE_OPTIONAL_HEADER);
nt->FileHeader.Characteristics = IMAGE_FILE_DLL | IMAGE_FILE_EXECUTABLE_IMAGE;
nt->OptionalHeader.Magic = IMAGE_NT_OPTIONAL_HDR_MAGIC;
nt->OptionalHeader.MajorLinkerVersion = 1;
return ret;
}
-static int is_sharing_compatible( DWORD access1, DWORD sharing1, DWORD access2, DWORD sharing2, BOOL is_win9x )
+static unsigned int map_file_access( unsigned int access )
{
- if (!is_win9x)
- {
- if (!access1) sharing1 = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE;
- if (!access2) sharing2 = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE;
- }
- else
- {
- access1 &= ~DELETE;
- if (!access1) access1 = GENERIC_READ;
+ if (access & GENERIC_READ) access |= FILE_GENERIC_READ;
+ if (access & GENERIC_WRITE) access |= FILE_GENERIC_WRITE;
+ if (access & GENERIC_EXECUTE) access |= FILE_GENERIC_EXECUTE;
+ if (access & GENERIC_ALL) access |= FILE_ALL_ACCESS;
+ return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
+}
- access2 &= ~DELETE;
- if (!access2) access2 = GENERIC_READ;
- }
+static int is_sharing_compatible( DWORD access1, DWORD sharing1, DWORD access2, DWORD sharing2 )
+{
+ access1 = map_file_access( access1 );
+ access2 = map_file_access( access2 );
+ access1 &= FILE_READ_DATA | FILE_WRITE_DATA | FILE_APPEND_DATA | FILE_EXECUTE | DELETE;
+ access2 &= FILE_READ_DATA | FILE_WRITE_DATA | FILE_APPEND_DATA | FILE_EXECUTE | DELETE;
- if ((access1 & GENERIC_READ) && !(sharing2 & FILE_SHARE_READ)) return 0;
- if ((access1 & GENERIC_WRITE) && !(sharing2 & FILE_SHARE_WRITE)) return 0;
+ if (!access1) sharing1 = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE;
+ if (!access2) sharing2 = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE;
+
+ if ((access1 & (FILE_READ_DATA|FILE_EXECUTE)) && !(sharing2 & FILE_SHARE_READ)) return 0;
+ if ((access1 & (FILE_WRITE_DATA|FILE_APPEND_DATA)) && !(sharing2 & FILE_SHARE_WRITE)) return 0;
if ((access1 & DELETE) && !(sharing2 & FILE_SHARE_DELETE)) return 0;
- if ((access2 & GENERIC_READ) && !(sharing1 & FILE_SHARE_READ)) return 0;
- if ((access2 & GENERIC_WRITE) && !(sharing1 & FILE_SHARE_WRITE)) return 0;
+ if ((access2 & (FILE_READ_DATA|FILE_EXECUTE)) && !(sharing1 & FILE_SHARE_READ)) return 0;
+ if ((access2 & (FILE_WRITE_DATA|FILE_APPEND_DATA)) && !(sharing1 & FILE_SHARE_WRITE)) return 0;
if ((access2 & DELETE) && !(sharing1 & FILE_SHARE_DELETE)) return 0;
return 1;
}
{
if ((map_access == PAGE_READWRITE || map_access == PAGE_EXECUTE_READWRITE) &&
!(sharing2 & FILE_SHARE_WRITE)) return 0;
- if ((map_access & SEC_IMAGE) && (access2 & GENERIC_WRITE)) return 0;
+ access2 = map_file_access( access2 );
+ if ((map_access & SEC_IMAGE) && (access2 & FILE_WRITE_DATA)) return 0;
return 1;
}
{
static const DWORD access_modes[] =
{ 0, GENERIC_READ, GENERIC_WRITE, GENERIC_READ|GENERIC_WRITE,
- DELETE, GENERIC_READ|DELETE, GENERIC_WRITE|DELETE, GENERIC_READ|GENERIC_WRITE|DELETE };
+ DELETE, GENERIC_READ|DELETE, GENERIC_WRITE|DELETE, GENERIC_READ|GENERIC_WRITE|DELETE,
+ GENERIC_EXECUTE, GENERIC_EXECUTE | DELETE,
+ FILE_READ_DATA, FILE_WRITE_DATA, FILE_APPEND_DATA, FILE_READ_EA, FILE_WRITE_EA,
+ FILE_READ_DATA | FILE_EXECUTE, FILE_WRITE_DATA | FILE_EXECUTE, FILE_APPEND_DATA | FILE_EXECUTE,
+ FILE_READ_EA | FILE_EXECUTE, FILE_WRITE_EA | FILE_EXECUTE, FILE_EXECUTE,
+ FILE_DELETE_CHILD, FILE_READ_ATTRIBUTES, FILE_WRITE_ATTRIBUTES };
static const DWORD sharing_modes[] =
{ 0, FILE_SHARE_READ,
FILE_SHARE_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
int a1, s1, a2, s2;
int ret;
HANDLE h, h2;
- BOOL is_win9x = FALSE;
/* make sure the file exists */
if (!create_fake_dll( filename ))
ok(0, "couldn't create file \"%s\" (err=%d)\n", filename, GetLastError());
return;
}
- is_win9x = GetFileAttributesW(filenameW) == INVALID_FILE_ATTRIBUTES;
for (a1 = 0; a1 < sizeof(access_modes)/sizeof(access_modes[0]); a1++)
{
for (s1 = 0; s1 < sizeof(sharing_modes)/sizeof(sharing_modes[0]); s1++)
{
- /* Win9x doesn't support FILE_SHARE_DELETE */
- if (is_win9x && (sharing_modes[s1] & FILE_SHARE_DELETE))
- continue;
-
SetLastError(0xdeadbeef);
h = CreateFileA( filename, access_modes[a1], sharing_modes[s1],
NULL, OPEN_EXISTING, 0, 0 );
{
for (s2 = 0; s2 < sizeof(sharing_modes)/sizeof(sharing_modes[0]); s2++)
{
- /* Win9x doesn't support FILE_SHARE_DELETE */
- if (is_win9x && (sharing_modes[s2] & FILE_SHARE_DELETE))
- continue;
-
SetLastError(0xdeadbeef);
h2 = CreateFileA( filename, access_modes[a2], sharing_modes[s2],
NULL, OPEN_EXISTING, 0, 0 );
ret = GetLastError();
if (is_sharing_compatible( access_modes[a1], sharing_modes[s1],
- access_modes[a2], sharing_modes[s2], is_win9x ))
+ access_modes[a2], sharing_modes[s2] ))
{
ok( h2 != INVALID_HANDLE_VALUE,
"open failed for modes %x/%x/%x/%x\n",
access_modes[a1], sharing_modes[s1],
access_modes[a2], sharing_modes[s2] );
- ok( ret == 0xdeadbeef /* Win9x */ ||
- ret == 0, /* XP */
- "wrong error code %d\n", ret );
+ ok( ret == 0, "wrong error code %d\n", ret );
}
else
{
{
for (s2 = 0; s2 < sizeof(sharing_modes)/sizeof(sharing_modes[0]); s2++)
{
- /* Win9x doesn't support FILE_SHARE_DELETE */
- if (is_win9x && (sharing_modes[s2] & FILE_SHARE_DELETE))
- continue;
-
SetLastError(0xdeadbeef);
h2 = CreateFileA( filename, access_modes[a2], sharing_modes[s2],
NULL, OPEN_EXISTING, 0, 0 );
ret = GetLastError();
if (h2 == INVALID_HANDLE_VALUE)
{
- if (is_sharing_map_compatible(mapping_modes[a1], access_modes[a2], sharing_modes[s2]))
- ok( is_win9x, /* there's no sharing at all with a mapping on win9x */
- "open failed for modes map %x/%x/%x\n",
- mapping_modes[a1], access_modes[a2], sharing_modes[s2] );
+ ok( !is_sharing_map_compatible(mapping_modes[a1], access_modes[a2], sharing_modes[s2]),
+ "open failed for modes map %x/%x/%x\n",
+ mapping_modes[a1], access_modes[a2], sharing_modes[s2] );
ok( ret == ERROR_SHARING_VIOLATION,
"wrong error code %d\n", ret );
}
h2 = CreateFileA( filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS, 0, 0 );
ret = GetLastError();
- if ((mapping_modes[a1] & SEC_IMAGE) || is_win9x)
+ if (mapping_modes[a1] & SEC_IMAGE)
{
ok( h2 == INVALID_HANDLE_VALUE, "create succeeded for map %x\n", mapping_modes[a1] );
ok( ret == ERROR_SHARING_VIOLATION, "wrong error code %d for %x\n", ret, mapping_modes[a1] );
h2 = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, 0 );
ret = GetLastError();
- if (is_win9x)
- {
- ok( h2 == INVALID_HANDLE_VALUE, "create succeeded for map %x\n", mapping_modes[a1] );
- ok( ret == ERROR_SHARING_VIOLATION, "wrong error code %d for %x\n", ret, mapping_modes[a1] );
- }
- else if (mapping_modes[a1] & SEC_IMAGE)
+ if (mapping_modes[a1] & SEC_IMAGE)
{
ok( h2 == INVALID_HANDLE_VALUE, "create succeeded for map %x\n", mapping_modes[a1] );
ok( ret == ERROR_ACCESS_DENIED, "wrong error code %d for %x\n", ret, mapping_modes[a1] );
strcat(buffer2, "nul");
handle = FindFirstFileA(buffer2, &data);
err = GetLastError();
- ok( handle != INVALID_HANDLE_VALUE, "FindFirstFile on %s failed\n", buffer2 );
+ ok( handle != INVALID_HANDLE_VALUE, "FindFirstFile on %s failed: %d\n", buffer2, err );
ok( 0 == lstrcmpiA(data.cFileName, "nul"), "wrong name %s\n", data.cFileName );
ok( FILE_ATTRIBUTE_ARCHIVE == data.dwFileAttributes ||
FILE_ATTRIBUTE_DEVICE == data.dwFileAttributes /* Win9x */,
strcpy(buffer2, "lpt1");
handle = FindFirstFileA(buffer2, &data);
err = GetLastError();
- ok( handle != INVALID_HANDLE_VALUE, "FindFirstFile on %s failed\n", buffer2 );
+ ok( handle != INVALID_HANDLE_VALUE, "FindFirstFile on %s failed: %d\n", buffer2, err );
ok( 0 == lstrcmpiA(data.cFileName, "lpt1"), "wrong name %s\n", data.cFileName );
ok( FILE_ATTRIBUTE_ARCHIVE == data.dwFileAttributes ||
FILE_ATTRIBUTE_DEVICE == data.dwFileAttributes /* Win9x */,
HeapFree(GetProcessHeap(), 0, lpBuffer);
}
+static BOOL user_apc_ran;
+static void CALLBACK user_apc(ULONG_PTR param)
+{
+ user_apc_ran = TRUE;
+}
+
static void test_read_write(void)
{
DWORD bytes, ret, old_prot;
CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0);
ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA: error %d\n", GetLastError());
+ user_apc_ran = FALSE;
+ if (pQueueUserAPC) {
+ trace("Queueing an user APC\n"); /* verify the file is non alerable */
+ ret = pQueueUserAPC(&user_apc, GetCurrentThread(), 0);
+ ok(ret, "QueueUserAPC failed: %d\n", GetLastError());
+ }
+
SetLastError(12345678);
bytes = 12345678;
ret = WriteFile(hFile, NULL, 0, &bytes, NULL);
"ret = %d, error %d\n", ret, GetLastError());
ok(!bytes, "bytes = %d\n", bytes);
+ ok(user_apc_ran == FALSE, "UserAPC ran, file using alertable io mode\n");
+ if (pQueueUserAPC)
+ SleepEx(0, TRUE); /* get rid of apc */
+
/* test passing protected memory as buffer */
mem = VirtualAlloc( NULL, 0x4000, MEM_COMMIT, PAGE_READWRITE );
ok(!ret && (GetLastError() == ERROR_FILE_NOT_FOUND ||
GetLastError() == ERROR_ACCESS_DENIED),
"ReplaceFileA: unexpected error %d\n", GetLastError());
+ DeleteFileA( replacement );
/*
* if the first round (w/ backup) worked then as long as there is no
ok(!ret && (GetLastError() == ERROR_FILE_NOT_FOUND ||
GetLastError() == ERROR_ACCESS_DENIED),
"ReplaceFileW: unexpected error %d\n", GetLastError());
+ DeleteFileW( replacement );
if (removeBackup)
{
}
}
+static void test_CreatFile(void)
+{
+ static const struct test_data
+ {
+ DWORD disposition, access, error, clean_up;
+ } td[] =
+ {
+ /* 0 */ { 0, 0, ERROR_INVALID_PARAMETER, 0 },
+ /* 1 */ { 0, GENERIC_READ, ERROR_INVALID_PARAMETER, 0 },
+ /* 2 */ { 0, GENERIC_READ|GENERIC_WRITE, ERROR_INVALID_PARAMETER, 0 },
+ /* 3 */ { CREATE_NEW, 0, ERROR_FILE_EXISTS, 1 },
+ /* 4 */ { CREATE_NEW, 0, 0, 1 },
+ /* 5 */ { CREATE_NEW, GENERIC_READ, 0, 1 },
+ /* 6 */ { CREATE_NEW, GENERIC_WRITE, 0, 1 },
+ /* 7 */ { CREATE_NEW, GENERIC_READ|GENERIC_WRITE, 0, 0 },
+ /* 8 */ { CREATE_ALWAYS, 0, 0, 0 },
+ /* 9 */ { CREATE_ALWAYS, GENERIC_READ, 0, 0 },
+ /* 10*/ { CREATE_ALWAYS, GENERIC_WRITE, 0, 0 },
+ /* 11*/ { CREATE_ALWAYS, GENERIC_READ|GENERIC_WRITE, 0, 1 },
+ /* 12*/ { OPEN_EXISTING, 0, ERROR_FILE_NOT_FOUND, 0 },
+ /* 13*/ { CREATE_ALWAYS, 0, 0, 0 },
+ /* 14*/ { OPEN_EXISTING, 0, 0, 0 },
+ /* 15*/ { OPEN_EXISTING, GENERIC_READ, 0, 0 },
+ /* 16*/ { OPEN_EXISTING, GENERIC_WRITE, 0, 0 },
+ /* 17*/ { OPEN_EXISTING, GENERIC_READ|GENERIC_WRITE, 0, 1 },
+ /* 18*/ { OPEN_ALWAYS, 0, 0, 0 },
+ /* 19*/ { OPEN_ALWAYS, GENERIC_READ, 0, 0 },
+ /* 20*/ { OPEN_ALWAYS, GENERIC_WRITE, 0, 0 },
+ /* 21*/ { OPEN_ALWAYS, GENERIC_READ|GENERIC_WRITE, 0, 0 },
+ /* 22*/ { TRUNCATE_EXISTING, 0, ERROR_INVALID_PARAMETER, 0 },
+ /* 23*/ { TRUNCATE_EXISTING, GENERIC_READ, ERROR_INVALID_PARAMETER, 0 },
+ /* 24*/ { TRUNCATE_EXISTING, GENERIC_WRITE, 0, 0 },
+ /* 25*/ { TRUNCATE_EXISTING, GENERIC_READ|GENERIC_WRITE, 0, 0 }
+ };
+ char temp_path[MAX_PATH];
+ char file_name[MAX_PATH];
+ DWORD i, ret, written;
+ HANDLE hfile;
+
+ GetTempPath(MAX_PATH, temp_path);
+ GetTempFileName(temp_path, "tmp", 0, file_name);
+
+ for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
+ {
+ SetLastError(0xdeadbeef);
+ hfile = CreateFile(file_name, td[i].access, 0, NULL, td[i].disposition, 0, 0);
+ if (!td[i].error)
+ {
+ ok(hfile != INVALID_HANDLE_VALUE, "%d: CreateFile error %d\n", i, GetLastError());
+ written = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = WriteFile(hfile, &td[i].error, sizeof(td[i].error), &written, NULL);
+ if (td[i].access & GENERIC_WRITE)
+ ok(ret, "%d: WriteFile error %d\n", i, GetLastError());
+ else
+ {
+ ok(!ret, "%d: WriteFile should fail\n", i);
+ ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError());
+ }
+ CloseHandle(hfile);
+ }
+ else
+ {
+ /* FIXME: remove the condition below once Wine is fixed */
+ if (td[i].disposition == TRUNCATE_EXISTING && !(td[i].access & GENERIC_WRITE))
+ {
+ todo_wine
+ {
+ ok(hfile == INVALID_HANDLE_VALUE, "%d: CreateFile should fail\n", i);
+ ok(GetLastError() == td[i].error, "%d: expected %d, got %d\n", i, td[i].error, GetLastError());
+ }
+ CloseHandle(hfile);
+ }
+ else
+ {
+ ok(hfile == INVALID_HANDLE_VALUE, "%d: CreateFile should fail\n", i);
+ ok(GetLastError() == td[i].error, "%d: expected %d, got %d\n", i, td[i].error, GetLastError());
+ }
+ }
+
+ if (td[i].clean_up) DeleteFile(file_name);
+ }
+
+ DeleteFile(file_name);
+}
+
START_TEST(file)
{
InitFunctionPointers();
test_GetTempFileNameA();
test_CopyFileA();
test_CopyFileW();
+ test_CreatFile();
test_CreateFileA();
test_CreateFileW();
test_DeleteFileA();