2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis and Cameron Heide
12 #include "wine/winestring.h"
19 /***********************************************************************
20 * GetStartupInfoA (KERNEL32.273)
22 VOID WINAPI GetStartupInfoA(LPSTARTUPINFOA lpStartupInfo)
25 LPSTARTUPINFOA startup;
27 startup = ((LPSTARTUPINFOA )PROCESS_Current()->env_db->startup_info);
28 memcpy ( lpStartupInfo, startup, sizeof (STARTUPINFOA) );
30 TRACE ( win32, "size: %ld\n"
31 "\tlpReserverd: %s, lpDesktop: %s, lpTitle: %s\n"
32 "\tdwX: %ld, dwY: %ld, dwXSize: %ld, dwYSize: %ld\n"
33 "\tdwFlags: %lx, wShowWindow: %x\n", lpStartupInfo->cb,
34 lpStartupInfo->lpReserved, lpStartupInfo->lpDesktop,
35 lpStartupInfo->lpTitle, lpStartupInfo->dwX,
36 lpStartupInfo->dwY, lpStartupInfo->dwXSize,
37 lpStartupInfo->dwYSize, lpStartupInfo->dwFlags,
38 lpStartupInfo->wShowWindow );
41 /***********************************************************************
42 * GetStartupInfoW (KERNEL32.274)
44 VOID WINAPI GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo)
48 GetStartupInfoA ( &startup );
50 lpStartupInfo->cb = sizeof(STARTUPINFOW);
51 lpStartupInfo->lpReserved =
52 HEAP_strdupAtoW (GetProcessHeap(), 0, startup.lpReserved );
53 lpStartupInfo->lpDesktop =
54 HEAP_strdupAtoW (GetProcessHeap(), 0, startup.lpDesktop );
55 lpStartupInfo->lpTitle =
56 HEAP_strdupAtoW (GetProcessHeap(), 0, startup.lpTitle );
57 lpStartupInfo->dwX = startup.dwX;
58 lpStartupInfo->dwY = startup.dwY;
59 lpStartupInfo->dwXSize = startup.dwXSize;
60 lpStartupInfo->dwXCountChars = startup.dwXCountChars;
61 lpStartupInfo->dwYCountChars = startup.dwYCountChars;
62 lpStartupInfo->dwFillAttribute = startup.dwFillAttribute;
63 lpStartupInfo->dwFlags = startup.dwFlags;
64 lpStartupInfo->wShowWindow = startup.wShowWindow;
65 lpStartupInfo->cbReserved2 = startup.cbReserved2;
66 lpStartupInfo->lpReserved2 = startup.lpReserved2;
67 lpStartupInfo->hStdInput = startup.hStdInput;
68 lpStartupInfo->hStdOutput = startup.hStdOutput;
69 lpStartupInfo->hStdError = startup.hStdError;
72 /***********************************************************************
73 * GetComputerNameA (KERNEL32.165)
75 BOOL WINAPI GetComputerNameA(LPSTR name,LPDWORD size)
77 if (-1==gethostname(name,*size))
79 *size = lstrlenA(name);
83 /***********************************************************************
84 * GetComputerNameW (KERNEL32.166)
86 BOOL WINAPI GetComputerNameW(LPWSTR name,LPDWORD size)
88 LPSTR nameA = (LPSTR)HeapAlloc( GetProcessHeap(), 0, *size);
89 BOOL ret = GetComputerNameA(nameA,size);
90 if (ret) lstrcpynAtoW(name,nameA,*size+1);
91 HeapFree( GetProcessHeap(), 0, nameA );