2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis and Cameron Heide
12 #include "wine/winestring.h"
15 #include "debugtools.h"
18 DEFAULT_DEBUG_CHANNEL(win32
)
20 /***********************************************************************
21 * GetStartupInfoA (KERNEL32.273)
23 VOID WINAPI
GetStartupInfoA(LPSTARTUPINFOA lpStartupInfo
)
26 LPSTARTUPINFOA startup
;
28 startup
= ((LPSTARTUPINFOA
)PROCESS_Current()->env_db
->startup_info
);
29 memcpy ( lpStartupInfo
, startup
, sizeof (STARTUPINFOA
) );
32 "\tlpReserverd: %s, lpDesktop: %s, lpTitle: %s\n"
33 "\tdwX: %ld, dwY: %ld, dwXSize: %ld, dwYSize: %ld\n"
34 "\tdwFlags: %lx, wShowWindow: %x\n", lpStartupInfo
->cb
,
35 lpStartupInfo
->lpReserved
, lpStartupInfo
->lpDesktop
,
36 lpStartupInfo
->lpTitle
, lpStartupInfo
->dwX
,
37 lpStartupInfo
->dwY
, lpStartupInfo
->dwXSize
,
38 lpStartupInfo
->dwYSize
, lpStartupInfo
->dwFlags
,
39 lpStartupInfo
->wShowWindow
);
42 /***********************************************************************
43 * GetStartupInfoW (KERNEL32.274)
45 VOID WINAPI
GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo
)
49 GetStartupInfoA ( &startup
);
51 lpStartupInfo
->cb
= sizeof(STARTUPINFOW
);
52 lpStartupInfo
->lpReserved
=
53 HEAP_strdupAtoW (GetProcessHeap(), 0, startup
.lpReserved
);
54 lpStartupInfo
->lpDesktop
=
55 HEAP_strdupAtoW (GetProcessHeap(), 0, startup
.lpDesktop
);
56 lpStartupInfo
->lpTitle
=
57 HEAP_strdupAtoW (GetProcessHeap(), 0, startup
.lpTitle
);
58 lpStartupInfo
->dwX
= startup
.dwX
;
59 lpStartupInfo
->dwY
= startup
.dwY
;
60 lpStartupInfo
->dwXSize
= startup
.dwXSize
;
61 lpStartupInfo
->dwXCountChars
= startup
.dwXCountChars
;
62 lpStartupInfo
->dwYCountChars
= startup
.dwYCountChars
;
63 lpStartupInfo
->dwFillAttribute
= startup
.dwFillAttribute
;
64 lpStartupInfo
->dwFlags
= startup
.dwFlags
;
65 lpStartupInfo
->wShowWindow
= startup
.wShowWindow
;
66 lpStartupInfo
->cbReserved2
= startup
.cbReserved2
;
67 lpStartupInfo
->lpReserved2
= startup
.lpReserved2
;
68 lpStartupInfo
->hStdInput
= startup
.hStdInput
;
69 lpStartupInfo
->hStdOutput
= startup
.hStdOutput
;
70 lpStartupInfo
->hStdError
= startup
.hStdError
;
73 /***********************************************************************
74 * GetComputerNameA (KERNEL32.165)
76 BOOL WINAPI
GetComputerNameA(LPSTR name
,LPDWORD size
)
78 if (-1==gethostname(name
,*size
))
80 *size
= lstrlenA(name
);
84 /***********************************************************************
85 * GetComputerNameW (KERNEL32.166)
87 BOOL WINAPI
GetComputerNameW(LPWSTR name
,LPDWORD size
)
89 LPSTR nameA
= (LPSTR
)HeapAlloc( GetProcessHeap(), 0, *size
);
90 BOOL ret
= GetComputerNameA(nameA
,size
);
91 if (ret
) lstrcpynAtoW(name
,nameA
,*size
+1);
92 HeapFree( GetProcessHeap(), 0, nameA
);