Added GetComputerNameEx[AW] semi-stub.

This commit is contained in:
Dmitry Timoshkov 2002-01-29 18:15:11 +00:00 committed by Alexandre Julliard
parent 5320a42a9c
commit 000b180a11
3 changed files with 48 additions and 7 deletions

View File

@ -226,6 +226,7 @@ debug_channels (comm console debugstr dll int resource stress thunk toolhelp
@ stdcall DebugBreak() DebugBreak
@ stdcall DefineDosDeviceA(long str str) DefineDosDeviceA
@ stub DefineDosDeviceW
@ stub DelayLoadFailureHook
@ stdcall DeleteAtom(long) DeleteAtom
@ forward DeleteCriticalSection ntdll.RtlDeleteCriticalSection
@ stdcall DeleteFileA(str) DeleteFileA
@ -336,6 +337,8 @@ debug_channels (comm console debugstr dll int resource stress thunk toolhelp
@ stdcall GetCompressedFileSizeA(long ptr) GetCompressedFileSizeA
@ stdcall GetCompressedFileSizeW(long ptr) GetCompressedFileSizeW
@ stdcall GetComputerNameA(ptr ptr) GetComputerNameA
@ stdcall GetComputerNameExA(long ptr ptr) GetComputerNameExA
@ stdcall GetComputerNameExW(long ptr ptr) GetComputerNameExW
@ stdcall GetComputerNameW(ptr ptr) GetComputerNameW
@ stdcall GetConsoleCP() GetConsoleCP
@ stdcall GetConsoleCursorInfo(long ptr) GetConsoleCursorInfo

View File

@ -977,7 +977,20 @@ typedef struct tagCOMMTIMEOUTS {
typedef void CALLBACK (*PAPCFUNC)(ULONG_PTR);
typedef void CALLBACK (*PTIMERAPCROUTINE)(LPVOID,DWORD,DWORD);
typedef enum _COMPUTER_NAME_FORMAT
{
ComputerNameNetBIOS,
ComputerNameDnsHostname,
ComputerNameDnsDomain,
ComputerNameDnsFullyQualified,
ComputerNamePhysicalNetBIOS,
ComputerNamePhysicalDnsHostname,
ComputerNamePhysicalDnsDomain,
ComputerNamePhysicalDnsFullyQualified,
ComputerNameMax
} COMPUTER_NAME_FORMAT;
/*DWORD WINAPI GetVersion( void );*/
BOOL WINAPI GetVersionExA(OSVERSIONINFOA*);
BOOL WINAPI GetVersionExW(OSVERSIONINFOW*);
@ -1063,6 +1076,7 @@ BOOL WINAPI BuildCommDCBAndTimeoutsW(LPCWSTR,LPDCB,LPCOMMTIMEOUTS);
#define BuildCommDCBAndTimeouts WINELIB_NAME_AW(BuildCommDCBAndTimeouts)
BOOL WINAPI CancelIo(HANDLE);
BOOL WINAPI CancelWaitableTimer(HANDLE);
BOOL WINAPI CheckTokenMembership(HANDLE,PSID,PBOOL);
BOOL WINAPI ClearCommBreak(HANDLE);
BOOL WINAPI ClearCommError(HANDLE,LPDWORD,LPCOMSTAT);
BOOL WINAPI ClearEventLogA(HANDLE,LPCSTR);
@ -1179,9 +1193,12 @@ BOOL WINAPI GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
LPSTR WINAPI GetCommandLineA(void);
LPWSTR WINAPI GetCommandLineW(void);
#define GetCommandLine WINELIB_NAME_AW(GetCommandLine)
BOOL WINAPI GetComputerNameA(LPSTR,LPDWORD);
BOOL WINAPI GetComputerNameW(LPWSTR,LPDWORD);
BOOL WINAPI GetComputerNameA(LPSTR,LPDWORD);
BOOL WINAPI GetComputerNameW(LPWSTR,LPDWORD);
#define GetComputerName WINELIB_NAME_AW(GetComputerName)
BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT,LPSTR,LPDWORD);
BOOL WINAPI GetComputerNameExW(COMPUTER_NAME_FORMAT,LPWSTR,LPDWORD);
#define GetComputerNameEx WINELIB_NAME_AW(GetComputerNameEx)
HANDLE WINAPI GetCurrentProcess(void);
HANDLE WINAPI GetCurrentThread(void);
BOOL WINAPI GetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,LPDWORD);

View File

@ -8,6 +8,8 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include "winnls.h"
#include "winbase.h"
#include "winerror.h"
@ -33,9 +35,16 @@ BOOL WINAPI GetComputerNameA(LPSTR name,LPDWORD size)
BOOL ret;
__TRY
{
ret = (-1!=gethostname(name,*size));
if (ret)
*size = strlen(name);
char host_name[256];
TRACE("*size = %ld\n", *size);
ret = (gethostname(host_name, sizeof(host_name)) != -1);
if (ret)
{
lstrcpynA(name, host_name, *size);
*size = strlen(name);
}
else
WARN("gethostname: %s\n", strerror(errno));
}
__EXCEPT(page_fault)
{
@ -43,7 +52,8 @@ BOOL WINAPI GetComputerNameA(LPSTR name,LPDWORD size)
return FALSE;
}
__ENDTRY
TRACE("returning (%ld) %s\n", *size, debugstr_a(name));
return ret;
}
@ -60,3 +70,14 @@ BOOL WINAPI GetComputerNameW(LPWSTR name,LPDWORD size)
return ret;
}
BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT type, LPSTR name, LPDWORD size)
{
FIXME("(%d, %p, %p) semi-stub!\n", type, name, size);
return GetComputerNameA(name, size);
}
BOOL WINAPI GetComputerNameExW(COMPUTER_NAME_FORMAT type, LPWSTR name, LPDWORD size)
{
FIXME("(%d, %p, %p) semi-stub!\n", type, name, size);
return GetComputerNameW(name, size);
}