21 #include "../../SDL_internal.h"
23 #ifdef SDL_FILESYSTEM_WINDOWS
28 #include "../../core/windows/SDL_windows.h"
38 typedef DWORD (WINAPI *GetModuleFileNameExW_t)(HANDLE, HMODULE, LPWSTR, DWORD);
39 GetModuleFileNameExW_t pGetModuleFileNameExW;
42 HANDLE psapi = LoadLibrary(L
"psapi.dll");
52 pGetModuleFileNameExW = (GetModuleFileNameExW_t)GetProcAddress(psapi,
"GetModuleFileNameExW");
53 if (!pGetModuleFileNameExW) {
70 len = pGetModuleFileNameExW(GetCurrentProcess(),
NULL,
path, buflen);
87 for (
i =
len-1;
i > 0;
i--) {
88 if (
path[
i] ==
'\\') {
113 WCHAR
path[MAX_PATH];
117 size_t new_wpath_len = 0;
118 BOOL api_result =
FALSE;
146 new_wpath_len = lstrlenW(worg) + lstrlenW(wapp) + lstrlenW(
path) + 3;
148 if ((new_wpath_len + 1) > MAX_PATH) {
156 lstrcatW(
path, L
"\\");
157 lstrcatW(
path, worg);
161 api_result = CreateDirectoryW(
path,
NULL);
162 if (api_result ==
FALSE) {
163 if (GetLastError() != ERROR_ALREADY_EXISTS) {
170 lstrcatW(
path, L
"\\");
171 lstrcatW(
path, wapp);
174 api_result = CreateDirectoryW(
path,
NULL);
175 if (api_result ==
FALSE) {
176 if (GetLastError() != ERROR_ALREADY_EXISTS) {
182 lstrcatW(
path, L
"\\");
#define SDL_assert(condition)
#define SDL_OutOfMemory()
#define SDL_InvalidParamError(param)
Include file for filesystem SDL API functions.
char * SDL_GetBasePath(void)
Get the path where the application resides.
GLsizei const GLchar *const * path
#define WIN_UTF8ToString(S)
#define WIN_StringToUTF8(S)
int WIN_SetError(const char *prefix)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF ptr