From 34e10ee30f2ed7bcf865c0529b59451267017813 Mon Sep 17 00:00:00 2001 From: Hidenori Takeshima Date: Sat, 24 Jun 2000 13:37:05 +0000 Subject: [PATCH] GetCommandLine should return non-const strings. --- include/winbase.h | 8 ++++++-- memory/environ.c | 4 ++-- tools/winebuild/spec32.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/winbase.h b/include/winbase.h index 654fe610a36..32e371b7fef 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1379,8 +1379,8 @@ BOOL WINAPI GetCommModemStatus(HANDLE,LPDWORD); BOOL WINAPI GetCommProperties(HANDLE,LPCOMMPROP); BOOL WINAPI GetCommState(HANDLE,LPDCB); BOOL WINAPI GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS); -LPCSTR WINAPI GetCommandLineA(void); -LPCWSTR WINAPI GetCommandLineW(void); +LPSTR WINAPI GetCommandLineA(void); +LPWSTR WINAPI GetCommandLineW(void); #define GetCommandLine WINELIB_NAME_AW(GetCommandLine) BOOL WINAPI GetComputerNameA(LPSTR,LPDWORD); BOOL WINAPI GetComputerNameW(LPWSTR,LPDWORD); @@ -2004,6 +2004,10 @@ VOID WINAPI SetLastError(DWORD); #define GetCurrentThread() ((HANDLE)0xfffffffe) #endif +/* WinMain(entry point) must be declared in winbase.h. */ +/* If this is not declared, we cannot compile many sources written with C++. */ +int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int); + #ifdef __cplusplus } #endif diff --git a/memory/environ.c b/memory/environ.c index d3eb41df926..07f8c97f497 100644 --- a/memory/environ.c +++ b/memory/environ.c @@ -103,7 +103,7 @@ BOOL ENV_BuildEnvironment(void) /*********************************************************************** * GetCommandLineA (KERNEL32.289) */ -LPCSTR WINAPI GetCommandLineA(void) +LPSTR WINAPI GetCommandLineA(void) { return PROCESS_Current()->env_db->cmd_line; } @@ -111,7 +111,7 @@ LPCSTR WINAPI GetCommandLineA(void) /*********************************************************************** * GetCommandLineW (KERNEL32.290) */ -LPCWSTR WINAPI GetCommandLineW(void) +LPWSTR WINAPI GetCommandLineW(void) { PDB *pdb = PROCESS_Current(); EnterCriticalSection( &pdb->env_db->section ); diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 65c2ba7bc9b..383cb0eb55b 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -395,9 +395,9 @@ void BuildSpec32File( FILE *outfile ) "\n#include \n" "static void exe_main(void)\n" "{\n" - " extern int PASCAL %s(HINSTANCE,HINSTANCE,LPCSTR,INT);\n" + " extern int PASCAL %s(HINSTANCE,HINSTANCE,LPSTR,INT);\n" " STARTUPINFOA info;\n" - " const char *cmdline = GetCommandLineA();\n" + " LPSTR cmdline = GetCommandLineA();\n" " while (*cmdline && *cmdline != ' ') cmdline++;\n" " if (*cmdline) cmdline++;\n" " GetStartupInfoA( &info );\n"