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
65d12829
Commit
65d12829
authored
Nov 12, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Perform a case-insensitive string comparison in NETAPI_IsLocalComputer.
parent
edbf3ac0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
31 deletions
+18
-31
netapi32.c
dlls/netapi32/netapi32.c
+18
-31
No files found.
dlls/netapi32/netapi32.c
View file @
65d12829
...
@@ -50,10 +50,27 @@
...
@@ -50,10 +50,27 @@
#include "dsgetdc.h"
#include "dsgetdc.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/list.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
netapi32
);
WINE_DEFAULT_DEBUG_CHANNEL
(
netapi32
);
BOOL
NETAPI_IsLocalComputer
(
LMCSTR
ServerName
);
/************************************************************
* NETAPI_IsLocalComputer
*
* Checks whether the server name indicates local machine.
*/
static
BOOL
NETAPI_IsLocalComputer
(
LMCSTR
name
)
{
WCHAR
buf
[
MAX_COMPUTERNAME_LENGTH
+
1
];
DWORD
size
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
BOOL
ret
;
if
(
!
name
||
!
name
[
0
])
return
TRUE
;
ret
=
GetComputerNameW
(
buf
,
&
size
);
if
(
ret
&&
name
[
0
]
==
'\\'
&&
name
[
1
]
==
'\\'
)
name
+=
2
;
return
ret
&&
!
strcmpiW
(
name
,
buf
);
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
{
...
@@ -411,36 +428,6 @@ NET_API_STATUS WINAPI NetFileEnum(
...
@@ -411,36 +428,6 @@ NET_API_STATUS WINAPI NetFileEnum(
return
ERROR_NOT_SUPPORTED
;
return
ERROR_NOT_SUPPORTED
;
}
}
/************************************************************
* NETAPI_IsLocalComputer
*
* Checks whether the server name indicates local machine.
*/
DECLSPEC_HIDDEN
BOOL
NETAPI_IsLocalComputer
(
LMCSTR
ServerName
)
{
if
(
!
ServerName
)
{
return
TRUE
;
}
else
if
(
ServerName
[
0
]
==
'\0'
)
return
TRUE
;
else
{
DWORD
dwSize
=
MAX_COMPUTERNAME_LENGTH
+
1
;
BOOL
Result
;
LPWSTR
buf
;
NetApiBufferAllocate
(
dwSize
*
sizeof
(
WCHAR
),
(
LPVOID
*
)
&
buf
);
Result
=
GetComputerNameW
(
buf
,
&
dwSize
);
if
(
Result
&&
(
ServerName
[
0
]
==
'\\'
)
&&
(
ServerName
[
1
]
==
'\\'
))
ServerName
+=
2
;
Result
=
Result
&&
!
lstrcmpW
(
ServerName
,
buf
);
NetApiBufferFree
(
buf
);
return
Result
;
}
}
static
void
wprint_mac
(
WCHAR
*
buffer
,
int
len
,
const
MIB_IFROW
*
ifRow
)
static
void
wprint_mac
(
WCHAR
*
buffer
,
int
len
,
const
MIB_IFROW
*
ifRow
)
{
{
int
i
;
int
i
;
...
...
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