Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e7ee4776
Commit
e7ee4776
authored
Feb 27, 2000
by
Uwe Bonnes
Committed by
Alexandre Julliard
Feb 27, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetComputerNameA(): added parameter check like Win95 does.
parent
89cf0ae1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
init.c
win32/init.c
+25
-4
No files found.
win32/init.c
View file @
e7ee4776
...
@@ -10,13 +10,22 @@
...
@@ -10,13 +10,22 @@
#include <stdlib.h>
#include <stdlib.h>
#include "winerror.h"
#include "winerror.h"
#include "wine/winestring.h"
#include "wine/winestring.h"
#include "wine/exception.h"
#include "heap.h"
#include "heap.h"
#include "task.h"
#include "task.h"
#include "debugtools.h"
#include "debugtools.h"
#include "process.h"
#include "process.h"
DEFAULT_DEBUG_CHANNEL
(
win32
)
DEFAULT_DEBUG_CHANNEL
(
win32
)
;
/* filter for page-fault exceptions */
static
WINE_EXCEPTION_FILTER
(
page_fault
)
{
if
(
GetExceptionCode
()
==
EXCEPTION_ACCESS_VIOLATION
)
return
EXCEPTION_EXECUTE_HANDLER
;
return
EXCEPTION_CONTINUE_SEARCH
;
}
/***********************************************************************
/***********************************************************************
* GetStartupInfoA (KERNEL32.273)
* GetStartupInfoA (KERNEL32.273)
*/
*/
...
@@ -76,10 +85,22 @@ VOID WINAPI GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo)
...
@@ -76,10 +85,22 @@ VOID WINAPI GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo)
*/
*/
BOOL
WINAPI
GetComputerNameA
(
LPSTR
name
,
LPDWORD
size
)
BOOL
WINAPI
GetComputerNameA
(
LPSTR
name
,
LPDWORD
size
)
{
{
if
(
-
1
==
gethostname
(
name
,
*
size
))
/* At least Win95OSR2 survives if size is not a pointer (NT crashes though) */
return
FALSE
;
BOOL
ret
;
__TRY
{
ret
=
(
-
1
!=
gethostname
(
name
,
*
size
));
if
(
ret
)
*
size
=
lstrlenA
(
name
);
*
size
=
lstrlenA
(
name
);
return
TRUE
;
}
__EXCEPT
(
page_fault
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
__ENDTRY
return
ret
;
}
}
/***********************************************************************
/***********************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment