зеркало из https://github.com/mozilla/gecko-dev.git
bug 498844 - need _wchdir for updater (in shunt) r=dougt
This commit is contained in:
Родитель
06262a54a5
Коммит
e3456fed1e
|
@ -130,6 +130,7 @@ unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
|
|||
unsigned short * _wgetcwd(unsigned short* dir, unsigned long size);
|
||||
unsigned short *_wfullpath( unsigned short *absPath, const unsigned short *relPath, unsigned long maxLength );
|
||||
int _unlink(const char *filename );
|
||||
int _wchdir(const unsigned short* path);
|
||||
|
||||
/* The time stuff should be defined here, but it can't be because it
|
||||
is already defined in time.h.
|
||||
|
|
|
@ -6,6 +6,7 @@ SetEnvironmentVariableW
|
|||
_unlink
|
||||
_wfullpath
|
||||
_wgetcwd
|
||||
_wchdir
|
||||
abort
|
||||
clock
|
||||
errno
|
||||
|
|
|
@ -115,10 +115,21 @@ int errno = 0;
|
|||
|
||||
unsigned short * _wgetcwd(unsigned short * dir, unsigned long size)
|
||||
{
|
||||
if (!dir)
|
||||
return 0;
|
||||
unsigned short tmp[MAX_PATH] = {0};
|
||||
GetEnvironmentVariableW(L"CWD", tmp, size);
|
||||
if (tmp && tmp[0]) {
|
||||
if (wcslen(tmp) > size)
|
||||
return 0;
|
||||
wcscpy(dir, tmp);
|
||||
return dir;
|
||||
}
|
||||
unsigned long i;
|
||||
GetModuleFileName(GetModuleHandle (NULL), dir, MAX_PATH);
|
||||
for (i = _tcslen(dir); i && dir[i] != TEXT('\\'); i--) {}
|
||||
dir[i + 1] = TCHAR('\0');
|
||||
SetEnvironmentVariableW(L"CWD", dir);
|
||||
return dir;
|
||||
}
|
||||
|
||||
|
@ -150,6 +161,10 @@ unsigned short *_wfullpath( unsigned short *absPath, const unsigned short *relPa
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int _wchdir(const WCHAR* path) {
|
||||
return SetEnvironmentVariableW(L"CWD", path);
|
||||
}
|
||||
|
||||
int _unlink(const char *filename)
|
||||
{
|
||||
unsigned short wname[MAX_PATH];
|
||||
|
|
Загрузка…
Ссылка в новой задаче