GetCommandLine should return non-const strings.

This commit is contained in:
Hidenori Takeshima 2000-06-24 13:37:05 +00:00 committed by Alexandre Julliard
parent 20b87c06eb
commit 34e10ee30f
3 changed files with 10 additions and 6 deletions

View File

@ -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);
#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

View File

@ -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)
/*********************************************************************** /***********************************************************************
* 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 );

View File

@ -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"