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 DebugBreak() DebugBreak
@ stdcall DefineDosDeviceA(long str str) DefineDosDeviceA @ stdcall DefineDosDeviceA(long str str) DefineDosDeviceA
@ stub DefineDosDeviceW @ stub DefineDosDeviceW
@ stub DelayLoadFailureHook
@ stdcall DeleteAtom(long) DeleteAtom @ stdcall DeleteAtom(long) DeleteAtom
@ forward DeleteCriticalSection ntdll.RtlDeleteCriticalSection @ forward DeleteCriticalSection ntdll.RtlDeleteCriticalSection
@ stdcall DeleteFileA(str) DeleteFileA @ 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 GetCompressedFileSizeA(long ptr) GetCompressedFileSizeA
@ stdcall GetCompressedFileSizeW(long ptr) GetCompressedFileSizeW @ stdcall GetCompressedFileSizeW(long ptr) GetCompressedFileSizeW
@ stdcall GetComputerNameA(ptr ptr) GetComputerNameA @ stdcall GetComputerNameA(ptr ptr) GetComputerNameA
@ stdcall GetComputerNameExA(long ptr ptr) GetComputerNameExA
@ stdcall GetComputerNameExW(long ptr ptr) GetComputerNameExW
@ stdcall GetComputerNameW(ptr ptr) GetComputerNameW @ stdcall GetComputerNameW(ptr ptr) GetComputerNameW
@ stdcall GetConsoleCP() GetConsoleCP @ stdcall GetConsoleCP() GetConsoleCP
@ stdcall GetConsoleCursorInfo(long ptr) GetConsoleCursorInfo @ stdcall GetConsoleCursorInfo(long ptr) GetConsoleCursorInfo

View File

@ -977,7 +977,20 @@ typedef struct tagCOMMTIMEOUTS {
typedef void CALLBACK (*PAPCFUNC)(ULONG_PTR); typedef void CALLBACK (*PAPCFUNC)(ULONG_PTR);
typedef void CALLBACK (*PTIMERAPCROUTINE)(LPVOID,DWORD,DWORD); 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 );*/ /*DWORD WINAPI GetVersion( void );*/
BOOL WINAPI GetVersionExA(OSVERSIONINFOA*); BOOL WINAPI GetVersionExA(OSVERSIONINFOA*);
BOOL WINAPI GetVersionExW(OSVERSIONINFOW*); BOOL WINAPI GetVersionExW(OSVERSIONINFOW*);
@ -1063,6 +1076,7 @@ BOOL WINAPI BuildCommDCBAndTimeoutsW(LPCWSTR,LPDCB,LPCOMMTIMEOUTS);
#define BuildCommDCBAndTimeouts WINELIB_NAME_AW(BuildCommDCBAndTimeouts) #define BuildCommDCBAndTimeouts WINELIB_NAME_AW(BuildCommDCBAndTimeouts)
BOOL WINAPI CancelIo(HANDLE); BOOL WINAPI CancelIo(HANDLE);
BOOL WINAPI CancelWaitableTimer(HANDLE); BOOL WINAPI CancelWaitableTimer(HANDLE);
BOOL WINAPI CheckTokenMembership(HANDLE,PSID,PBOOL);
BOOL WINAPI ClearCommBreak(HANDLE); BOOL WINAPI ClearCommBreak(HANDLE);
BOOL WINAPI ClearCommError(HANDLE,LPDWORD,LPCOMSTAT); BOOL WINAPI ClearCommError(HANDLE,LPDWORD,LPCOMSTAT);
BOOL WINAPI ClearEventLogA(HANDLE,LPCSTR); BOOL WINAPI ClearEventLogA(HANDLE,LPCSTR);
@ -1179,9 +1193,12 @@ BOOL WINAPI GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
LPSTR WINAPI GetCommandLineA(void); LPSTR WINAPI GetCommandLineA(void);
LPWSTR 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);
#define GetComputerName WINELIB_NAME_AW(GetComputerName) #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 GetCurrentProcess(void);
HANDLE WINAPI GetCurrentThread(void); HANDLE WINAPI GetCurrentThread(void);
BOOL WINAPI GetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,LPDWORD); BOOL WINAPI GetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,LPDWORD);

View File

@ -8,6 +8,8 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h>
#include "winnls.h" #include "winnls.h"
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
@ -33,9 +35,16 @@ BOOL WINAPI GetComputerNameA(LPSTR name,LPDWORD size)
BOOL ret; BOOL ret;
__TRY __TRY
{ {
ret = (-1!=gethostname(name,*size)); char host_name[256];
if (ret) TRACE("*size = %ld\n", *size);
*size = strlen(name); 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) __EXCEPT(page_fault)
{ {
@ -43,7 +52,8 @@ BOOL WINAPI GetComputerNameA(LPSTR name,LPDWORD size)
return FALSE; return FALSE;
} }
__ENDTRY __ENDTRY
TRACE("returning (%ld) %s\n", *size, debugstr_a(name));
return ret; return ret;
} }
@ -60,3 +70,14 @@ BOOL WINAPI GetComputerNameW(LPWSTR name,LPDWORD size)
return ret; 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);
}