Quake II RTX doxygen  1.0 dev
ascii.c File Reference
#include <windows.h>

Go to the source code of this file.

Functions

HANDLE WINAPI FindFirstFileA (LPCSTR path, LPWIN32_FIND_DATAA data)
 
BOOL WINAPI FindNextFileA (HANDLE handle, LPWIN32_FIND_DATAA data)
 
HINSTANCE WINAPI LoadLibraryA (LPCSTR path)
 
int WINAPI MessageBoxA (HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)
 
BOOL WINAPI CreateDirectoryA (LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
 
BOOL WINAPI GetFileAttributesExA (LPCSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation)
 
DWORD WINAPI GetModuleFileNameA (HMODULE hModule, LPSTR lpFileName, DWORD nSize)
 

Function Documentation

◆ CreateDirectoryA()

BOOL WINAPI CreateDirectoryA ( LPCSTR  lpPathName,
LPSECURITY_ATTRIBUTES  lpSecurityAttributes 
)

Definition at line 62 of file ascii.c.

63 {
64  WCHAR wbuffer[MAX_PATH];
65 
66  if (!MultiByteToWideChar(CP_ACP, 0, lpPathName, -1, wbuffer, MAX_PATH)) {
67  return FALSE;
68  }
69 
70  return CreateDirectoryW(wbuffer, lpSecurityAttributes);
71 }

◆ FindFirstFileA()

HANDLE WINAPI FindFirstFileA ( LPCSTR  path,
LPWIN32_FIND_DATAA  data 
)

Definition at line 3 of file ascii.c.

4 {
5  WCHAR wbuffer[MAX_PATH];
6  HANDLE ret;
7  WIN32_FIND_DATAW wdata;
8 
9  if (!MultiByteToWideChar(CP_ACP, 0, path, -1, wbuffer, MAX_PATH)) {
10  return INVALID_HANDLE_VALUE;
11  }
12 
13  ret = FindFirstFileW(wbuffer, &wdata);
14  if (ret != INVALID_HANDLE_VALUE) {
15  memcpy(data, &wdata, FIELD_OFFSET(WIN32_FIND_DATAA, cFileName));
16  WideCharToMultiByte(CP_ACP, 0, wdata.cFileName, -1, data->cFileName, MAX_PATH, NULL, NULL);
17  }
18 
19  return ret;
20 }

Referenced by Sys_ListFiles_r().

◆ FindNextFileA()

BOOL WINAPI FindNextFileA ( HANDLE  handle,
LPWIN32_FIND_DATAA  data 
)

Definition at line 22 of file ascii.c.

23 {
24  BOOL ret;
25  WIN32_FIND_DATAW wdata;
26 
27  ret = FindNextFileW(handle, &wdata);
28  if (ret != FALSE) {
29  memcpy(data, &wdata, FIELD_OFFSET(WIN32_FIND_DATAA, cFileName));
30  WideCharToMultiByte(CP_ACP, 0, wdata.cFileName, -1, data->cFileName, MAX_PATH, NULL, NULL);
31  }
32 
33  return ret;
34 }

Referenced by Sys_ListFiles_r().

◆ GetFileAttributesExA()

BOOL WINAPI GetFileAttributesExA ( LPCSTR  lpFileName,
GET_FILEEX_INFO_LEVELS  fInfoLevelId,
LPVOID  lpFileInformation 
)

Definition at line 73 of file ascii.c.

74 {
75  WCHAR wbuffer[MAX_PATH];
76 
77  if (!MultiByteToWideChar(CP_ACP, 0, lpFileName, -1, wbuffer, MAX_PATH)) {
78  return FALSE;
79  }
80 
81  return GetFileAttributesExW(wbuffer, fInfoLevelId, lpFileInformation);
82 }

◆ GetModuleFileNameA()

DWORD WINAPI GetModuleFileNameA ( HMODULE  hModule,
LPSTR  lpFileName,
DWORD  nSize 
)

Definition at line 84 of file ascii.c.

85 {
86  WCHAR wbuffer[MAX_PATH];
87  DWORD ret;
88 
89  if (nSize > MAX_PATH) {
90  nSize = MAX_PATH;
91  }
92 
93  ret = GetModuleFileNameW(hModule, wbuffer, nSize);
94  if (ret) {
95  if (!WideCharToMultiByte(CP_ACP, 0, wbuffer, ret, lpFileName, ret, NULL, NULL)) {
96  return 0;
97  }
98  }
99 
100  return ret;
101 }

Referenced by fix_current_directory().

◆ LoadLibraryA()

HINSTANCE WINAPI LoadLibraryA ( LPCSTR  path)

Definition at line 36 of file ascii.c.

37 {
38  WCHAR wbuffer[MAX_PATH];
39 
40  if (!MultiByteToWideChar(CP_ACP, 0, path, -1, wbuffer, MAX_PATH)) {
41  return NULL;
42  }
43 
44  return LoadLibraryW(wbuffer);
45 }

Referenced by Sys_LoadLibrary().

◆ MessageBoxA()

int WINAPI MessageBoxA ( HWND  hWnd,
LPCSTR  lpText,
LPCSTR  lpCaption,
UINT  uType 
)

Definition at line 47 of file ascii.c.

48 {
49  WCHAR wText[4096];
50  WCHAR wCaption[256];
51 
52  if (!MultiByteToWideChar(CP_ACP, 0, lpText, -1, wText, 4096)) {
53  return 0;
54  }
55  if (!MultiByteToWideChar(CP_ACP, 0, lpCaption, -1, wCaption, 256)) {
56  return 0;
57  }
58 
59  return MessageBoxW(hWnd, wText, wCaption, uType);
60 }

Referenced by Sys_Error().

handle
static void * handle
Definition: dynamic.c:52
BOOL
BOOL(WINAPI *qwglSetPixelFormat)(HDC