mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
msvcrt: Add _wmktemp_s implementation.
This commit is contained in:
parent
7d41f9b3e9
commit
b6fc57ec84
6 changed files with 44 additions and 5 deletions
|
@ -1557,7 +1557,7 @@
|
|||
@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) msvcrt._wmakepath_s
|
||||
@ cdecl _wmkdir(wstr) msvcrt._wmkdir
|
||||
@ cdecl _wmktemp(wstr) msvcrt._wmktemp
|
||||
@ stub _wmktemp_s
|
||||
@ cdecl _wmktemp_s(wstr long) msvcrt._wmktemp_s
|
||||
@ varargs _wopen(wstr long) msvcrt._wopen
|
||||
@ cdecl _wperror(wstr) msvcrt._wperror
|
||||
@ extern _wpgmptr msvcrt._wpgmptr
|
||||
|
|
|
@ -1919,7 +1919,7 @@
|
|||
@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) msvcrt._wmakepath_s
|
||||
@ cdecl _wmkdir(wstr) msvcrt._wmkdir
|
||||
@ cdecl _wmktemp(wstr) msvcrt._wmktemp
|
||||
@ stub _wmktemp_s
|
||||
@ cdecl _wmktemp_s(wstr long) msvcrt._wmktemp_s
|
||||
@ varargs _wopen(wstr long) msvcrt._wopen
|
||||
@ cdecl _wperror(wstr) msvcrt._wperror
|
||||
@ extern _wpgmptr msvcrt._wpgmptr
|
||||
|
|
|
@ -1238,7 +1238,7 @@
|
|||
@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) msvcrt._wmakepath_s
|
||||
@ cdecl _wmkdir(wstr) msvcrt._wmkdir
|
||||
@ cdecl _wmktemp(wstr) msvcrt._wmktemp
|
||||
@ stub _wmktemp_s
|
||||
@ cdecl _wmktemp_s(wstr long) msvcrt._wmktemp_s
|
||||
@ varargs _wopen(wstr long) msvcrt._wopen
|
||||
@ cdecl _wperror(wstr) msvcrt._wperror
|
||||
@ extern _wpgmptr msvcrt._wpgmptr
|
||||
|
|
|
@ -1211,7 +1211,7 @@
|
|||
@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) msvcrt._wmakepath_s
|
||||
@ cdecl _wmkdir(wstr) msvcrt._wmkdir
|
||||
@ cdecl _wmktemp(wstr) msvcrt._wmktemp
|
||||
@ stub _wmktemp_s
|
||||
@ cdecl _wmktemp_s(wstr long) msvcrt._wmktemp_s
|
||||
@ varargs _wopen(wstr long) msvcrt._wopen
|
||||
@ cdecl _wperror(wstr) msvcrt._wperror
|
||||
@ extern _wpgmptr msvcrt._wpgmptr
|
||||
|
|
|
@ -1756,6 +1756,45 @@ char * CDECL MSVCRT__mktemp(char *pattern)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _wmktemp_s (MSVCRT.@)
|
||||
*/
|
||||
int CDECL MSVCRT__wmktemp_s(MSVCRT_wchar_t *pattern, MSVCRT_size_t size)
|
||||
{
|
||||
DWORD len, xno, id;
|
||||
|
||||
if(!MSVCRT_CHECK_PMT(pattern!=NULL))
|
||||
return MSVCRT_EINVAL;
|
||||
|
||||
for(len=0; len<size; len++)
|
||||
if(!pattern[len])
|
||||
break;
|
||||
if(!MSVCRT_CHECK_PMT(len!=size && len>=6)) {
|
||||
if(size)
|
||||
pattern[0] = 0;
|
||||
return MSVCRT_EINVAL;
|
||||
}
|
||||
|
||||
for(xno=1; xno<=6; xno++)
|
||||
if(!MSVCRT_CHECK_PMT(pattern[len-xno] == 'X'))
|
||||
return MSVCRT_EINVAL;
|
||||
|
||||
id = GetCurrentProcessId();
|
||||
for(xno=1; xno<6; xno++) {
|
||||
pattern[len-xno] = id%10 + '0';
|
||||
id /= 10;
|
||||
}
|
||||
|
||||
for(pattern[len-6]='a'; pattern[len-6]<='z'; pattern[len-6]++) {
|
||||
if(GetFileAttributesW(pattern) == INVALID_FILE_ATTRIBUTES)
|
||||
return 0;
|
||||
}
|
||||
|
||||
pattern[0] = 0;
|
||||
*MSVCRT__errno() = MSVCRT_EEXIST;
|
||||
return MSVCRT_EEXIST;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _wmktemp (MSVCRT.@)
|
||||
*/
|
||||
|
|
|
@ -1180,7 +1180,7 @@
|
|||
@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr)
|
||||
@ cdecl _wmkdir(wstr) MSVCRT__wmkdir
|
||||
@ cdecl _wmktemp(wstr) MSVCRT__wmktemp
|
||||
# stub _wmktemp_s(wstr long)
|
||||
@ cdecl _wmktemp_s(wstr long) MSVCRT__wmktemp_s
|
||||
@ varargs _wopen(wstr long) MSVCRT__wopen
|
||||
# stub _woutput_s
|
||||
@ stub _wperror(wstr)
|
||||
|
|
Loading…
Reference in a new issue