Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e2ab5b76
Commit
e2ab5b76
authored
Dec 12, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Implement DnsHostnameToComputerNameExW().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
356d0fcc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletion
+34
-1
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+1
-1
registry.c
dlls/kernelbase/registry.c
+32
-0
winbase.h
include/winbase.h
+1
-0
No files found.
dlls/kernelbase/kernelbase.spec
View file @
e2ab5b76
...
...
@@ -267,7 +267,7 @@
@ stdcall DisassociateCurrentThreadFromCallback(ptr) ntdll.TpDisassociateCallback
# @ stub DiscardVirtualMemory
@ stdcall DisconnectNamedPipe(long)
# @ stub DnsHostnameToComputerNameExW
@ stdcall DnsHostnameToComputerNameExW(wstr ptr ptr)
# @ stub DsBindWithSpnExW
# @ stub DsCrackNamesW
# @ stub DsFreeDomainControllerInfoW
...
...
dlls/kernelbase/registry.c
View file @
e2ab5b76
...
...
@@ -3046,6 +3046,38 @@ LSTATUS WINAPI RegLoadAppKeyW(const WCHAR *file, HKEY *result, REGSAM sam, DWORD
}
/***********************************************************************
* DnsHostnameToComputerNameExW (kernelbase.@)
*
* FIXME: how is this different from the non-Ex function?
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
DnsHostnameToComputerNameExW
(
const
WCHAR
*
hostname
,
WCHAR
*
computername
,
DWORD
*
size
)
{
static
const
WCHAR
allowed
[]
=
L"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&')(-_{}"
;
WCHAR
buffer
[
MAX_COMPUTERNAME_LENGTH
+
1
];
DWORD
i
,
len
;
lstrcpynW
(
buffer
,
hostname
,
MAX_COMPUTERNAME_LENGTH
+
1
);
len
=
lstrlenW
(
buffer
);
if
(
*
size
<
len
+
1
)
{
*
size
=
len
;
SetLastError
(
ERROR_MORE_DATA
);
return
FALSE
;
}
*
size
=
len
;
if
(
!
computername
)
return
FALSE
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
buffer
[
i
]
>=
'a'
&&
buffer
[
i
]
<=
'z'
)
computername
[
i
]
=
buffer
[
i
]
+
'A'
-
'a'
;
else
computername
[
i
]
=
wcschr
(
allowed
,
buffer
[
i
]
)
?
buffer
[
i
]
:
'_'
;
}
computername
[
len
]
=
0
;
return
TRUE
;
}
struct
USKEY
{
HKEY
HKCUstart
;
/* Start key in CU hive */
...
...
include/winbase.h
View file @
e2ab5b76
...
...
@@ -1958,6 +1958,7 @@ WINBASEAPI BOOL WINAPI DisconnectNamedPipe(HANDLE);
WINBASEAPI
BOOL
WINAPI
DnsHostnameToComputerNameA
(
LPCSTR
,
LPSTR
,
LPDWORD
);
WINBASEAPI
BOOL
WINAPI
DnsHostnameToComputerNameW
(
LPCWSTR
,
LPWSTR
,
LPDWORD
);
#define DnsHostnameToComputerName WINELIB_NAME_AW(DnsHostnameToComputerName)
WINBASEAPI
BOOL
WINAPI
DnsHostnameToComputerNameExW
(
LPCWSTR
,
LPWSTR
,
LPDWORD
);
WINBASEAPI
BOOL
WINAPI
DosDateTimeToFileTime
(
WORD
,
WORD
,
LPFILETIME
);
WINBASEAPI
BOOL
WINAPI
DuplicateHandle
(
HANDLE
,
HANDLE
,
HANDLE
,
HANDLE
*
,
DWORD
,
BOOL
,
DWORD
);
WINADVAPI
BOOL
WINAPI
DuplicateToken
(
HANDLE
,
SECURITY_IMPERSONATION_LEVEL
,
PHANDLE
);
...
...
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