Commit 34e10ee3 authored by Hidenori Takeshima's avatar Hidenori Takeshima Committed by Alexandre Julliard

GetCommandLine should return non-const strings.

parent 20b87c06
...@@ -1379,8 +1379,8 @@ BOOL WINAPI GetCommModemStatus(HANDLE,LPDWORD); ...@@ -1379,8 +1379,8 @@ BOOL WINAPI GetCommModemStatus(HANDLE,LPDWORD);
BOOL WINAPI GetCommProperties(HANDLE,LPCOMMPROP); BOOL WINAPI GetCommProperties(HANDLE,LPCOMMPROP);
BOOL WINAPI GetCommState(HANDLE,LPDCB); BOOL WINAPI GetCommState(HANDLE,LPDCB);
BOOL WINAPI GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS); BOOL WINAPI GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
LPCSTR WINAPI GetCommandLineA(void); LPSTR WINAPI GetCommandLineA(void);
LPCWSTR WINAPI GetCommandLineW(void); LPWSTR WINAPI GetCommandLineW(void);
#define GetCommandLine WINELIB_NAME_AW(GetCommandLine) #define GetCommandLine WINELIB_NAME_AW(GetCommandLine)
BOOL WINAPI GetComputerNameA(LPSTR,LPDWORD); BOOL WINAPI GetComputerNameA(LPSTR,LPDWORD);
BOOL WINAPI GetComputerNameW(LPWSTR,LPDWORD); BOOL WINAPI GetComputerNameW(LPWSTR,LPDWORD);
...@@ -2004,6 +2004,10 @@ VOID WINAPI SetLastError(DWORD); ...@@ -2004,6 +2004,10 @@ VOID WINAPI SetLastError(DWORD);
#define GetCurrentThread() ((HANDLE)0xfffffffe) #define GetCurrentThread() ((HANDLE)0xfffffffe)
#endif #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 #ifdef __cplusplus
} }
#endif #endif
......
...@@ -103,7 +103,7 @@ BOOL ENV_BuildEnvironment(void) ...@@ -103,7 +103,7 @@ BOOL ENV_BuildEnvironment(void)
/*********************************************************************** /***********************************************************************
* GetCommandLineA (KERNEL32.289) * GetCommandLineA (KERNEL32.289)
*/ */
LPCSTR WINAPI GetCommandLineA(void) LPSTR WINAPI GetCommandLineA(void)
{ {
return PROCESS_Current()->env_db->cmd_line; return PROCESS_Current()->env_db->cmd_line;
} }
...@@ -111,7 +111,7 @@ LPCSTR WINAPI GetCommandLineA(void) ...@@ -111,7 +111,7 @@ LPCSTR WINAPI GetCommandLineA(void)
/*********************************************************************** /***********************************************************************
* GetCommandLineW (KERNEL32.290) * GetCommandLineW (KERNEL32.290)
*/ */
LPCWSTR WINAPI GetCommandLineW(void) LPWSTR WINAPI GetCommandLineW(void)
{ {
PDB *pdb = PROCESS_Current(); PDB *pdb = PROCESS_Current();
EnterCriticalSection( &pdb->env_db->section ); EnterCriticalSection( &pdb->env_db->section );
......
...@@ -395,9 +395,9 @@ void BuildSpec32File( FILE *outfile ) ...@@ -395,9 +395,9 @@ void BuildSpec32File( FILE *outfile )
"\n#include <winbase.h>\n" "\n#include <winbase.h>\n"
"static void exe_main(void)\n" "static void exe_main(void)\n"
"{\n" "{\n"
" extern int PASCAL %s(HINSTANCE,HINSTANCE,LPCSTR,INT);\n" " extern int PASCAL %s(HINSTANCE,HINSTANCE,LPSTR,INT);\n"
" STARTUPINFOA info;\n" " STARTUPINFOA info;\n"
" const char *cmdline = GetCommandLineA();\n" " LPSTR cmdline = GetCommandLineA();\n"
" while (*cmdline && *cmdline != ' ') cmdline++;\n" " while (*cmdline && *cmdline != ' ') cmdline++;\n"
" if (*cmdline) cmdline++;\n" " if (*cmdline) cmdline++;\n"
" GetStartupInfoA( &info );\n" " GetStartupInfoA( &info );\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment