2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis and Cameron Heide
14 #include "wine/exception.h"
15 #include "debugtools.h"
17 DEFAULT_DEBUG_CHANNEL(win32
);
19 /* filter for page-fault exceptions */
20 static WINE_EXCEPTION_FILTER(page_fault
)
22 if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION
)
23 return EXCEPTION_EXECUTE_HANDLER
;
24 return EXCEPTION_CONTINUE_SEARCH
;
27 /***********************************************************************
28 * GetComputerNameA (KERNEL32.@)
30 BOOL WINAPI
GetComputerNameA(LPSTR name
,LPDWORD size
)
32 /* At least Win95OSR2 survives if size is not a pointer (NT crashes though) */
36 ret
= (-1!=gethostname(name
,*size
));
42 SetLastError( ERROR_INVALID_PARAMETER
);
50 /***********************************************************************
51 * GetComputerNameW (KERNEL32.@)
53 BOOL WINAPI
GetComputerNameW(LPWSTR name
,LPDWORD size
)
55 LPSTR nameA
= (LPSTR
)HeapAlloc( GetProcessHeap(), 0, *size
);
56 BOOL ret
= GetComputerNameA(nameA
,size
);
57 /* FIXME: should set *size in Unicode chars */
58 if (ret
) MultiByteToWideChar( CP_ACP
, 0, nameA
, -1, name
, *size
+1 );
59 HeapFree( GetProcessHeap(), 0, nameA
);