mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
Merge pull request #3344 from yebblies/moreddmd
[DDMD] Use the A versions of WINAPI functions directly instead of using aliases
This commit is contained in:
commit
fab4eb24df
4 changed files with 10 additions and 10 deletions
|
@ -250,7 +250,7 @@ void *vmem_mapfile(const char *filename,void *ptr,unsigned long size,int flag)
|
||||||
|
|
||||||
dbg_printf("vmem_mapfile(filename = '%s', ptr = %p, size = x%lx, flag = %d)\n",filename,ptr,size,flag);
|
dbg_printf("vmem_mapfile(filename = '%s', ptr = %p, size = x%lx, flag = %d)\n",filename,ptr,size,flag);
|
||||||
|
|
||||||
hFile = CreateFile(filename, GENERIC_READ | GENERIC_WRITE,
|
hFile = CreateFileA(filename, GENERIC_READ | GENERIC_WRITE,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
|
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
|
||||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (hFile == INVALID_HANDLE_VALUE)
|
if (hFile == INVALID_HANDLE_VALUE)
|
||||||
|
@ -262,7 +262,7 @@ void *vmem_mapfile(const char *filename,void *ptr,unsigned long size,int flag)
|
||||||
if (flag == 1 && OsVerInfo.dwPlatformId == 1) // Windows 95, 98, ME
|
if (flag == 1 && OsVerInfo.dwPlatformId == 1) // Windows 95, 98, ME
|
||||||
hFileMap = NULL;
|
hFileMap = NULL;
|
||||||
else
|
else
|
||||||
hFileMap = CreateFileMapping(hFile,NULL,
|
hFileMap = CreateFileMappingA(hFile,NULL,
|
||||||
(flag == 1) ? PAGE_WRITECOPY : PAGE_READWRITE,0,size,NULL);
|
(flag == 1) ? PAGE_WRITECOPY : PAGE_READWRITE,0,size,NULL);
|
||||||
|
|
||||||
if (hFileMap == NULL) // mapping failed
|
if (hFileMap == NULL) // mapping failed
|
||||||
|
@ -706,7 +706,7 @@ long os_file_size(int fd)
|
||||||
char *file_8dot3name(const char *filename)
|
char *file_8dot3name(const char *filename)
|
||||||
{
|
{
|
||||||
HANDLE h;
|
HANDLE h;
|
||||||
WIN32_FIND_DATA fileinfo;
|
WIN32_FIND_DATAA fileinfo;
|
||||||
char *buf;
|
char *buf;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -770,7 +770,7 @@ err:
|
||||||
HANDLE h;
|
HANDLE h;
|
||||||
DWORD numwritten;
|
DWORD numwritten;
|
||||||
|
|
||||||
h = CreateFile((LPTSTR)name,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,
|
h = CreateFileA((LPTSTR)name,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,
|
||||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,NULL);
|
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,NULL);
|
||||||
if (h == INVALID_HANDLE_VALUE)
|
if (h == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
@ -778,7 +778,7 @@ err:
|
||||||
{
|
{
|
||||||
if (!file_createdirs(name))
|
if (!file_createdirs(name))
|
||||||
{
|
{
|
||||||
h = CreateFile((LPTSTR)name,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,
|
h = CreateFileA((LPTSTR)name,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,
|
||||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,NULL);
|
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,NULL);
|
||||||
if (h != INVALID_HANDLE_VALUE)
|
if (h != INVALID_HANDLE_VALUE)
|
||||||
goto Lok;
|
goto Lok;
|
||||||
|
|
|
@ -85,7 +85,7 @@ const char *inifile(const char *argv0x, const char *inifilex, const char *envsec
|
||||||
{
|
{
|
||||||
#if _WIN32 // This fix by Tim Matthews
|
#if _WIN32 // This fix by Tim Matthews
|
||||||
char resolved_name[MAX_PATH + 1];
|
char resolved_name[MAX_PATH + 1];
|
||||||
if(GetModuleFileName(NULL, resolved_name, MAX_PATH + 1) && FileName::exists(resolved_name))
|
if(GetModuleFileNameA(NULL, resolved_name, MAX_PATH + 1) && FileName::exists(resolved_name))
|
||||||
{
|
{
|
||||||
filename = (char *)FileName::replaceName(resolved_name, inifile);
|
filename = (char *)FileName::replaceName(resolved_name, inifile);
|
||||||
if(FileName::exists(filename))
|
if(FileName::exists(filename))
|
||||||
|
|
|
@ -227,7 +227,7 @@ int File::mmread()
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
name = this->name->toChars();
|
name = this->name->toChars();
|
||||||
hFile = CreateFile(name, GENERIC_READ,
|
hFile = CreateFileA(name, GENERIC_READ,
|
||||||
FILE_SHARE_READ, NULL,
|
FILE_SHARE_READ, NULL,
|
||||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (hFile == INVALID_HANDLE_VALUE)
|
if (hFile == INVALID_HANDLE_VALUE)
|
||||||
|
@ -235,7 +235,7 @@ int File::mmread()
|
||||||
size = GetFileSize(hFile, NULL);
|
size = GetFileSize(hFile, NULL);
|
||||||
//printf(" file created, size %d\n", size);
|
//printf(" file created, size %d\n", size);
|
||||||
|
|
||||||
hFileMap = CreateFileMapping(hFile,NULL,PAGE_READONLY,0,size,NULL);
|
hFileMap = CreateFileMappingA(hFile,NULL,PAGE_READONLY,0,size,NULL);
|
||||||
if (CloseHandle(hFile) != TRUE)
|
if (CloseHandle(hFile) != TRUE)
|
||||||
goto Lerr;
|
goto Lerr;
|
||||||
|
|
||||||
|
|
|
@ -652,11 +652,11 @@ const char *FileName::canonicalName(const char *name)
|
||||||
/* Apparently, there is no good way to do this on Windows.
|
/* Apparently, there is no good way to do this on Windows.
|
||||||
* GetFullPathName isn't it, but use it anyway.
|
* GetFullPathName isn't it, but use it anyway.
|
||||||
*/
|
*/
|
||||||
DWORD result = GetFullPathName(name, 0, NULL, NULL);
|
DWORD result = GetFullPathNameA(name, 0, NULL, NULL);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
char *buf = (char *)malloc(result);
|
char *buf = (char *)malloc(result);
|
||||||
result = GetFullPathName(name, result, buf, NULL);
|
result = GetFullPathNameA(name, result, buf, NULL);
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
{
|
{
|
||||||
::free(buf);
|
::free(buf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue