20#if(defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP))
35#ifdef WANT_WIN32_UNICODE
55#ifdef WANT_WIN32_UNICODE
57 wchar_t *wname =
NULL;
73#ifdef WANT_WIN32_UNICODE
76static wchar_t* u2wpath(
const char *upath)
88static char* w2upath(
const wchar_t *wpath)
101static int wpath_need_elongation(
wchar_t *wpath)
113static wchar_t* wlongpath(
wchar_t *wpath)
116 const wchar_t *prefix =
L"";
117 wchar_t *wlpath =
NULL;
128 prefix =
L"\\\\?\\UNC";
140 memcpy(wlpath, prefix,
sizeof(
wchar_t)*plen);
141 memcpy(wlpath+plen, wpath,
sizeof(
wchar_t)*(
len-plen));
149static wchar_t* u2wlongpath(
const char *upath)
151 wchar_t *wpath =
NULL;
152 wchar_t *wlpath =
NULL;
153 wpath = u2wpath(upath);
154 if(wpath_need_elongation(wpath))
156 wlpath = wlongpath(wpath);
167static wchar_t* u2wlongpath(
const char *upath)
172 for (
p = wpath; *
p; ++
p)
184#if defined (WANT_WIN32_UNICODE)
185 wchar_t *frag =
NULL;
200#if (defined(WIN32) && !defined (__CYGWIN__))
208#if defined (WANT_WIN32_UNICODE)
221#ifdef WANT_WIN32_UNICODE
223 wchar_t *wname =
NULL;
224 wchar_t *wmode =
NULL;
230 if( (wmode ==
NULL) || (cnt == 0))
239#ifdef WANT_WIN32_UNICODE
255#if (defined(WIN32) && !defined (__CYGWIN__))
269#ifdef WANT_WIN32_UNICODE
270int win32_wide_utf8(
const wchar_t *
const wptr,
char **mbptr,
size_t * buflen)
285 if(buflen !=
NULL) *buflen = (
len) *
sizeof (
char);
289int win32_utf8_wide(
const char *
const mbptr,
wchar_t **wptr,
size_t *buflen)
327#ifdef WANT_WIN32_UNICODE
328 wchar_t *wprefix =
NULL;
329 wchar_t *wpath =
NULL;
330 wchar_t *locwret =
NULL;
344 wprefix = u2wpath(prefix);
345 wpath = u2wpath(
path);
346 if((prefix && !wprefix) || (
path && !wpath))
355 debug(
"Actually calling PathAllocCombine!");
356 mypac(wprefix, wpath, 1, &locwret);
366 ret = w2upath(locwret);
373 size_t len, prelen, patlen;
377 prelen = prefix ?
strlen(prefix) : 0;
380 len = ((prefix &&
path) ? 1 : 0) + prelen + patlen;
387 ret[prelen+(off++)] =
'/';
398#ifdef WANT_WIN32_UNICODE
400 wpath = u2wlongpath(
path);
422#ifdef WANT_WIN32_UNICODE
439#ifdef WANT_WIN32_UNICODE
445 wpattern = u2wlongpath(
pattern);
486#ifdef WANT_WIN32_UNICODE
499#ifdef WANT_WIN32_UNICODE
533#ifdef WANT_WIN32_UNICODE
575#ifdef WANT_WIN32_UNICODE
577 wpath = u2wlongpath(
path);
592#ifdef WANT_WIN32_UNICODE
604#ifdef WANT_WIN32_UNICODE
645#ifndef NO_CATCHSIGNAL
646#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H)
649 struct sigaction new_sa;
650 struct sigaction old_sa;
652#ifdef DONT_CATCH_SIGNALS
654 return ((
void (*)()) -1);
658 sigemptyset(&new_sa.sa_mask);
660 if(sigaction(signum, &new_sa, &old_sa) == -1)
661 return ((
void (*)()) -1);
662 return (old_sa.sa_handler);
ACPI_SIZE strlen(const char *String)
static unsigned char bytes[4]
static LPCWSTR LPCWSTR LPCWSTR env
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define WideCharToMultiByte
#define MultiByteToWideChar
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
UINT(* handler)(MSIPACKAGE *)
BOOL WINAPI PathIsUNCW(LPCWSTR lpszPath)
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
GLenum GLuint GLenum GLsizei const GLchar * buf
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
#define MB_ERR_INVALID_CHARS
int __cdecl closedir(DIR *)
DIR *__cdecl opendir(const char *)
struct dirent *__cdecl readdir(DIR *)
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fdopen(_In_ int _FileHandle, _In_z_ const char *_Format)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP wchar_t *__cdecl _wgetenv(_In_z_ const wchar_t *_VarName)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define memcpy(s1, s2, n)
#define FILE_ATTRIBUTE_DIRECTORY
_Check_return_opt_ _CRTIMP int __cdecl _close(_In_ int _FileHandle)
_CRTIMP int __cdecl _wopen(const wchar_t *_Filename, int _OpenFlag,...)
_CRTIMP int __cdecl _open(const char *_Filename, int _OpenFlag,...)
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define INVALID_FILE_ATTRIBUTES