mirror of
https://github.com/simh/simh.git
synced 2026-02-27 17:13:44 +00:00
SCP: Avoid compile errors when compiled with UNICODE defined
On windows all platform specific APIs deliberately use ANSI APIs. Fix these few inconsistencies.
This commit is contained in:
@@ -1325,11 +1325,11 @@ int load_pcap(void) {
|
||||
/* attempt to load DLL */
|
||||
#ifdef _WIN32
|
||||
if (1) {
|
||||
BOOL(WINAPI *p_SetDllDirectory)(LPCTSTR);
|
||||
UINT(WINAPI *p_GetSystemDirectory)(LPTSTR lpBuffer, UINT uSize);
|
||||
BOOL(WINAPI *p_SetDllDirectory)(const char *);
|
||||
UINT(WINAPI *p_GetSystemDirectory)(char * lpBuffer, UINT uSize);
|
||||
|
||||
p_SetDllDirectory = (BOOL(WINAPI *)(LPCTSTR)) GetProcAddress(GetModuleHandleA("kernel32.dll"), "SetDllDirectoryA");
|
||||
p_GetSystemDirectory = (UINT(WINAPI *)(LPTSTR, UINT)) GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetSystemDirectoryA");
|
||||
p_SetDllDirectory = (BOOL(WINAPI *)(const char *)) GetProcAddress(GetModuleHandleA("kernel32.dll"), "SetDllDirectoryA");
|
||||
p_GetSystemDirectory = (UINT(WINAPI *)(char *, UINT)) GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetSystemDirectoryA");
|
||||
if (p_SetDllDirectory && p_GetSystemDirectory) {
|
||||
char npcap_path[512] = "";
|
||||
|
||||
|
||||
@@ -1751,7 +1751,7 @@ if ((hFind = FindFirstFileA (cptr, &File)) != INVALID_HANDLE_VALUE) {
|
||||
strlcat (FileName, File.cFileName, sizeof (FileName));
|
||||
stat (FileName, &filestat);
|
||||
entry (DirName, File.cFileName, FileSize, &filestat, context);
|
||||
} while (FindNextFile (hFind, &File));
|
||||
} while (FindNextFileA (hFind, &File));
|
||||
FindClose (hFind);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -584,7 +584,7 @@ DWORD commsize = sizeof (commdefault);
|
||||
COMMTIMEOUTS cto;
|
||||
char win32name[1028];
|
||||
|
||||
if (!GetDefaultCommConfig (name, &commdefault, &commsize)) { /* get default comm parameters */
|
||||
if (!GetDefaultCommConfigA (name, &commdefault, &commsize)) { /* get default comm parameters */
|
||||
error = GetLastError (); /* function failed; get error */
|
||||
|
||||
if (error != ERROR_INVALID_PARAMETER) /* not a communications port name? */
|
||||
@@ -594,8 +594,8 @@ if (!GetDefaultCommConfig (name, &commdefault, &commsize)) { /* get default c
|
||||
}
|
||||
|
||||
snprintf (win32name, sizeof (win32name), "\\\\.\\%s", name);
|
||||
hPort = CreateFile (win32name, GENERIC_READ | GENERIC_WRITE, /* open the port */
|
||||
0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
|
||||
hPort = CreateFileA (win32name, GENERIC_READ | GENERIC_WRITE, /* open the port */
|
||||
0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
|
||||
|
||||
if (hPort == INVALID_HANDLE_VALUE) { /* open failed? */
|
||||
error = GetLastError (); /* get error code */
|
||||
|
||||
Reference in New Issue
Block a user