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
a1cdcc52
Commit
a1cdcc52
authored
Jun 17, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
921e0457
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
124 additions
and
181 deletions
+124
-181
Makefile.in
dlls/ntoskrnl.exe/Makefile.in
+2
-0
instr.c
dlls/ntoskrnl.exe/instr.c
+0
-3
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+19
-75
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+78
-78
pnp.c
dlls/ntoskrnl.exe/pnp.c
+25
-24
sync.c
dlls/ntoskrnl.exe/sync.c
+0
-1
No files found.
dlls/ntoskrnl.exe/Makefile.in
View file @
a1cdcc52
...
...
@@ -3,6 +3,8 @@ IMPORTLIB = ntoskrnl
IMPORTS
=
advapi32 hal
DELAYIMPORTS
=
setupapi user32
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
instr.c
\
ntoskrnl.c
\
...
...
dlls/ntoskrnl.exe/instr.c
View file @
a1cdcc52
...
...
@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#define NONAMELESSUNION
...
...
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
a1cdcc52
...
...
@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <assert.h>
...
...
@@ -44,7 +41,6 @@
#include "ddk/ntddk.h"
#include "ddk/ntifs.h"
#include "ddk/wdm.h"
#include "wine/unicode.h"
#include "wine/server.h"
#include "wine/debug.h"
#include "wine/heap.h"
...
...
@@ -301,7 +297,7 @@ NTSTATUS kernel_object_from_handle( HANDLE handle, POBJECT_TYPE type, void **ret
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
known_types
);
i
++
)
{
type
=
*
known_types
[
i
];
if
(
!
RtlCompareUnicodeStrings
(
type
->
name
,
strlenW
(
type
->
name
),
type_info
->
TypeName
.
Buffer
,
if
(
!
RtlCompareUnicodeStrings
(
type
->
name
,
l
strlenW
(
type
->
name
),
type_info
->
TypeName
.
Buffer
,
type_info
->
TypeName
.
Length
/
sizeof
(
WCHAR
),
FALSE
))
break
;
}
...
...
@@ -312,7 +308,7 @@ NTSTATUS kernel_object_from_handle( HANDLE handle, POBJECT_TYPE type, void **ret
return
STATUS_INVALID_HANDLE
;
}
}
else
if
(
RtlCompareUnicodeStrings
(
type
->
name
,
strlenW
(
type
->
name
),
type_info
->
TypeName
.
Buffer
,
else
if
(
RtlCompareUnicodeStrings
(
type
->
name
,
l
strlenW
(
type
->
name
),
type_info
->
TypeName
.
Buffer
,
type_info
->
TypeName
.
Length
/
sizeof
(
WCHAR
),
FALSE
)
)
{
LeaveCriticalSection
(
&
handle_map_cs
);
...
...
@@ -1337,18 +1333,18 @@ static void build_driver_keypath( const WCHAR *name, UNICODE_STRING *keypath )
WCHAR
*
str
;
/* Check what prefix is present */
if
(
strncmpW
(
name
,
servicesW
,
strlenW
(
servicesW
)
)
==
0
)
if
(
wcsncmp
(
name
,
servicesW
,
l
strlenW
(
servicesW
)
)
==
0
)
{
FIXME
(
"Driver name %s is malformed as the keypath
\n
"
,
debugstr_w
(
name
)
);
RtlCreateUnicodeString
(
keypath
,
name
);
return
;
}
if
(
strncmpW
(
name
,
driverW
,
strlenW
(
driverW
)
)
==
0
)
name
+=
strlenW
(
driverW
);
if
(
wcsncmp
(
name
,
driverW
,
l
strlenW
(
driverW
)
)
==
0
)
name
+=
l
strlenW
(
driverW
);
else
FIXME
(
"Driver name %s does not properly begin with
\\
Driver
\\\n
"
,
debugstr_w
(
name
)
);
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
servicesW
)
+
strlenW
(
name
)
*
sizeof
(
WCHAR
));
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
servicesW
)
+
l
strlenW
(
name
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
str
,
servicesW
);
lstrcatW
(
str
,
name
);
RtlInitUnicodeString
(
keypath
,
str
);
...
...
@@ -1488,13 +1484,13 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
{
do
{
s
printfW
(
autoW
,
auto_format
,
auto_idx
++
);
s
wprintf
(
autoW
,
ARRAY_SIZE
(
autoW
)
,
auto_format
,
auto_idx
++
);
SERVER_START_REQ
(
create_device
)
{
req
->
rootdir
=
0
;
req
->
manager
=
wine_server_obj_handle
(
manager
);
req
->
user_ptr
=
wine_server_client_ptr
(
device
);
wine_server_add_data
(
req
,
autoW
,
strlenW
(
autoW
)
*
sizeof
(
WCHAR
)
);
wine_server_add_data
(
req
,
autoW
,
l
strlenW
(
autoW
)
*
sizeof
(
WCHAR
)
);
status
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
...
...
@@ -2793,7 +2789,7 @@ BOOLEAN WINAPI PsGetVersion(ULONG *major, ULONG *minor, ULONG *build, UNICODE_ST
if
(
version
)
{
#if 0 /* FIXME: GameGuard passes an uninitialized pointer in version->Buffer */
size_t len = min( strlenW(info.szCSDVersion)*sizeof(WCHAR), version->MaximumLength );
size_t len = min(
l
strlenW(info.szCSDVersion)*sizeof(WCHAR), version->MaximumLength );
memcpy( version->Buffer, info.szCSDVersion, len );
if (len < version->MaximumLength) version->Buffer[len / sizeof(WCHAR)] = 0;
version->Length = len;
...
...
@@ -3220,7 +3216,7 @@ static NTSTATUS open_driver( const UNICODE_STRING *service_name, SC_HANDLE *serv
memcpy
(
name
,
service_name
->
Buffer
,
service_name
->
Length
);
name
[
service_name
->
Length
/
sizeof
(
WCHAR
)
]
=
0
;
if
(
strncmpW
(
name
,
servicesW
,
strlenW
(
servicesW
)
))
if
(
wcsncmp
(
name
,
servicesW
,
l
strlenW
(
servicesW
)
))
{
FIXME
(
"service name %s is not a keypath
\n
"
,
debugstr_us
(
service_name
)
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
name
);
...
...
@@ -3234,7 +3230,7 @@ static NTSTATUS open_driver( const UNICODE_STRING *service_name, SC_HANDLE *serv
return
STATUS_NOT_SUPPORTED
;
}
*
service
=
OpenServiceW
(
manager_handle
,
name
+
strlenW
(
servicesW
),
*
service
=
OpenServiceW
(
manager_handle
,
name
+
l
strlenW
(
servicesW
),
SERVICE_QUERY_CONFIG
|
SERVICE_SET_STATUS
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
name
);
CloseServiceHandle
(
manager_handle
);
...
...
@@ -3467,20 +3463,20 @@ static HMODULE load_driver( const WCHAR *driver_name, const UNICODE_STRING *keyn
return
NULL
;
}
if
(
!
strncmpiW
(
path
,
systemrootW
,
12
))
if
(
!
wcsnicmp
(
path
,
systemrootW
,
12
))
{
WCHAR
buffer
[
MAX_PATH
];
GetWindowsDirectoryW
(
buffer
,
MAX_PATH
);
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
size
-
11
+
strlenW
(
buffer
))
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
size
-
11
+
l
strlenW
(
buffer
))
*
sizeof
(
WCHAR
));
lstrcpyW
(
str
,
buffer
);
lstrcatW
(
str
,
path
+
11
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
path
=
str
;
}
else
if
(
!
strncmpW
(
path
,
ntprefixW
,
4
))
else
if
(
!
wcsncmp
(
path
,
ntprefixW
,
4
))
str
=
path
+
4
;
else
str
=
path
;
...
...
@@ -3491,7 +3487,7 @@ static HMODULE load_driver( const WCHAR *driver_name, const UNICODE_STRING *keyn
WCHAR
buffer
[
MAX_PATH
];
GetSystemDirectoryW
(
buffer
,
MAX_PATH
);
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
buffer
)
+
strlenW
(
driversW
)
+
strlenW
(
driver_name
)
+
strlenW
(
postfixW
)
+
1
)
(
lstrlenW
(
buffer
)
+
lstrlenW
(
driversW
)
+
lstrlenW
(
driver_name
)
+
l
strlenW
(
postfixW
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
path
,
buffer
);
lstrcatW
(
path
,
driversW
);
...
...
@@ -3518,7 +3514,7 @@ static NTSTATUS WINAPI init_driver( DRIVER_OBJECT *driver_object, UNICODE_STRING
HMODULE
module
;
/* Retrieve driver name from the keyname */
driver_name
=
strrchrW
(
keyname
->
Buffer
,
'\\'
);
driver_name
=
wcsrchr
(
keyname
->
Buffer
,
'\\'
);
driver_name
++
;
module
=
load_driver
(
driver_name
,
keyname
);
...
...
@@ -3554,12 +3550,12 @@ static BOOLEAN get_drv_name( UNICODE_STRING *drv_name, const UNICODE_STRING *ser
static
const
WCHAR
driverW
[]
=
{
'\\'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
'\\'
,
0
};
WCHAR
*
str
;
if
(
!
(
str
=
heap_alloc
(
sizeof
(
driverW
)
+
service_name
->
Length
-
strlenW
(
servicesW
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
str
=
heap_alloc
(
sizeof
(
driverW
)
+
service_name
->
Length
-
l
strlenW
(
servicesW
)
*
sizeof
(
WCHAR
)
)))
return
FALSE
;
lstrcpyW
(
str
,
driverW
);
lstrcpynW
(
str
+
strlenW
(
driverW
),
service_name
->
Buffer
+
strlenW
(
servicesW
),
service_name
->
Length
/
sizeof
(
WCHAR
)
-
strlenW
(
servicesW
)
+
1
);
lstrcpynW
(
str
+
lstrlenW
(
driverW
),
service_name
->
Buffer
+
l
strlenW
(
servicesW
),
service_name
->
Length
/
sizeof
(
WCHAR
)
-
l
strlenW
(
servicesW
)
+
1
);
RtlInitUnicodeString
(
drv_name
,
str
);
return
TRUE
;
}
...
...
@@ -3666,58 +3662,6 @@ PKEVENT WINAPI IoCreateNotificationEvent(UNICODE_STRING *name, HANDLE *handle)
}
/*********************************************************************
* memcpy (NTOSKRNL.@)
*
* NOTES
* Behaves like memmove.
*/
void
*
__cdecl
NTOSKRNL_memcpy
(
void
*
dst
,
const
void
*
src
,
size_t
n
)
{
return
memmove
(
dst
,
src
,
n
);
}
/*********************************************************************
* memset (NTOSKRNL.@)
*/
void
*
__cdecl
NTOSKRNL_memset
(
void
*
dst
,
int
c
,
size_t
n
)
{
return
memset
(
dst
,
c
,
n
);
}
/*********************************************************************
* _stricmp (NTOSKRNL.@)
*/
int
__cdecl
NTOSKRNL__stricmp
(
LPCSTR
str1
,
LPCSTR
str2
)
{
return
_strnicmp
(
str1
,
str2
,
-
1
);
}
/*********************************************************************
* _strnicmp (NTOSKRNL.@)
*/
int
__cdecl
NTOSKRNL__strnicmp
(
LPCSTR
str1
,
LPCSTR
str2
,
size_t
n
)
{
return
_strnicmp
(
str1
,
str2
,
n
);
}
/*********************************************************************
* _wcsnicmp (NTOSKRNL.@)
*/
INT
__cdecl
NTOSKRNL__wcsnicmp
(
LPCWSTR
str1
,
LPCWSTR
str2
,
INT
n
)
{
return
strncmpiW
(
str1
,
str2
,
n
);
}
/*********************************************************************
* wcsncmp (NTOSKRNL.@)
*/
INT
__cdecl
NTOSKRNL_wcsncmp
(
LPCWSTR
str1
,
LPCWSTR
str2
,
INT
n
)
{
return
strncmpW
(
str1
,
str2
,
n
);
}
#ifdef __x86_64__
/**************************************************************************
* __chkstk (NTOSKRNL.@)
...
...
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
a1cdcc52
...
...
@@ -1422,10 +1422,10 @@
@ stdcall -private ZwYieldExecution() NtYieldExecution
@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr)
@ stdcall -private -arch=arm,x86_64 -norelay __chkstk()
@ cdecl -private -arch=i386 _CIcos()
msvcrt._CIcos
@ cdecl -private -arch=i386 _CIsin()
msvcrt._CIsin
@ cdecl -private -arch=i386 _CIsqrt()
msvcrt._CIsqrt
@ cdecl -private _abnormal_termination()
msvcrt._abnormal_termination
@ cdecl -private -arch=i386 _CIcos()
@ cdecl -private -arch=i386 _CIsin()
@ cdecl -private -arch=i386 _CIsqrt()
@ cdecl -private _abnormal_termination()
@ stdcall -arch=i386 -ret64 _alldiv(int64 int64)
@ stdcall -arch=i386 -norelay _alldvrm(int64 int64)
@ stdcall -arch=i386 -ret64 _allmul(int64 int64)
...
...
@@ -1438,82 +1438,82 @@
@ stdcall -arch=i386 -ret64 _aullrem(int64 int64)
@ stdcall -arch=i386 -ret64 _aullshr(int64 long)
@ stdcall -arch=i386 -norelay _chkstk()
@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr)
msvcrt._except_handler2
@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr)
msvcrt._except_handler3
@ cdecl -arch=i386 _global_unwind2(ptr)
msvcrt._global_unwind2
@ cdecl _itoa(long ptr long)
msvcrt._itoa
@ cdecl _itow(long ptr long)
msvcrt._itow
@ cdecl -arch=x86_64 _local_unwind(ptr ptr)
msvcrt._local_unwind
@ cdecl -arch=i386 _local_unwind2(ptr long)
msvcrt._local_unwind2
@ cdecl _purecall()
msvcrt._purecall
@ varargs _snprintf(ptr long str)
msvcrt._snprintf
@ varargs _snwprintf(ptr long wstr)
msvcrt._snwprintf
@ cdecl _stricmp(str str)
NTOSKRNL__stricmp
@ cdecl _strlwr(str)
msvcrt._strlwr
@ cdecl _strnicmp(str str long)
NTOSKRNL__strnicmp
@ cdecl _strnset(str long long)
msvcrt._strnset
@ cdecl _strrev(str)
msvcrt._strrev
@ cdecl _strset(str long)
msvcrt._strset
@ cdecl _strupr(str)
msvcrt._strupr
@ cdecl _vsnprintf(ptr long str ptr)
msvcrt._vsnprintf
@ cdecl _vsnwprintf(ptr long wstr ptr)
msvcrt._vsnwprintf
@ cdecl _wcsicmp(wstr wstr)
msvcrt._wcsicmp
@ cdecl _wcslwr(wstr)
msvcrt._wcslwr
@ cdecl _wcsnicmp(wstr wstr long)
NTOSKRNL__wcsnicmp
@ cdecl _wcsnset(wstr long long)
msvcrt._wcsnset
@ cdecl _wcsrev(wstr)
msvcrt._wcsrev
@ cdecl _wcsupr(wstr)
msvcrt._wcsupr
@ cdecl atoi(str)
msvcrt.atoi
@ cdecl atol(str)
msvcrt.atol
@ cdecl isdigit(long)
msvcrt.isdigit
@ cdecl islower(long)
msvcrt.islower
@ cdecl isprint(long)
msvcrt.isprint
@ cdecl isspace(long)
msvcrt.isspace
@ cdecl isupper(long)
msvcrt.isupper
@ cdecl isxdigit(long)
msvcrt.isxdigit
@ cdecl mbstowcs(ptr str long)
msvcrt.mbstowcs
@ cdecl mbtowc(ptr str long)
msvcrt.mbtowc
@ cdecl memchr(ptr long long)
msvcrt.memchr
@ cdecl memcpy(ptr ptr long)
NTOSKRNL_memcpy
@ cdecl memmove(ptr ptr long)
msvcrt.memmove
@ cdecl memset(ptr long long)
NTOSKRNL_memset
@ cdecl qsort(ptr long long ptr)
msvcrt.qsort
@ cdecl rand()
msvcrt.rand
@ varargs sprintf(ptr str)
msvcrt.sprintf
@ cdecl srand(long)
msvcrt.srand
@ cdecl strcat(str str)
msvcrt.strcat
@ cdecl strchr(str long)
msvcrt.strchr
@ cdecl strcmp(str str)
msvcrt.strcmp
@ cdecl strcpy(ptr str)
msvcrt.strcpy
@ cdecl strlen(str)
msvcrt.strlen
@ cdecl strncat(str str long)
msvcrt.strncat
@ cdecl strncmp(str str long)
msvcrt.strncmp
@ cdecl strncpy(ptr str long)
msvcrt.strncpy
@ cdecl strrchr(str long)
msvcrt.strrchr
@ cdecl strspn(str str)
msvcrt.strspn
@ cdecl strstr(str str)
msvcrt.strstr
@ varargs swprintf(ptr wstr)
msvcrt.swprintf
@ cdecl tolower(long)
msvcrt.tolower
@ cdecl toupper(long)
msvcrt.toupper
@ cdecl towlower(long)
msvcrt.towlower
@ cdecl towupper(long)
msvcrt.towupper
@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr)
@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr)
@ cdecl -arch=i386 _global_unwind2(ptr)
@ cdecl _itoa(long ptr long)
@ cdecl _itow(long ptr long)
@ cdecl -arch=x86_64 _local_unwind(ptr ptr)
@ cdecl -arch=i386 _local_unwind2(ptr long)
@ cdecl _purecall()
@ varargs _snprintf(ptr long str)
@ varargs _snwprintf(ptr long wstr)
@ cdecl _stricmp(str str)
@ cdecl _strlwr(str)
@ cdecl _strnicmp(str str long)
@ cdecl _strnset(str long long)
@ cdecl _strrev(str)
@ cdecl _strset(str long)
@ cdecl _strupr(str)
@ cdecl _vsnprintf(ptr long str ptr)
@ cdecl _vsnwprintf(ptr long wstr ptr)
@ cdecl _wcsicmp(wstr wstr)
@ cdecl _wcslwr(wstr)
@ cdecl _wcsnicmp(wstr wstr long)
@ cdecl _wcsnset(wstr long long)
@ cdecl _wcsrev(wstr)
@ cdecl _wcsupr(wstr)
@ cdecl atoi(str)
@ cdecl atol(str)
@ cdecl isdigit(long)
@ cdecl islower(long)
@ cdecl isprint(long)
@ cdecl isspace(long)
@ cdecl isupper(long)
@ cdecl isxdigit(long)
@ cdecl mbstowcs(ptr str long)
@ cdecl mbtowc(ptr str long)
@ cdecl memchr(ptr long long)
@ cdecl memcpy(ptr ptr long)
@ cdecl memmove(ptr ptr long)
@ cdecl memset(ptr long long)
@ cdecl qsort(ptr long long ptr)
@ cdecl rand()
@ varargs sprintf(ptr str)
@ cdecl srand(long)
@ cdecl strcat(str str)
@ cdecl strchr(str long)
@ cdecl strcmp(str str)
@ cdecl strcpy(ptr str)
@ cdecl strlen(str)
@ cdecl strncat(str str long)
@ cdecl strncmp(str str long)
@ cdecl strncpy(ptr str long)
@ cdecl strrchr(str long)
@ cdecl strspn(str str)
@ cdecl strstr(str str)
@ varargs swprintf(ptr wstr)
@ cdecl tolower(long)
@ cdecl toupper(long)
@ cdecl towlower(long)
@ cdecl towupper(long)
@ stdcall vDbgPrintEx(long long str ptr)
@ stdcall vDbgPrintExWithPrefix(str long long str ptr)
@ cdecl vsprintf(ptr str ptr)
msvcrt.vsprintf
@ cdecl wcscat(wstr wstr)
msvcrt.wcscat
@ cdecl wcschr(wstr long)
msvcrt.wcschr
@ cdecl wcscmp(wstr wstr)
msvcrt.wcscmp
@ cdecl wcscpy(ptr wstr)
msvcrt.wcscpy
@ cdecl wcscspn(wstr wstr)
msvcrt.wcscspn
@ cdecl wcslen(wstr)
msvcrt.wcslen
@ cdecl wcsncat(wstr wstr long)
msvcrt.wcsncat
@ cdecl wcsncmp(wstr wstr long)
NTOSKRNL_wcsncmp
@ cdecl wcsncpy(ptr wstr long)
msvcrt.wcsncpy
@ cdecl wcsrchr(wstr long)
msvcrt.wcsrchr
@ cdecl wcsspn(wstr wstr)
msvcrt.wcsspn
@ cdecl wcsstr(wstr wstr)
msvcrt.wcsstr
@ cdecl wcstombs(ptr ptr long)
msvcrt.wcstombs
@ cdecl wctomb(ptr long)
msvcrt.wctomb
@ cdecl vsprintf(ptr str ptr)
@ cdecl wcscat(wstr wstr)
@ cdecl wcschr(wstr long)
@ cdecl wcscmp(wstr wstr)
@ cdecl wcscpy(ptr wstr)
@ cdecl wcscspn(wstr wstr)
@ cdecl wcslen(wstr)
@ cdecl wcsncat(wstr wstr long)
@ cdecl wcsncmp(wstr wstr long)
@ cdecl wcsncpy(ptr wstr long)
@ cdecl wcsrchr(wstr long)
@ cdecl wcsspn(wstr wstr)
@ cdecl wcsstr(wstr wstr)
@ cdecl wcstombs(ptr ptr long)
@ cdecl wctomb(ptr long)
################################################################
# Wine internal extensions
...
...
dlls/ntoskrnl.exe/pnp.c
View file @
a1cdcc52
...
...
@@ -40,7 +40,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/rbtree.h"
#include "wine/unicode.h"
#include "ntoskrnl_private.h"
...
...
@@ -223,7 +222,7 @@ static NTSTATUS get_device_instance_id( DEVICE_OBJECT *device, WCHAR *buffer )
return
status
;
}
strcpyW
(
buffer
,
id
);
l
strcpyW
(
buffer
,
id
);
ExFreePool
(
id
);
if
((
status
=
get_device_id
(
device
,
BusQueryInstanceID
,
&
id
)))
...
...
@@ -232,8 +231,8 @@ static NTSTATUS get_device_instance_id( DEVICE_OBJECT *device, WCHAR *buffer )
return
status
;
}
strcatW
(
buffer
,
backslashW
);
strcatW
(
buffer
,
id
);
l
strcatW
(
buffer
,
backslashW
);
l
strcatW
(
buffer
,
id
);
ExFreePool
(
id
);
TRACE
(
"Returning ID %s.
\n
"
,
debugstr_w
(
buffer
));
...
...
@@ -277,8 +276,8 @@ static void load_function_driver( DEVICE_OBJECT *device, HDEVINFO set, SP_DEVINF
return
;
}
strcpyW
(
buffer
,
servicesW
);
strcatW
(
buffer
,
driver
);
l
strcpyW
(
buffer
,
servicesW
);
l
strcatW
(
buffer
,
driver
);
RtlInitUnicodeString
(
&
string
,
buffer
);
status
=
ZwLoadDriver
(
&
string
);
if
(
status
!=
STATUS_SUCCESS
&&
status
!=
STATUS_IMAGE_ALREADY_LOADED
)
...
...
@@ -287,8 +286,8 @@ static void load_function_driver( DEVICE_OBJECT *device, HDEVINFO set, SP_DEVINF
return
;
}
strcpyW
(
buffer
,
driverW
);
strcatW
(
buffer
,
driver
);
l
strcpyW
(
buffer
,
driverW
);
l
strcatW
(
buffer
,
driver
);
RtlInitUnicodeString
(
&
string
,
buffer
);
if
(
ObReferenceObjectByName
(
&
string
,
OBJ_CASE_INSENSITIVE
,
NULL
,
0
,
NULL
,
KernelMode
,
NULL
,
(
void
**
)
&
driver_obj
)
!=
STATUS_SUCCESS
)
...
...
@@ -313,7 +312,7 @@ static void load_function_driver( DEVICE_OBJECT *device, HDEVINFO set, SP_DEVINF
static
size_t
sizeof_multiszW
(
const
WCHAR
*
str
)
{
const
WCHAR
*
p
;
for
(
p
=
str
;
*
p
;
p
+=
strlenW
(
p
)
+
1
);
for
(
p
=
str
;
*
p
;
p
+=
l
strlenW
(
p
)
+
1
);
return
p
+
1
-
str
;
}
...
...
@@ -483,11 +482,11 @@ NTSTATUS WINAPI IoGetDeviceProperty( DEVICE_OBJECT *device, DEVICE_REGISTRY_PROP
break
;
}
struprW
(
id
);
ptr
=
strchrW
(
id
,
'\\'
);
wcsupr
(
id
);
ptr
=
wcschr
(
id
,
'\\'
);
if
(
ptr
)
*
ptr
=
0
;
*
needed
=
sizeof
(
WCHAR
)
*
(
strlenW
(
id
)
+
1
);
*
needed
=
sizeof
(
WCHAR
)
*
(
l
strlenW
(
id
)
+
1
);
if
(
length
>=
*
needed
)
memcpy
(
buffer
,
id
,
*
needed
);
else
...
...
@@ -604,26 +603,28 @@ NTSTATUS WINAPI IoSetDeviceInterfaceState( UNICODE_STRING *name, BOOLEAN enable
if
(
enable
&&
iface
->
enabled
)
return
STATUS_OBJECT_NAME_EXISTS
;
refstr
=
memrchrW
(
name
->
Buffer
+
4
,
'\\'
,
namelen
-
4
);
for
(
p
=
name
->
Buffer
+
4
,
refstr
=
NULL
;
p
<
name
->
Buffer
+
namelen
;
p
++
)
if
(
*
p
==
'\\'
)
refstr
=
p
;
if
(
!
refstr
)
refstr
=
p
;
if
(
!
guid_from_string
(
(
refstr
?
refstr
:
name
->
Buffer
+
namelen
)
-
38
,
&
class
))
if
(
!
guid_from_string
(
refstr
-
38
,
&
class
))
return
STATUS_INVALID_PARAMETER
;
len
=
strlenW
(
DeviceClassesW
)
+
38
+
1
+
namelen
+
2
+
1
;
len
=
l
strlenW
(
DeviceClassesW
)
+
38
+
1
+
namelen
+
2
+
1
;
if
(
!
(
path
=
heap_alloc
(
len
*
sizeof
(
WCHAR
)
)))
return
STATUS_NO_MEMORY
;
strcpyW
(
path
,
DeviceClassesW
);
lstrcpynW
(
path
+
strlenW
(
path
),
(
refstr
?
refstr
:
name
->
Buffer
+
namelen
)
-
38
,
39
);
strcatW
(
path
,
slashW
);
p
=
path
+
strlenW
(
path
);
lstrcpynW
(
path
+
strlenW
(
path
),
name
->
Buffer
,
(
refstr
?
(
refstr
-
name
->
Buffer
)
:
namelen
)
+
1
);
l
strcpyW
(
path
,
DeviceClassesW
);
lstrcpynW
(
path
+
lstrlenW
(
path
),
refstr
-
38
,
39
);
l
strcatW
(
path
,
slashW
);
p
=
path
+
l
strlenW
(
path
);
lstrcpynW
(
path
+
lstrlenW
(
path
),
name
->
Buffer
,
(
refstr
-
name
->
Buffer
)
+
1
);
p
[
0
]
=
p
[
1
]
=
p
[
3
]
=
'#'
;
strcatW
(
path
,
slashW
);
strcatW
(
path
,
hashW
);
if
(
refstr
)
lstrcpynW
(
path
+
strlenW
(
path
),
refstr
,
name
->
Buffer
+
namelen
-
refstr
+
1
);
l
strcatW
(
path
,
slashW
);
l
strcatW
(
path
,
hashW
);
if
(
refstr
<
name
->
Buffer
+
namelen
)
lstrcpynW
(
path
+
l
strlenW
(
path
),
refstr
,
name
->
Buffer
+
namelen
-
refstr
+
1
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
ObjectName
=
&
string
;
...
...
dlls/ntoskrnl.exe/sync.c
View file @
a1cdcc52
...
...
@@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <limits.h>
#include <stdarg.h>
...
...
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