21{
24 WCHAR RootPath[] = {
'A',
':',
'\\',
'\0'};
25 WCHAR FileSystemName[
sizeof(
"FAT32")];
27 WCHAR File1[] = {
'\\',
'f',
'i',
'l',
'e',
'1',
'\0'};
28 WCHAR File2[] = {
'\\',
'f',
'i',
'l',
'e',
'2',
'\0'};
32
33
34 if (
GetTempPathW(
sizeof(TempPath) /
sizeof(TempPath[0]), TempPath) == 0)
35 {
38 }
39
40
41 RootPath[0] = TempPath[0];
42
43
45 {
48 }
49
50
52
53
57 {
58 fprintf(
stderr,
"!(FAT, FAT32, NTFS): \'%S\'\n", FSName.Buffer);
59 return 0;
60 }
61
62
63 FilePos =
wcslen(TempPath);
65 {
67 return 0;
68 }
69
70
74 {
77 }
78
79
80
82 {
86 }
87
89
90
91
93
94
95
96 TempPath[FilePos - 1] = 0;
100 {
103 }
105
106
107 TempPath[FilePos] = 0;
109 wcscpy(CopyPath, TempPath);
110
111 CopyPath[
wcslen(TempPath) - 1] = 0;
113 {
116 }
117
118
119 wcscpy(CopyPath, TempPath);
120
121 CopyPath[
wcslen(TempPath) - 1] =
L'2';
123 {
126 }
127
128
131 {
134 }
136 {
140 }
142
143
144 CopyPath[
wcslen(TempPath) - 1] = 0;
147
148
150 {
152 return 0;
153 }
154
156 return 0;
157}
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI GetFileTime(IN HANDLE hFile, OUT LPFILETIME lpCreationTime OPTIONAL, OUT LPFILETIME lpLastAccessTime OPTIONAL, OUT LPFILETIME lpLastWriteTime OPTIONAL)
BOOL WINAPI MoveFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName)
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
#define RtlCompareMemory(s1, s2, l)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
const UNICODE_STRING Fat32Name
const UNICODE_STRING NtfsName
const UNICODE_STRING FatName
DWORD WINAPI GetLastError(void)