2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis and Cameron Heide
13 #include "wine/exception.h"
16 #include "debugtools.h"
18 DEFAULT_DEBUG_CHANNEL(win32
);
20 /* filter for page-fault exceptions */
21 static WINE_EXCEPTION_FILTER(page_fault
)
23 if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION
)
24 return EXCEPTION_EXECUTE_HANDLER
;
25 return EXCEPTION_CONTINUE_SEARCH
;
28 /***********************************************************************
29 * GetComputerNameA (KERNEL32.165)
31 BOOL WINAPI
GetComputerNameA(LPSTR name
,LPDWORD size
)
33 /* At least Win95OSR2 survives if size is not a pointer (NT crashes though) */
37 ret
= (-1!=gethostname(name
,*size
));
43 SetLastError( ERROR_INVALID_PARAMETER
);
51 /***********************************************************************
52 * GetComputerNameW (KERNEL32.166)
54 BOOL WINAPI
GetComputerNameW(LPWSTR name
,LPDWORD size
)
56 LPSTR nameA
= (LPSTR
)HeapAlloc( GetProcessHeap(), 0, *size
);
57 BOOL ret
= GetComputerNameA(nameA
,size
);
58 /* FIXME: should set *size in Unicode chars */
59 if (ret
) MultiByteToWideChar( CP_ACP
, 0, nameA
, -1, name
, *size
+1 );
60 HeapFree( GetProcessHeap(), 0, nameA
);