diff -Nur source.p1/FzSFtp/NOISE.C source.p2/FzSFtp/NOISE.C
old
|
new
|
|
18 | 18 | void noise_get_heavy(void (*func) (void *, int)) |
19 | 19 | { |
20 | 20 | HANDLE srch; |
21 | | WIN32_FIND_DATA finddata; |
| 21 | WIN32_FIND_DATAA finddata; |
22 | 22 | char winpath[MAX_PATH + 3]; |
23 | 23 | |
24 | | GetWindowsDirectory(winpath, sizeof(winpath)); |
| 24 | GetWindowsDirectoryA(winpath, sizeof(winpath)); |
25 | 25 | strcat(winpath, "\\*"); |
26 | | srch = FindFirstFile(winpath, &finddata); |
| 26 | srch = FindFirstFileA(winpath, &finddata); |
27 | 27 | if (srch != INVALID_HANDLE_VALUE) { |
28 | 28 | do { |
29 | 29 | func(&finddata, sizeof(finddata)); |
30 | | } while (FindNextFile(srch, &finddata)); |
| 30 | } while (FindNextFileA(srch, &finddata)); |
31 | 31 | FindClose(srch); |
32 | 32 | } |
33 | 33 | |
diff -Nur source.p1/FzSFtp/PAGEANTC.C source.p2/FzSFtp/PAGEANTC.C
old
|
new
|
|
19 | 19 | int agent_exists(void) |
20 | 20 | { |
21 | 21 | HWND hwnd; |
22 | | hwnd = FindWindow("Pageant", "Pageant"); |
| 22 | hwnd = FindWindowA("Pageant", "Pageant"); |
23 | 23 | if (!hwnd) |
24 | 24 | return FALSE; |
25 | 25 | else |
… |
… |
|
85 | 85 | *out = NULL; |
86 | 86 | *outlen = 0; |
87 | 87 | |
88 | | hwnd = FindWindow("Pageant", "Pageant"); |
| 88 | hwnd = FindWindowA("Pageant", "Pageant"); |
89 | 89 | if (!hwnd) |
90 | 90 | return 1; /* *out == NULL, so failure */ |
91 | 91 | mapname = dupprintf("PageantRequest%08x", (unsigned)GetCurrentThreadId()); |
92 | | filemap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, |
| 92 | filemap = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, |
93 | 93 | 0, AGENT_MAX_MSGLEN, mapname); |
94 | 94 | if (!filemap) |
95 | 95 | return 1; /* *out == NULL, so failure */ |
diff -Nur source.p1/FzSFtp/PSFTP.C source.p2/FzSFtp/PSFTP.C
old
|
new
|
|
391 | 391 | } |
392 | 392 | |
393 | 393 | if (restart) |
394 | | fp = CreateFile(outfname, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); |
| 394 | fp = CreateFileA(outfname, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); |
395 | 395 | else |
396 | | fp = CreateFile(outfname, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0); |
| 396 | fp = CreateFileA(outfname, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0); |
397 | 397 | |
398 | 398 | if (fp==INVALID_HANDLE_VALUE) |
399 | 399 | { |
… |
… |
|
508 | 508 | return 0; |
509 | 509 | } |
510 | 510 | |
511 | | fp = CreateFile(localfile, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); |
| 511 | fp = CreateFileA(localfile, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); |
512 | 512 | if (fp == INVALID_HANDLE_VALUE) |
513 | 513 | { |
514 | 514 | FzSFtpIpc_Error1("Unable to open %s", localfile); |
… |
… |
|
1415 | 1415 | |
1416 | 1416 | if (!FzSFtpIpc_Init(lpCmdLine)) |
1417 | 1417 | { |
1418 | | MessageBox(0, "Error: You can't start FzSFtp directly. It can only by started from FileZilla when connecting to an SFTP server.", "FzSFtp Error", MB_OK); |
| 1418 | MessageBoxA(0, "Error: You can't start FzSFtp directly. It can only by started from FileZilla when connecting to an SFTP server.", "FzSFtp Error", MB_OK); |
1419 | 1419 | return 1; |
1420 | 1420 | } |
1421 | 1421 | |
diff -Nur source.p1/FzSFtp/WINNET.C source.p2/FzSFtp/WINNET.C
old
|
new
|
|
679 | 679 | } |
680 | 680 | |
681 | 681 | if (len>20480) |
682 | | MessageBox(0, "Error! Please get in contact with Tim.Kosse@gmx.de if this happens frequently.\r\nError: WINNET.C->try_send->len>20480", "Critical error!!!", MB_ICONSTOP); |
| 682 | MessageBoxA(0, "Error! Please get in contact with Tim.Kosse@gmx.de if this happens frequently.\r\nError: WINNET.C->try_send->len>20480", "Critical error!!!", MB_ICONSTOP); |
683 | 683 | while (TRUE) |
684 | 684 | { |
685 | 685 | FzSFtpIpc_SendRequest(SFTP_DATAID_CTS_WRITE, len, data); |
… |
… |
|
959 | 959 | case FD_WRITE: |
960 | 960 | { |
961 | 961 | int bufsize_before, bufsize_after; |
962 | | MessageBox(0, "FD_WRITE", "FD_WRITE", MB_OK); |
| 962 | MessageBoxA(0, "FD_WRITE", "FD_WRITE", MB_OK); |
963 | 963 | s->writable = 1; |
964 | 964 | bufsize_before = s->sending_oob + bufchain_size(&s->output_data); |
965 | 965 | try_send(s); |
diff -Nur source.p1/FzSFtp/WINSTORE.C source.p2/FzSFtp/WINSTORE.C
old
|
new
|
|
74 | 74 | p = snewn(3 * strlen(sessionname) + 1, char); |
75 | 75 | mungestr(sessionname, p); |
76 | 76 | |
77 | | ret = RegCreateKey(HKEY_CURRENT_USER, puttystr, &subkey1); |
| 77 | // tommy |
| 78 | ret = RegCreateKeyA(HKEY_CURRENT_USER, puttystr, &subkey1); |
78 | 79 | if (ret != ERROR_SUCCESS) { |
79 | 80 | sfree(p); |
80 | 81 | *errmsg = dupprintf("Unable to create registry key\n" |
81 | 82 | "HKEY_CURRENT_USER%s", puttystr); |
82 | 83 | return NULL; |
83 | 84 | } |
84 | | ret = RegCreateKey(subkey1, p, &sesskey); |
| 85 | ret = RegCreateKeyA(subkey1, p, &sesskey); |
85 | 86 | sfree(p); |
86 | 87 | RegCloseKey(subkey1); |
87 | 88 | if (ret != ERROR_SUCCESS) { |
… |
… |
|
95 | 96 | void write_setting_s(void *handle, const char *key, const char *value) |
96 | 97 | { |
97 | 98 | if (handle) |
98 | | RegSetValueEx((HKEY) handle, key, 0, REG_SZ, value, |
| 99 | RegSetValueExA((HKEY) handle, key, 0, REG_SZ, value, |
99 | 100 | 1 + strlen(value)); |
100 | 101 | } |
101 | 102 | |
102 | 103 | void write_setting_i(void *handle, const char *key, int value) |
103 | 104 | { |
104 | 105 | if (handle) |
105 | | RegSetValueEx((HKEY) handle, key, 0, REG_DWORD, |
| 106 | RegSetValueExA((HKEY) handle, key, 0, REG_DWORD, |
106 | 107 | (CONST BYTE *) & value, sizeof(value)); |
107 | 108 | } |
108 | 109 | |
… |
… |
|
122 | 123 | p = snewn(3 * strlen(sessionname) + 1, char); |
123 | 124 | mungestr(sessionname, p); |
124 | 125 | |
125 | | if (RegOpenKey(HKEY_CURRENT_USER, puttystr, &subkey1) != ERROR_SUCCESS) { |
| 126 | if (RegOpenKeyA(HKEY_CURRENT_USER, puttystr, &subkey1) != ERROR_SUCCESS) { |
126 | 127 | sesskey = NULL; |
127 | 128 | } else { |
128 | | if (RegOpenKey(subkey1, p, &sesskey) != ERROR_SUCCESS) { |
| 129 | if (RegOpenKeyA(subkey1, p, &sesskey) != ERROR_SUCCESS) { |
129 | 130 | sesskey = NULL; |
130 | 131 | } |
131 | 132 | RegCloseKey(subkey1); |
… |
… |
|
142 | 143 | size = buflen; |
143 | 144 | |
144 | 145 | if (!handle || |
145 | | RegQueryValueEx((HKEY) handle, key, 0, |
| 146 | RegQueryValueExA((HKEY) handle, key, 0, |
146 | 147 | &type, buffer, &size) != ERROR_SUCCESS || |
147 | 148 | type != REG_SZ) return NULL; |
148 | 149 | else |
… |
… |
|
155 | 156 | size = sizeof(val); |
156 | 157 | |
157 | 158 | if (!handle || |
158 | | RegQueryValueEx((HKEY) handle, key, 0, &type, |
| 159 | RegQueryValueExA((HKEY) handle, key, 0, &type, |
159 | 160 | (BYTE *) & val, &size) != ERROR_SUCCESS || |
160 | 161 | size != sizeof(val) || type != REG_DWORD) |
161 | 162 | return defvalue; |
… |
… |
|
222 | 223 | HKEY subkey1; |
223 | 224 | char *p; |
224 | 225 | |
225 | | if (RegOpenKey(HKEY_CURRENT_USER, puttystr, &subkey1) != ERROR_SUCCESS) |
| 226 | if (RegOpenKeyA(HKEY_CURRENT_USER, puttystr, &subkey1) != ERROR_SUCCESS) |
226 | 227 | return; |
227 | 228 | |
228 | 229 | p = snewn(3 * strlen(sessionname) + 1, char); |
229 | 230 | mungestr(sessionname, p); |
230 | | RegDeleteKey(subkey1, p); |
| 231 | RegDeleteKeyA(subkey1, p); |
231 | 232 | sfree(p); |
232 | 233 | |
233 | 234 | RegCloseKey(subkey1); |
… |
… |
|
243 | 244 | struct enumsettings *ret; |
244 | 245 | HKEY key; |
245 | 246 | |
246 | | if (RegOpenKey(HKEY_CURRENT_USER, puttystr, &key) != ERROR_SUCCESS) |
| 247 | if (RegOpenKeyA(HKEY_CURRENT_USER, puttystr, &key) != ERROR_SUCCESS) |
247 | 248 | return NULL; |
248 | 249 | |
249 | 250 | ret = snew(struct enumsettings); |
… |
… |
|
260 | 261 | struct enumsettings *e = (struct enumsettings *) handle; |
261 | 262 | char *otherbuf; |
262 | 263 | otherbuf = snewn(3 * buflen, char); |
263 | | if (RegEnumKey(e->key, e->i++, otherbuf, 3 * buflen) == ERROR_SUCCESS) { |
| 264 | if (RegEnumKeyA(e->key, e->i++, otherbuf, 3 * buflen) == ERROR_SUCCESS) { |
264 | 265 | unmungestr(otherbuf, buffer, buflen); |
265 | 266 | sfree(otherbuf); |
266 | 267 | return buffer; |
… |
… |
|
309 | 310 | |
310 | 311 | hostkey_regname(regname, hostname, port, keytype); |
311 | 312 | |
312 | | if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_POS "\\SshHostKeys", |
| 313 | if (RegOpenKeyA(HKEY_CURRENT_USER, PUTTY_REG_POS "\\SshHostKeys", |
313 | 314 | &rkey) != ERROR_SUCCESS) |
314 | 315 | return 1; /* key does not exist in registry */ |
315 | 316 | |
316 | 317 | readlen = len; |
317 | | ret = RegQueryValueEx(rkey, regname, NULL, &type, otherstr, &readlen); |
| 318 | ret = RegQueryValueExA(rkey, regname, NULL, &type, otherstr, &readlen); |
318 | 319 | |
319 | 320 | if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA && |
320 | 321 | !strcmp(keytype, "rsa")) { |
… |
… |
|
326 | 327 | char *justhost = regname + 1 + strcspn(regname, ":"); |
327 | 328 | char *oldstyle = snewn(len + 10, char); /* safety margin */ |
328 | 329 | readlen = len; |
329 | | ret = RegQueryValueEx(rkey, justhost, NULL, &type, |
| 330 | ret = RegQueryValueExA(rkey, justhost, NULL, &type, |
330 | 331 | oldstyle, &readlen); |
331 | 332 | |
332 | 333 | if (ret == ERROR_SUCCESS && type == REG_SZ) { |
… |
… |
|
373 | 374 | * wrong, and hyper-cautiously do nothing. |
374 | 375 | */ |
375 | 376 | if (!strcmp(otherstr, key)) |
376 | | RegSetValueEx(rkey, regname, 0, REG_SZ, otherstr, |
| 377 | RegSetValueExA(rkey, regname, 0, REG_SZ, otherstr, |
377 | 378 | strlen(otherstr) + 1); |
378 | 379 | } |
379 | 380 | } |
… |
… |
|
404 | 405 | |
405 | 406 | hostkey_regname(regname, hostname, port, keytype); |
406 | 407 | |
407 | | if (RegCreateKey(HKEY_CURRENT_USER, PUTTY_REG_POS "\\SshHostKeys", |
| 408 | if (RegCreateKeyA(HKEY_CURRENT_USER, PUTTY_REG_POS "\\SshHostKeys", |
408 | 409 | &rkey) != ERROR_SUCCESS) |
409 | 410 | return; /* key does not exist in registry */ |
410 | | RegSetValueEx(rkey, regname, 0, REG_SZ, key, strlen(key) + 1); |
| 411 | RegSetValueExA(rkey, regname, 0, REG_SZ, key, strlen(key) + 1); |
411 | 412 | RegCloseKey(rkey); |
412 | 413 | } |
413 | 414 | |
… |
… |
|
421 | 422 | |
422 | 423 | size = sizeof(seedpath); |
423 | 424 | |
424 | | if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_POS, &rkey) == |
| 425 | if (RegOpenKeyA(HKEY_CURRENT_USER, PUTTY_REG_POS, &rkey) == |
425 | 426 | ERROR_SUCCESS) { |
426 | | int ret = RegQueryValueEx(rkey, "RandSeedFile", |
| 427 | int ret = RegQueryValueExA(rkey, "RandSeedFile", |
427 | 428 | 0, &type, seedpath, &size); |
428 | 429 | if (ret != ERROR_SUCCESS || type != REG_SZ) |
429 | 430 | seedpath[0] = '\0'; |
… |
… |
|
435 | 436 | int len, ret; |
436 | 437 | |
437 | 438 | len = |
438 | | GetEnvironmentVariable("HOMEDRIVE", seedpath, |
| 439 | GetEnvironmentVariableA("HOMEDRIVE", seedpath, |
439 | 440 | sizeof(seedpath)); |
440 | 441 | ret = |
441 | | GetEnvironmentVariable("HOMEPATH", seedpath + len, |
| 442 | GetEnvironmentVariableA("HOMEPATH", seedpath + len, |
442 | 443 | sizeof(seedpath) - len); |
443 | 444 | if (ret == 0) { /* probably win95; store in \WINDOWS */ |
444 | | GetWindowsDirectory(seedpath, sizeof(seedpath)); |
| 445 | GetWindowsDirectoryA(seedpath, sizeof(seedpath)); |
445 | 446 | len = strlen(seedpath); |
446 | 447 | } else |
447 | 448 | len += ret; |
… |
… |
|
456 | 457 | if (!seedpath[0]) |
457 | 458 | get_seedpath(); |
458 | 459 | |
459 | | seedf = CreateFile(seedpath, GENERIC_READ, |
| 460 | seedf = CreateFileA(seedpath, GENERIC_READ, |
460 | 461 | FILE_SHARE_READ | FILE_SHARE_WRITE, |
461 | 462 | NULL, OPEN_EXISTING, 0, NULL); |
462 | 463 | |
… |
… |
|
481 | 482 | if (!seedpath[0]) |
482 | 483 | get_seedpath(); |
483 | 484 | |
484 | | seedf = CreateFile(seedpath, GENERIC_WRITE, 0, |
| 485 | seedf = CreateFileA(seedpath, GENERIC_WRITE, 0, |
485 | 486 | NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); |
486 | 487 | |
487 | 488 | if (seedf != INVALID_HANDLE_VALUE) { |
… |
… |
|
502 | 503 | HKEY subkey; |
503 | 504 | |
504 | 505 | i = 0; |
505 | | while (RegEnumKey(key, i, name, sizeof(name)) == ERROR_SUCCESS) { |
506 | | if (RegOpenKey(key, name, &subkey) == ERROR_SUCCESS) { |
| 506 | while (RegEnumKeyA(key, i, name, sizeof(name)) == ERROR_SUCCESS) { |
| 507 | if (RegOpenKeyA(key, name, &subkey) == ERROR_SUCCESS) { |
507 | 508 | registry_recursive_remove(subkey); |
508 | 509 | RegCloseKey(subkey); |
509 | 510 | } |
510 | | RegDeleteKey(key, name); |
| 511 | RegDeleteKeyA(key, name); |
511 | 512 | } |
512 | 513 | } |
513 | 514 | |
… |
… |
|
531 | 532 | /* |
532 | 533 | * Open the main PuTTY registry key and remove everything in it. |
533 | 534 | */ |
534 | | if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_POS, &key) == |
| 535 | if (RegOpenKeyA(HKEY_CURRENT_USER, PUTTY_REG_POS, &key) == |
535 | 536 | ERROR_SUCCESS) { |
536 | 537 | registry_recursive_remove(key); |
537 | 538 | RegCloseKey(key); |
… |
… |
|
541 | 542 | * we've done that, see if the parent key has any other |
542 | 543 | * children. |
543 | 544 | */ |
544 | | if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_PARENT, |
| 545 | if (RegOpenKeyA(HKEY_CURRENT_USER, PUTTY_REG_PARENT, |
545 | 546 | &key) == ERROR_SUCCESS) { |
546 | | RegDeleteKey(key, PUTTY_REG_PARENT_CHILD); |
547 | | ret = RegEnumKey(key, 0, name, sizeof(name)); |
| 547 | RegDeleteKeyA(key, PUTTY_REG_PARENT_CHILD); |
| 548 | ret = RegEnumKeyA(key, 0, name, sizeof(name)); |
548 | 549 | RegCloseKey(key); |
549 | 550 | /* |
550 | 551 | * If the parent key had no other children, we must delete |
… |
… |
|
552 | 553 | * key. |
553 | 554 | */ |
554 | 555 | if (ret != ERROR_SUCCESS) { |
555 | | if (RegOpenKey(HKEY_CURRENT_USER, PUTTY_REG_GPARENT, |
| 556 | if (RegOpenKeyA(HKEY_CURRENT_USER, PUTTY_REG_GPARENT, |
556 | 557 | &key) == ERROR_SUCCESS) { |
557 | | RegDeleteKey(key, PUTTY_REG_GPARENT_CHILD); |
| 558 | RegDeleteKeyA(key, PUTTY_REG_GPARENT_CHILD); |
558 | 559 | RegCloseKey(key); |
559 | 560 | } |
560 | 561 | } |
diff -Nur source.p1/FzSFtp/winmisc.c source.p2/FzSFtp/winmisc.c
old
|
new
|
|
5 | 5 | #include <stdio.h> |
6 | 6 | #include <stdlib.h> |
7 | 7 | #include "putty.h" |
8 | | |
| 8 | #include <tchar.h> |
9 | 9 | OSVERSIONINFO osVersion; |
10 | 10 | |
11 | 11 | void platform_get_x11_auth(char *display, int *proto, |
… |
… |
|
49 | 49 | return NULL; |
50 | 50 | |
51 | 51 | user = snewn(namelen, char); |
52 | | GetUserName(user, &namelen); |
| 52 | GetUserNameA(user, &namelen); |
53 | 53 | |
54 | 54 | return user; |
55 | 55 | } |
… |
… |
|
75 | 75 | wc.hCursor = LoadCursor(NULL, IDC_ARROW); |
76 | 76 | wc.hbrBackground = (HBRUSH) (COLOR_BACKGROUND +1); |
77 | 77 | wc.lpszMenuName = NULL; |
78 | | wc.lpszClassName = "PuTTYConfigBox"; |
| 78 | wc.lpszClassName = _T("PuTTYConfigBox"); |
79 | 79 | RegisterClass(&wc); |
80 | 80 | |
81 | 81 | hwnd = CreateDialog(hinst, tmpl, hwndparent, lpDialogFunc); |
diff -Nur source.p1/FzSFtp/winsftp.c source.p2/FzSFtp/winsftp.c
old
|
new
|
|
135 | 135 | { |
136 | 136 | char *ret = NULL; |
137 | 137 | |
138 | | if (!SetCurrentDirectory(dir)) { |
| 138 | if (!SetCurrentDirectoryA(dir)) { |
139 | 139 | LPVOID message; |
140 | 140 | int i; |
141 | 141 | FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | |
… |
… |
|
159 | 159 | char *psftp_getcwd(void) |
160 | 160 | { |
161 | 161 | char *ret = snewn(256, char); |
162 | | int len = GetCurrentDirectory(256, ret); |
| 162 | int len = GetCurrentDirectoryA(256, ret); |
163 | 163 | if (len > 256) |
164 | 164 | ret = sresize(ret, len, char); |
165 | | GetCurrentDirectory(len, ret); |
| 165 | GetCurrentDirectoryA(len, ret); |
166 | 166 | return ret; |
167 | 167 | } |
168 | 168 | |
… |
… |
|
181 | 181 | HANDLE h; |
182 | 182 | RFile *ret; |
183 | 183 | |
184 | | h = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, |
| 184 | h = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL, |
185 | 185 | OPEN_EXISTING, 0, 0); |
186 | 186 | if (h == INVALID_HANDLE_VALUE) |
187 | 187 | return NULL; |
… |
… |
|
229 | 229 | HANDLE h; |
230 | 230 | WFile *ret; |
231 | 231 | |
232 | | h = CreateFile(name, GENERIC_WRITE, 0, NULL, |
| 232 | h = CreateFileA(name, GENERIC_WRITE, 0, NULL, |
233 | 233 | CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); |
234 | 234 | if (h == INVALID_HANDLE_VALUE) |
235 | 235 | return NULL; |
… |
… |
|
267 | 267 | int file_type(char *name) |
268 | 268 | { |
269 | 269 | DWORD attr; |
270 | | attr = GetFileAttributes(name); |
| 270 | attr = GetFileAttributesA(name); |
271 | 271 | /* We know of no `weird' files under Windows. */ |
272 | 272 | if (attr == (DWORD)-1) |
273 | 273 | return FILE_TYPE_NONEXISTENT; |
… |
… |
|
285 | 285 | DirHandle *open_directory(char *name) |
286 | 286 | { |
287 | 287 | HANDLE h; |
288 | | WIN32_FIND_DATA fdat; |
| 288 | WIN32_FIND_DATAA fdat; |
289 | 289 | char *findfile; |
290 | 290 | DirHandle *ret; |
291 | 291 | |
292 | 292 | /* To enumerate files in dir `foo', we search for `foo/*'. */ |
293 | 293 | findfile = dupcat(name, "/*", NULL); |
294 | | h = FindFirstFile(findfile, &fdat); |
| 294 | h = FindFirstFileA(findfile, &fdat); |
295 | 295 | if (h == INVALID_HANDLE_VALUE) |
296 | 296 | return NULL; |
297 | 297 | sfree(findfile); |
… |
… |
|
305 | 305 | char *read_filename(DirHandle *dir) |
306 | 306 | { |
307 | 307 | while (!dir->name) { |
308 | | WIN32_FIND_DATA fdat; |
309 | | int ok = FindNextFile(dir->h, &fdat); |
| 308 | WIN32_FIND_DATAA fdat; |
| 309 | int ok = FindNextFileA(dir->h, &fdat); |
310 | 310 | |
311 | 311 | if (!ok) |
312 | 312 | return NULL; |
… |
… |
|
338 | 338 | int test_wildcard(char *name, int cmdline) |
339 | 339 | { |
340 | 340 | HANDLE fh; |
341 | | WIN32_FIND_DATA fdat; |
| 341 | WIN32_FIND_DATAA fdat; |
342 | 342 | |
343 | 343 | /* First see if the exact name exists. */ |
344 | | if (GetFileAttributes(name) != (DWORD)-1) |
| 344 | if (GetFileAttributesA(name) != (DWORD)-1) |
345 | 345 | return WCTYPE_FILENAME; |
346 | 346 | |
347 | 347 | /* Otherwise see if a wildcard match finds anything. */ |
348 | | fh = FindFirstFile(name, &fdat); |
| 348 | fh = FindFirstFileA(name, &fdat); |
349 | 349 | if (fh == INVALID_HANDLE_VALUE) |
350 | 350 | return WCTYPE_NONEXISTENT; |
351 | 351 | |
… |
… |
|
386 | 386 | WildcardMatcher *begin_wildcard_matching(char *name) |
387 | 387 | { |
388 | 388 | HANDLE h; |
389 | | WIN32_FIND_DATA fdat; |
| 389 | WIN32_FIND_DATAA fdat; |
390 | 390 | WildcardMatcher *ret; |
391 | 391 | char *last; |
392 | 392 | |
393 | | h = FindFirstFile(name, &fdat); |
| 393 | h = FindFirstFileA(name, &fdat); |
394 | 394 | if (h == INVALID_HANDLE_VALUE) |
395 | 395 | return NULL; |
396 | 396 | |
… |
… |
|
445 | 445 | |
446 | 446 | int create_directory(char *name) |
447 | 447 | { |
448 | | return CreateDirectory(name, NULL) != 0; |
| 448 | return CreateDirectoryA(name, NULL) != 0; |
449 | 449 | } |
450 | 450 | |
451 | 451 | char *dir_file_cat(char *dir, char *file) |