windows.cfg: Fixed wrong configuration of GetModuleHandle(A|W)-functions (#5525)

This fixes a FP: `Variable 'path' can be declared as const array
[constVariable]`

The reason was the wrong direction attribute of GetModuleHandle()
This commit is contained in:
orbitcowboy 2023-10-07 13:59:01 +02:00 committed by GitHub
parent 723ba16eb6
commit 1d30b617c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 5 deletions

View File

@ -4825,7 +4825,7 @@ HFONT CreateFont(
<not-uninit/>
<not-bool/>
</arg>
<arg nr="2" direction="in">
<arg nr="2" direction="out">
<not-uninit/>
<strz/>
<minsize type="argvalue" arg="3"/>

View File

@ -8,14 +8,23 @@
//
#include <windows.h>
#include <stdio.h>
#include <cstdio>
#include <direct.h>
#include <stdlib.h>
#include <time.h>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <mbstring.h>
#include <wchar.h>
#include <atlstr.h>
#include <string>
/// https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew
std::string constVariable_GetModuleFileName(void) {
char path[42];
if (GetModuleFileNameA(NULL, path, sizeof(path))==0)
return std::string();
return std::string{path};
}
int stringCompare_mbscmp(const unsigned char *string1, const unsigned char *string2)
{