windows.cfg: Fixed FP for invalidFunctionArg in second argument of _getcwd(). Reference: https://docs.microsoft.com/en-us/previous-versions/sf98bd4y(v%3Dvs.140)

This commit is contained in:
orbitcowboy 2019-03-25 09:07:02 +01:00
parent b6faa11fbf
commit 9bfe7d74c0
2 changed files with 15 additions and 1 deletions

View File

@ -1846,7 +1846,8 @@
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<valid>1:</valid>
<!-- Zero length is allowed in case the first argument is NULL. -->
<valid>0:</valid>
<not-bool/>
</arg>
</function>

View File

@ -8,6 +8,19 @@
//
#include <windows.h>
#include <direct.h>
#include <stdlib.h>
void invalidFunctionArg__getcwd(char * buffer)
{
// Passing NULL as the buffer forces getcwd to allocate
// memory for the path, which allows the code to support file paths
// longer than _MAX_PATH, which are supported by NTFS.
if ((buffer = _getcwd(NULL, 0)) == NULL) {
return;
}
free(buffer);
}
void validCode()
{