Release 970914
[wine] / win32 / environment.c
1 /*
2  * Win32 kernel functions
3  *
4  * Copyright 1995 Martin von Loewis and Cameron Heide
5  */
6
7 #include <stdio.h>
8 #include <string.h>
9 #include <unistd.h>
10 #include "windows.h"
11 #include "winerror.h"
12 #include "module.h"
13 #include "task.h"
14 #include "stddebug.h"
15 #include "debug.h"
16
17
18 /***********************************************************************
19  *           GetCommandLineA      (KERNEL32.161)
20  */
21 LPCSTR WINAPI GetCommandLine32A(void)
22 {
23     static char buffer[256];
24     char *cp;
25     PDB *pdb = (PDB *)GlobalLock16( GetCurrentPDB() );
26
27     /* FIXME: should use pCurrentProcess->env_db->cmd_line here */
28     lstrcpyn32A( buffer, MODULE_GetModuleName(GetCurrentTask()),
29                  sizeof(buffer) - 1 );
30     cp = buffer + strlen(buffer);
31     if (pdb->cmdLine[0])
32     {
33         *cp++ = ' ';
34         memcpy( cp, &pdb->cmdLine[1], pdb->cmdLine[0] );
35     }
36     dprintf_win32(stddeb,"CommandLine = %s\n", buffer );
37     return buffer;
38 }
39
40 /***********************************************************************
41  *           GetCommandLineW      (KERNEL32.162)
42  */
43 LPCWSTR WINAPI GetCommandLine32W(void)
44 {
45     static WCHAR buffer[256];
46
47     lstrcpynAtoW(buffer,GetCommandLine32A(),256);
48     return buffer;
49 }
50
51
52 /***********************************************************************
53  *           GetSystemPowerStatus      (KERNEL32.621)
54  */
55 BOOL32 WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
56 {
57     return FALSE;   /* no power management support */
58 }
59
60
61 /***********************************************************************
62  *           SetSystemPowerState      (KERNEL32.630)
63  */
64 BOOL32 WINAPI SetSystemPowerState(BOOL32 suspend_or_hibernate,
65                                   BOOL32 force_flag)
66 {
67     /* suspend_or_hibernate flag: w95 does not support
68        this feature anyway */
69
70     for ( ;0; )
71     {
72         if ( force_flag )
73         {
74         }
75         else
76         {
77         }
78     }
79     return TRUE;
80 }
81