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
0aa6cc29
Commit
0aa6cc29
authored
Jul 29, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed a few external dependencies from ntdll.
parent
e5c1b9dd
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
133 additions
and
100 deletions
+133
-100
exception.c
dlls/ntdll/exception.c
+1
-1
nt.c
dlls/ntdll/nt.c
+21
-19
ntdll.spec
dlls/ntdll/ntdll.spec
+5
-5
om.c
dlls/ntdll/om.c
+6
-7
reg.c
dlls/ntdll/reg.c
+23
-23
rtl.c
dlls/ntdll/rtl.c
+30
-12
rtlstr.c
dlls/ntdll/rtlstr.c
+3
-3
sec.c
dlls/ntdll/sec.c
+0
-2
sync.c
dlls/ntdll/sync.c
+2
-1
time.c
dlls/ntdll/time.c
+27
-9
ntddk.h
include/ntddk.h
+15
-0
module.c
loader/module.c
+0
-18
No files found.
dlls/ntdll/exception.c
View file @
0aa6cc29
...
...
@@ -117,7 +117,7 @@ static void EXC_DefaultHandling( EXCEPTION_RECORD *rec, CONTEXT *context )
else
ERR
(
"Unhandled exception code %lx flags %lx addr %p
\n
"
,
rec
->
ExceptionCode
,
rec
->
ExceptionFlags
,
rec
->
ExceptionAddress
);
TerminateProcess
(
Ge
tCurrentProcess
(),
1
);
NtTerminateProcess
(
N
tCurrentProcess
(),
1
);
}
...
...
dlls/ntdll/nt.c
View file @
0aa6cc29
...
...
@@ -15,6 +15,7 @@
#include "ntddk.h"
#include "ntdll_misc.h"
#include "server.h"
DEFAULT_DEBUG_CHANNEL
(
ntdll
);
...
...
@@ -70,19 +71,15 @@ NTSTATUS WINAPI NtQueryTimerResolution(DWORD x1,DWORD x2,DWORD x3)
* NtTerminateProcess [NTDLL.]
*
* Native applications must kill themselves when done
* FIXME: return value 0-success
*/
NTSTATUS
WINAPI
NtTerminateProcess
(
HANDLE
ProcessHandle
,
LONG
ExitStatus
)
NTSTATUS
WINAPI
NtTerminateProcess
(
HANDLE
handle
,
LONG
exit_code
)
{
TRACE
(
"0x%08x 0x%08lx
\n
"
,
ProcessHandle
,
ExitStatus
);
/* win32 (0x7fffffff) to nt (-1) */
if
(
NtCurrentProcess
()
==
ProcessHandle
)
ProcessHandle
=
GetCurrentProcess
();
return
(
!
TerminateProcess
(
ProcessHandle
,
ExitStatus
));
NTSTATUS
ret
;
struct
terminate_process_request
*
req
=
get_req_buffer
();
req
->
handle
=
handle
;
req
->
exit_code
=
exit_code
;
if
(
!
(
ret
=
server_call_noerr
(
REQ_TERMINATE_PROCESS
))
&&
req
->
self
)
exit
(
exit_code
);
return
ret
;
}
/******************************************************************************
...
...
@@ -140,14 +137,19 @@ NTSTATUS WINAPI NtResumeThread(
/******************************************************************************
* NtTerminateThread [NTDLL]
*/
NTSTATUS
WINAPI
NtTerminateThread
(
IN
HANDLE
ThreadHandle
,
IN
NTSTATUS
ExitStatus
)
{
if
(
TerminateThread
(
ThreadHandle
,
ExitStatus
)
)
return
0
;
return
0xc0000000
;
/* FIXME: lasterror->ntstatus */
NTSTATUS
WINAPI
NtTerminateThread
(
IN
HANDLE
handle
,
IN
NTSTATUS
exit_code
)
{
NTSTATUS
ret
;
struct
terminate_thread_request
*
req
=
get_req_buffer
();
req
->
handle
=
handle
;
req
->
exit_code
=
exit_code
;
if
(
!
(
ret
=
server_call_noerr
(
REQ_TERMINATE_THREAD
))
&&
req
->
self
)
{
if
(
req
->
last
)
exit
(
exit_code
);
else
SYSDEPS_ExitThread
(
exit_code
);
}
return
ret
;
}
/******************************************************************************
...
...
dlls/ntdll/ntdll.spec
View file @
0aa6cc29
...
...
@@ -480,8 +480,8 @@ type win32
@ stub RtlResetRtlTranslations
@ stub RtlRunDecodeUnicodeString
@ stub RtlRunEncodeUnicodeString
@ st
ub
RtlSecondsSince1970ToTime
@ st
ub
RtlSecondsSince1980ToTime
@ st
dcall RtlSecondsSince1970ToTime(long ptr)
RtlSecondsSince1970ToTime
@ st
dcall RtlSecondsSince1980ToTime(long ptr)
RtlSecondsSince1980ToTime
@ stub RtlSelfRelativeToAbsoluteSD
@ stub RtlSetAllBits
@ stdcall RtlSetBits(long long long) RtlSetBits
...
...
@@ -873,7 +873,7 @@ type win32
@ cdecl _ltoa(long ptr long) _ltoa
@ stub _memccpy
@ cdecl _memicmp(str str long) _memicmp
@
stub _
snprintf
@
varargs _snprintf(ptr long ptr)
snprintf
@ stub _snwprintf
@ stub _splitpath
@ cdecl _strcmpi(str str) strcasecmp
...
...
@@ -882,7 +882,7 @@ type win32
@ cdecl _strnicmp(str str long) strncasecmp
@ cdecl _strupr(str) _strupr
@ cdecl _ultoa(long ptr long) _ultoa
@
stub _
vsnprintf
@
cdecl _vsnprintf(ptr long ptr ptr)
vsnprintf
@ cdecl _wcsicmp(wstr wstr) NTDLL__wcsicmp
@ cdecl _wcslwr(wstr) NTDLL__wcslwr
@ cdecl _wcsnicmp(wstr wstr long) NTDLL__wcsnicmp
...
...
@@ -915,7 +915,7 @@ type win32
@ stub pow
@ stub qsort
@ stub sin
@ varargs sprintf(str str)
wsprintfA
@ varargs sprintf(str str)
sprintf
@ stub sqrt
@ varargs sscanf() sscanf
@ cdecl strcat(str str) strcat
...
...
dlls/ntdll/om.c
View file @
0aa6cc29
...
...
@@ -8,8 +8,9 @@
#include "ntddk.h"
#include "ntdll_misc.h"
#include "server.h"
DEFAULT_DEBUG_CHANNEL
(
ntdll
)
DEFAULT_DEBUG_CHANNEL
(
ntdll
)
;
/* move to somewhere */
typedef
void
*
POBJDIR_INFORMATION
;
...
...
@@ -212,13 +213,11 @@ NTSTATUS WINAPI NtDuplicateObject(
* ARGUMENTS:
* Handle handle to close
*/
NTSTATUS
WINAPI
NtClose
(
HANDLE
Handle
)
NTSTATUS
WINAPI
NtClose
(
HANDLE
Handle
)
{
TRACE
(
"(0x%08x)
\n
"
,
Handle
);
if
(
CloseHandle
(
Handle
))
return
STATUS_SUCCESS
;
return
STATUS_UNSUCCESSFUL
;
/*fixme*/
struct
close_handle_request
*
req
=
get_req_buffer
();
req
->
handle
=
Handle
;
return
server_call_noerr
(
REQ_CLOSE_HANDLE
);
}
/******************************************************************************
...
...
dlls/ntdll/reg.c
View file @
0aa6cc29
...
...
@@ -12,7 +12,6 @@
#include "winreg.h"
#include "winerror.h"
#include "wine/unicode.h"
#include "file.h"
#include "server.h"
#include "ntddk.h"
#include "ntdll_misc.h"
...
...
@@ -25,7 +24,7 @@ static inline NTSTATUS copy_nameU( LPWSTR Dest, PUNICODE_STRING Name, UINT Offse
if
(
Name
->
Buffer
)
{
if
((
Name
->
Length
-
Offset
)
>
MAX_PATH
)
return
STATUS_BUFFER_OVERFLOW
;
l
strcpyW
(
Dest
,
Name
->
Buffer
+
Offset
);
strcpyW
(
Dest
,
Name
->
Buffer
+
Offset
);
}
else
Dest
[
0
]
=
0
;
return
STATUS_SUCCESS
;
...
...
@@ -63,19 +62,19 @@ static BOOLEAN _NtKeyToWinKey(
len
=
0
;
*
KeyHandle
=
ObjectAttributes
->
RootDirectory
;
}
else
if
((
ObjectName
->
Length
>
(
len
=
l
strlenW
(
KeyPath_HKLM
)))
else
if
((
ObjectName
->
Length
>
(
len
=
strlenW
(
KeyPath_HKLM
)))
&&
(
0
==
strncmpiW
(
ObjectName
->
Buffer
,
KeyPath_HKLM
,
len
)))
{
*
KeyHandle
=
HKEY_LOCAL_MACHINE
;
}
else
if
((
ObjectName
->
Length
>
(
len
=
l
strlenW
(
KeyPath_HKU
)))
else
if
((
ObjectName
->
Length
>
(
len
=
strlenW
(
KeyPath_HKU
)))
&&
(
0
==
strncmpiW
(
ObjectName
->
Buffer
,
KeyPath_HKU
,
len
)))
{
*
KeyHandle
=
HKEY_USERS
;
}
else
if
((
ObjectName
->
Length
>
(
len
=
l
strlenW
(
KeyPath_HCR
)))
else
if
((
ObjectName
->
Length
>
(
len
=
strlenW
(
KeyPath_HCR
)))
&&
(
0
==
strncmpiW
(
ObjectName
->
Buffer
,
KeyPath_HCR
,
len
)))
{
*
KeyHandle
=
HKEY_CLASSES_ROOT
;
}
else
if
((
ObjectName
->
Length
>
(
len
=
l
strlenW
(
KeyPath_HCC
)))
else
if
((
ObjectName
->
Length
>
(
len
=
strlenW
(
KeyPath_HCC
)))
&&
(
0
==
strncmpiW
(
ObjectName
->
Buffer
,
KeyPath_HCC
,
len
)))
{
*
KeyHandle
=
HKEY_CURRENT_CONFIG
;
}
...
...
@@ -132,7 +131,8 @@ NTSTATUS WINAPI NtCreateKey(
{
int
ClassLen
=
Class
->
Length
+
1
;
if
(
ClassLen
*
sizeof
(
WCHAR
)
>
server_remaining
(
req
->
class
))
return
STATUS_BUFFER_OVERFLOW
;
lstrcpynW
(
req
->
class
,
Class
->
Buffer
,
ClassLen
);
memcpy
(
req
->
class
,
Class
->
Buffer
,
ClassLen
);
req
->
class
[
ClassLen
]
=
0
;
}
else
req
->
class
[
0
]
=
0x0000
;
...
...
@@ -237,11 +237,11 @@ NTSTATUS WINAPI NtEnumerateKey(
case
KeyBasicInformation
:
{
PKEY_BASIC_INFORMATION
kbi
=
KeyInformation
;
UINT
NameLength
=
l
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
UINT
NameLength
=
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
*
ResultLength
=
sizeof
(
KEY_BASIC_INFORMATION
)
-
sizeof
(
WCHAR
)
+
NameLength
;
if
(
Length
<
*
ResultLength
)
return
STATUS_BUFFER_OVERFLOW
;
DOSFS_UnixTimeToFileTime
(
req
->
modif
,
&
kbi
->
LastWriteTime
,
0
);
RtlSecondsSince1970ToTime
(
req
->
modif
,
&
kbi
->
LastWriteTime
);
kbi
->
TitleIndex
=
0
;
kbi
->
NameLength
=
NameLength
;
memcpy
(
kbi
->
Name
,
req
->
name
,
NameLength
);
...
...
@@ -250,13 +250,13 @@ NTSTATUS WINAPI NtEnumerateKey(
case
KeyFullInformation
:
{
PKEY_FULL_INFORMATION
kfi
=
KeyInformation
;
kfi
->
ClassLength
=
l
strlenW
(
req
->
class
)
*
sizeof
(
WCHAR
);
kfi
->
ClassLength
=
strlenW
(
req
->
class
)
*
sizeof
(
WCHAR
);
kfi
->
ClassOffset
=
(
kfi
->
ClassLength
)
?
sizeof
(
KEY_FULL_INFORMATION
)
-
sizeof
(
WCHAR
)
:
0xffffffff
;
*
ResultLength
=
sizeof
(
KEY_FULL_INFORMATION
)
-
sizeof
(
WCHAR
)
+
kfi
->
ClassLength
;
if
(
Length
<
*
ResultLength
)
return
STATUS_BUFFER_OVERFLOW
;
DOSFS_UnixTimeToFileTime
(
req
->
modif
,
&
kfi
->
LastWriteTime
,
0
);
RtlSecondsSince1970ToTime
(
req
->
modif
,
&
kfi
->
LastWriteTime
);
kfi
->
TitleIndex
=
0
;
/* kfi->SubKeys = req->subkeys;
kfi->MaxNameLength = req->max_subkey;
...
...
@@ -272,15 +272,15 @@ NTSTATUS WINAPI NtEnumerateKey(
case
KeyNodeInformation
:
{
PKEY_NODE_INFORMATION
kni
=
KeyInformation
;
kni
->
ClassLength
=
l
strlenW
(
req
->
class
)
*
sizeof
(
WCHAR
);
kni
->
NameLength
=
l
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
kni
->
ClassLength
=
strlenW
(
req
->
class
)
*
sizeof
(
WCHAR
);
kni
->
NameLength
=
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
kni
->
ClassOffset
=
(
kni
->
ClassLength
)
?
sizeof
(
KEY_NODE_INFORMATION
)
-
sizeof
(
WCHAR
)
+
kni
->
NameLength
:
0xffffffff
;
*
ResultLength
=
sizeof
(
KEY_NODE_INFORMATION
)
-
sizeof
(
WCHAR
)
+
kni
->
NameLength
+
kni
->
ClassLength
;
if
(
Length
<
*
ResultLength
)
return
STATUS_BUFFER_OVERFLOW
;
DOSFS_UnixTimeToFileTime
(
req
->
modif
,
&
kni
->
LastWriteTime
,
0
);
RtlSecondsSince1970ToTime
(
req
->
modif
,
&
kni
->
LastWriteTime
);
kni
->
TitleIndex
=
0
;
memcpy
(
kni
->
Name
,
req
->
name
,
kni
->
NameLength
);
if
(
kni
->
ClassLength
)
memcpy
((
char
*
)
KeyInformation
+
kni
->
ClassOffset
,
req
->
class
,
kni
->
ClassLength
);
...
...
@@ -319,11 +319,11 @@ NTSTATUS WINAPI NtQueryKey(
case
KeyBasicInformation
:
{
PKEY_BASIC_INFORMATION
kbi
=
KeyInformation
;
UINT
NameLength
=
l
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
UINT
NameLength
=
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
*
ResultLength
=
sizeof
(
KEY_BASIC_INFORMATION
)
-
sizeof
(
WCHAR
)
+
NameLength
;
if
(
Length
<
*
ResultLength
)
return
STATUS_BUFFER_OVERFLOW
;
DOSFS_UnixTimeToFileTime
(
req
->
modif
,
&
kbi
->
LastWriteTime
,
0
);
RtlSecondsSince1970ToTime
(
req
->
modif
,
&
kbi
->
LastWriteTime
);
kbi
->
TitleIndex
=
0
;
kbi
->
NameLength
=
NameLength
;
memcpy
(
kbi
->
Name
,
req
->
name
,
NameLength
);
...
...
@@ -332,14 +332,14 @@ NTSTATUS WINAPI NtQueryKey(
case
KeyFullInformation
:
{
PKEY_FULL_INFORMATION
kfi
=
KeyInformation
;
kfi
->
ClassLength
=
l
strlenW
(
req
->
class
)
*
sizeof
(
WCHAR
);
kfi
->
ClassLength
=
strlenW
(
req
->
class
)
*
sizeof
(
WCHAR
);
kfi
->
ClassOffset
=
(
kfi
->
ClassLength
)
?
sizeof
(
KEY_FULL_INFORMATION
)
-
sizeof
(
WCHAR
)
:
0xffffffff
;
*
ResultLength
=
sizeof
(
KEY_FULL_INFORMATION
)
-
sizeof
(
WCHAR
)
+
kfi
->
ClassLength
;
if
(
Length
<
*
ResultLength
)
return
STATUS_BUFFER_OVERFLOW
;
DOSFS_UnixTimeToFileTime
(
req
->
modif
,
&
kfi
->
LastWriteTime
,
0
);
RtlSecondsSince1970ToTime
(
req
->
modif
,
&
kfi
->
LastWriteTime
);
kfi
->
TitleIndex
=
0
;
kfi
->
SubKeys
=
req
->
subkeys
;
kfi
->
MaxNameLen
=
req
->
max_subkey
;
...
...
@@ -353,15 +353,15 @@ NTSTATUS WINAPI NtQueryKey(
case
KeyNodeInformation
:
{
PKEY_NODE_INFORMATION
kni
=
KeyInformation
;
kni
->
ClassLength
=
l
strlenW
(
req
->
class
)
*
sizeof
(
WCHAR
);
kni
->
NameLength
=
l
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
kni
->
ClassLength
=
strlenW
(
req
->
class
)
*
sizeof
(
WCHAR
);
kni
->
NameLength
=
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
kni
->
ClassOffset
=
(
kni
->
ClassLength
)
?
sizeof
(
KEY_NODE_INFORMATION
)
-
sizeof
(
WCHAR
)
+
kni
->
NameLength
:
0xffffffff
;
*
ResultLength
=
sizeof
(
KEY_NODE_INFORMATION
)
-
sizeof
(
WCHAR
)
+
kni
->
NameLength
+
kni
->
ClassLength
;
if
(
Length
<
*
ResultLength
)
return
STATUS_BUFFER_OVERFLOW
;
DOSFS_UnixTimeToFileTime
(
req
->
modif
,
&
kni
->
LastWriteTime
,
0
);
RtlSecondsSince1970ToTime
(
req
->
modif
,
&
kni
->
LastWriteTime
);
kni
->
TitleIndex
=
0
;
memcpy
(
kni
->
Name
,
req
->
name
,
kni
->
NameLength
);
if
(
kni
->
ClassLength
)
memcpy
((
char
*
)
KeyInformation
+
kni
->
ClassOffset
,
req
->
class
,
kni
->
ClassLength
);
...
...
@@ -403,7 +403,7 @@ NTSTATUS WINAPI NtEnumerateValueKey(
{
PKEY_VALUE_BASIC_INFORMATION
kbi
=
KeyInformation
;
NameLength
=
l
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
NameLength
=
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
*
ResultLength
=
sizeof
(
KEY_VALUE_BASIC_INFORMATION
)
-
sizeof
(
WCHAR
)
+
NameLength
;
if
(
*
ResultLength
>
Length
)
return
STATUS_BUFFER_TOO_SMALL
;
...
...
@@ -418,7 +418,7 @@ NTSTATUS WINAPI NtEnumerateValueKey(
PKEY_VALUE_FULL_INFORMATION
kbi
=
KeyInformation
;
UINT
DataOffset
;
NameLength
=
l
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
NameLength
=
strlenW
(
req
->
name
)
*
sizeof
(
WCHAR
);
DataOffset
=
sizeof
(
KEY_VALUE_FULL_INFORMATION
)
-
sizeof
(
WCHAR
)
+
NameLength
;
*
ResultLength
=
DataOffset
+
req
->
len
;
...
...
dlls/ntdll/rtl.c
View file @
0aa6cc29
...
...
@@ -8,19 +8,18 @@
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "heap.h"
#include "debugtools.h"
#include "windef.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "stackframe.h"
#include "ntddk.h"
#include "winreg.h"
DEFAULT_DEBUG_CHANNEL
(
ntdll
)
DEFAULT_DEBUG_CHANNEL
(
ntdll
)
;
/*
...
...
@@ -43,8 +42,8 @@ void WINAPI RtlInitializeResource(LPRTL_RWLOCK rwl)
rwl
->
hOwningThreadId
=
0
;
rwl
->
dwTimeoutBoost
=
0
;
/* no info on this one, default value is 0 */
InitializeCriticalSection
(
&
rwl
->
rtlCS
);
rwl
->
hExclusiveReleaseSemaphore
=
CreateSemaphoreA
(
NULL
,
0
,
65535
,
NULL
);
rwl
->
hSharedReleaseSemaphore
=
CreateSemaphoreA
(
NULL
,
0
,
65535
,
NULL
);
NtCreateSemaphore
(
&
rwl
->
hExclusiveReleaseSemaphore
,
0
,
NULL
,
0
,
65535
);
NtCreateSemaphore
(
&
rwl
->
hSharedReleaseSemaphore
,
0
,
NULL
,
0
,
65535
);
}
}
...
...
@@ -62,8 +61,8 @@ void WINAPI RtlDeleteResource(LPRTL_RWLOCK rwl)
rwl
->
hOwningThreadId
=
0
;
rwl
->
uExclusiveWaiters
=
rwl
->
uSharedWaiters
=
0
;
rwl
->
iNumberActive
=
0
;
CloseHandl
e
(
rwl
->
hExclusiveReleaseSemaphore
);
CloseHandl
e
(
rwl
->
hSharedReleaseSemaphore
);
NtClos
e
(
rwl
->
hExclusiveReleaseSemaphore
);
NtClos
e
(
rwl
->
hSharedReleaseSemaphore
);
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
DeleteCriticalSection
(
&
rwl
->
rtlCS
);
}
...
...
@@ -171,7 +170,7 @@ void WINAPI RtlReleaseResource(LPRTL_RWLOCK rwl)
{
wake_exclusive:
rwl
->
uExclusiveWaiters
--
;
ReleaseSemaphore
(
rwl
->
hExclusiveReleaseSemaphore
,
1
,
NULL
);
Nt
ReleaseSemaphore
(
rwl
->
hExclusiveReleaseSemaphore
,
1
,
NULL
);
}
}
}
...
...
@@ -190,7 +189,7 @@ wake_exclusive:
rwl
->
iNumberActive
=
rwl
->
uSharedWaiters
;
/* prevent new writers from joining until
* all queued readers have done their thing */
rwl
->
uSharedWaiters
=
0
;
ReleaseSemaphore
(
rwl
->
hSharedReleaseSemaphore
,
n
,
NULL
);
Nt
ReleaseSemaphore
(
rwl
->
hSharedReleaseSemaphore
,
n
,
NULL
);
}
}
}
...
...
@@ -278,12 +277,13 @@ BOOLEAN WINAPI RtlDestroyHeap(
/******************************************************************************
* DbgPrint [NTDLL]
*/
void
WINAPIV
DbgPrint
(
LPCSTR
fmt
,
...)
{
char
buf
[
512
];
void
WINAPIV
DbgPrint
(
LPCSTR
fmt
,
...)
{
char
buf
[
512
];
va_list
args
;
va_start
(
args
,
fmt
);
wvsprintfA
(
buf
,
fmt
,
args
);
vsprintf
(
buf
,
fmt
,
args
);
va_end
(
args
);
MESSAGE
(
"DbgPrint says: %s"
,
buf
);
...
...
@@ -429,6 +429,24 @@ BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(
return
TRUE
;
}
/***********************************************************************
* RtlImageNtHeader (NTDLL)
*/
PIMAGE_NT_HEADERS
WINAPI
RtlImageNtHeader
(
HMODULE
hModule
)
{
IMAGE_NT_HEADERS
*
ret
=
NULL
;
IMAGE_DOS_HEADER
*
dos
=
(
IMAGE_DOS_HEADER
*
)
hModule
;
if
(
dos
->
e_magic
==
IMAGE_DOS_SIGNATURE
)
{
ret
=
(
IMAGE_NT_HEADERS
*
)((
char
*
)
dos
+
dos
->
e_lfanew
);
if
(
ret
->
Signature
!=
IMAGE_NT_SIGNATURE
)
ret
=
NULL
;
}
return
ret
;
}
/******************************************************************************
* RtlCreateEnvironment [NTDLL]
*/
...
...
dlls/ntdll/rtlstr.c
View file @
0aa6cc29
...
...
@@ -31,7 +31,7 @@ VOID WINAPI RtlInitString(PSTRING target,LPCSTR source)
target
->
Buffer
=
(
LPSTR
)
source
;
if
(
source
)
{
target
->
Length
=
lstrlenA
(
source
);
target
->
Length
=
strlen
(
source
);
target
->
MaximumLength
=
target
->
Length
+
1
;
}
else
...
...
@@ -56,7 +56,7 @@ VOID WINAPI RtlInitAnsiString(
target
->
Buffer
=
(
LPSTR
)
source
;
if
(
source
)
{
target
->
Length
=
lstrlenA
(
source
);
target
->
Length
=
strlen
(
source
);
target
->
MaximumLength
=
target
->
Length
+
1
;
}
else
...
...
@@ -94,7 +94,7 @@ VOID WINAPI RtlInitUnicodeString(
target
->
Buffer
=
(
LPWSTR
)
source
;
if
(
source
)
{
target
->
Length
=
l
strlenW
(
source
)
*
2
;
target
->
Length
=
strlenW
(
source
)
*
2
;
target
->
MaximumLength
=
target
->
Length
+
2
;
}
else
...
...
dlls/ntdll/sec.c
View file @
0aa6cc29
...
...
@@ -11,8 +11,6 @@
#include <math.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/winestring.h"
#include "file.h"
#include "heap.h"
...
...
dlls/ntdll/sync.c
View file @
0aa6cc29
...
...
@@ -9,6 +9,7 @@
#include "debugtools.h"
#include "winerror.h"
#include "wine/unicode.h"
#include "server.h"
#include "ntddk.h"
#include "ntdll_misc.h"
...
...
@@ -21,7 +22,7 @@ static inline NTSTATUS copy_nameU( LPWSTR Dest, const OBJECT_ATTRIBUTES *attr )
if
(
attr
&&
attr
->
ObjectName
&&
attr
->
ObjectName
->
Buffer
)
{
if
((
attr
->
ObjectName
->
Length
)
>
MAX_PATH
)
return
STATUS_BUFFER_OVERFLOW
;
l
strcpyW
(
Dest
,
attr
->
ObjectName
->
Buffer
);
strcpyW
(
Dest
,
attr
->
ObjectName
->
Buffer
);
}
else
Dest
[
0
]
=
0
;
return
STATUS_SUCCESS
;
...
...
dlls/ntdll/time.c
View file @
0aa6cc29
...
...
@@ -178,27 +178,45 @@ VOID WINAPI RtlSystemTimeToLocalTime(
memcpy
(
LocalTime
,
SystemTime
,
sizeof
(
PLARGE_INTEGER
));
}
/******************************************************************************
* RtlTimeToSecondsSince19
8
0 [NTDLL]
* RtlTimeToSecondsSince19
7
0 [NTDLL]
*/
BOOLEAN
WINAPI
RtlTimeToSecondsSince19
8
0
(
BOOLEAN
WINAPI
RtlTimeToSecondsSince19
7
0
(
LPFILETIME
ft
,
LPDWORD
timeret
)
{
/* 1980 = 1970+10*365 days + 29. februar 1972 + 29.februar 1976 */
*
timeret
=
DOSFS_FileTimeToUnixTime
(
ft
,
NULL
)
-
(
10
*
365
+
2
)
*
24
*
3600
;
return
1
;
*
timeret
=
DOSFS_FileTimeToUnixTime
(
ft
,
NULL
);
return
TRUE
;
}
/******************************************************************************
* RtlTimeToSecondsSince19
7
0 [NTDLL]
* RtlTimeToSecondsSince19
8
0 [NTDLL]
*/
BOOLEAN
WINAPI
RtlTimeToSecondsSince19
7
0
(
BOOLEAN
WINAPI
RtlTimeToSecondsSince19
8
0
(
LPFILETIME
ft
,
LPDWORD
timeret
)
{
*
timeret
=
DOSFS_FileTimeToUnixTime
(
ft
,
NULL
);
return
1
;
/* 1980 = 1970+10*365 days + 29. februar 1972 + 29.februar 1976 */
if
(
!
RtlTimeToSecondsSince1970
(
ft
,
timeret
))
return
FALSE
;
*
timeret
-=
(
10
*
365
+
2
)
*
24
*
60
*
60
;
return
TRUE
;
}
/******************************************************************************
* RtlSecondsSince1970ToTime [NTDLL]
*/
void
WINAPI
RtlSecondsSince1970ToTime
(
DWORD
time
,
LPFILETIME
ft
)
{
DOSFS_UnixTimeToFileTime
(
time
,
ft
,
0
);
}
/******************************************************************************
* RtlSecondsSince1980ToTime [NTDLL]
*/
void
WINAPI
RtlSecondsSince1980ToTime
(
DWORD
time
,
LPFILETIME
ft
)
{
RtlSecondsSince1970ToTime
(
time
+
(
10
*
365
+
2
)
*
24
*
60
*
60
,
ft
);
}
/******************************************************************************
...
...
include/ntddk.h
View file @
0aa6cc29
...
...
@@ -741,6 +741,9 @@ BOOLEAN WINAPI RtlTimeToSecondsSince1970(
LPFILETIME
ft
,
LPDWORD
timeret
);
void
WINAPI
RtlSecondsSince1970ToTime
(
DWORD
time
,
LPFILETIME
ft
);
void
WINAPI
RtlSecondsSince1980ToTime
(
DWORD
time
,
LPFILETIME
ft
);
/* heap functions */
/* Data structure for heap definition. This includes various
...
...
@@ -959,6 +962,18 @@ NTSTATUS WINAPI NtUnloadKey(
NTSTATUS
WINAPI
NtClose
(
HANDLE
Handle
);
NTSTATUS
WINAPI
NtTerminateProcess
(
HANDLE
handle
,
LONG
exit_code
);
NTSTATUS
WINAPI
NtCreateSemaphore
(
OUT
PHANDLE
SemaphoreHandle
,
IN
ACCESS_MASK
DesiredAccess
,
IN
POBJECT_ATTRIBUTES
ObjectAttributes
OPTIONAL
,
IN
ULONG
InitialCount
,
IN
ULONG
MaximumCount
);
NTSTATUS
WINAPI
NtReleaseSemaphore
(
IN
HANDLE
SemaphoreHandle
,
IN
ULONG
ReleaseCount
,
IN
PULONG
PreviousCount
);
/* misc */
#if defined(__i386__) && defined(__GNUC__)
...
...
loader/module.c
View file @
0aa6cc29
...
...
@@ -12,9 +12,7 @@
#include <sys/types.h>
#include <unistd.h>
#include "windef.h"
#include "wingdi.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "winerror.h"
#include "file.h"
#include "global.h"
...
...
@@ -1619,22 +1617,6 @@ FARPROC MODULE_GetProcAddress(
}
/***********************************************************************
* RtlImageNtHeader (NTDLL)
*/
PIMAGE_NT_HEADERS
WINAPI
RtlImageNtHeader
(
HMODULE
hModule
)
{
/* basically:
* return hModule+(((IMAGE_DOS_HEADER*)hModule)->e_lfanew);
* but we could get HMODULE16 or the like (think builtin modules)
*/
WINE_MODREF
*
wm
=
MODULE32_LookupHMODULE
(
hModule
);
if
(
!
wm
||
(
wm
->
type
!=
MODULE32_PE
))
return
(
PIMAGE_NT_HEADERS
)
0
;
return
PE_HEADER
(
wm
->
module
);
}
/***************************************************************************
* HasGPHandler (KERNEL.338)
*/
...
...
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