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
cc9cfdff
Commit
cc9cfdff
authored
Sep 29, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed a few dependencies on kernel32 functions.
parent
baa15566
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
32 deletions
+47
-32
nt.c
dlls/ntdll/nt.c
+10
-5
rtl.c
dlls/ntdll/rtl.c
+15
-18
sec.c
dlls/ntdll/sec.c
+22
-9
No files found.
dlls/ntdll/nt.c
View file @
cc9cfdff
...
...
@@ -584,12 +584,17 @@ NTSTATUS WINAPI NtCreatePagingFile(
*
* writes a string to the nt-textmode screen eg. during startup
*/
NTSTATUS
WINAPI
NtDisplayString
(
PUNICODE_STRING
string
)
NTSTATUS
WINAPI
NtDisplayString
(
PUNICODE_STRING
string
)
{
TRACE
(
"%p(%s)
\n
"
,
string
->
Buffer
,
debugstr_w
(
string
->
Buffer
));
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
string
->
Buffer
,
string
->
Length
,
0
,
0
);
return
0
;
STRING
stringA
;
NTSTATUS
ret
;
if
(
!
(
ret
=
RtlUnicodeStringToAnsiString
(
&
stringA
,
string
,
TRUE
)))
{
MESSAGE
(
"%.*s"
,
stringA
.
Length
,
stringA
.
Buffer
);
RtlFreeAnsiString
(
&
stringA
);
}
return
ret
;
}
/******************************************************************************
...
...
dlls/ntdll/rtl.c
View file @
cc9cfdff
...
...
@@ -41,7 +41,7 @@ void WINAPI RtlInitializeResource(LPRTL_RWLOCK rwl)
rwl
->
uSharedWaiters
=
0
;
rwl
->
hOwningThreadId
=
0
;
rwl
->
dwTimeoutBoost
=
0
;
/* no info on this one, default value is 0 */
InitializeCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
InitializeCriticalSection
(
&
rwl
->
rtlCS
);
NtCreateSemaphore
(
&
rwl
->
hExclusiveReleaseSemaphore
,
0
,
NULL
,
0
,
65535
);
NtCreateSemaphore
(
&
rwl
->
hSharedReleaseSemaphore
,
0
,
NULL
,
0
,
65535
);
}
...
...
@@ -55,7 +55,7 @@ void WINAPI RtlDeleteResource(LPRTL_RWLOCK rwl)
{
if
(
rwl
)
{
EnterCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
EnterCriticalSection
(
&
rwl
->
rtlCS
);
if
(
rwl
->
iNumberActive
||
rwl
->
uExclusiveWaiters
||
rwl
->
uSharedWaiters
)
MESSAGE
(
"Deleting active MRSW lock (%p), expect failure
\n
"
,
rwl
);
rwl
->
hOwningThreadId
=
0
;
...
...
@@ -63,8 +63,8 @@ void WINAPI RtlDeleteResource(LPRTL_RWLOCK rwl)
rwl
->
iNumberActive
=
0
;
NtClose
(
rwl
->
hExclusiveReleaseSemaphore
);
NtClose
(
rwl
->
hSharedReleaseSemaphore
);
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
DeleteCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
DeleteCriticalSection
(
&
rwl
->
rtlCS
);
}
}
...
...
@@ -78,7 +78,7 @@ BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK rwl, BYTE fWait)
if
(
!
rwl
)
return
0
;
start:
EnterCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
EnterCriticalSection
(
&
rwl
->
rtlCS
);
if
(
rwl
->
iNumberActive
==
0
)
/* lock is free */
{
rwl
->
iNumberActive
=
-
1
;
...
...
@@ -97,7 +97,7 @@ wait:
{
rwl
->
uExclusiveWaiters
++
;
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
if
(
WaitForSingleObject
(
rwl
->
hExclusiveReleaseSemaphore
,
INFINITE
)
==
WAIT_FAILED
)
goto
done
;
goto
start
;
/* restart the acquisition to avoid deadlocks */
...
...
@@ -110,7 +110,7 @@ wait:
if
(
retVal
==
1
)
rwl
->
hOwningThreadId
=
GetCurrentThreadId
();
done:
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
return
retVal
;
}
...
...
@@ -124,7 +124,7 @@ BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK rwl, BYTE fWait)
if
(
!
rwl
)
return
0
;
start:
EnterCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
EnterCriticalSection
(
&
rwl
->
rtlCS
);
if
(
rwl
->
iNumberActive
<
0
)
{
if
(
rwl
->
hOwningThreadId
==
GetCurrentThreadId
()
)
...
...
@@ -137,7 +137,7 @@ start:
if
(
fWait
)
{
rwl
->
uSharedWaiters
++
;
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
if
(
(
dwWait
=
WaitForSingleObject
(
rwl
->
hSharedReleaseSemaphore
,
INFINITE
))
==
WAIT_FAILED
)
goto
done
;
goto
start
;
...
...
@@ -150,7 +150,7 @@ start:
retVal
=
1
;
}
done:
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
return
retVal
;
}
...
...
@@ -160,7 +160,7 @@ done:
*/
void
WINAPI
RtlReleaseResource
(
LPRTL_RWLOCK
rwl
)
{
EnterCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
EnterCriticalSection
(
&
rwl
->
rtlCS
);
if
(
rwl
->
iNumberActive
>
0
)
/* have one or more readers */
{
...
...
@@ -193,7 +193,7 @@ wake_exclusive:
}
}
}
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
Rtl
LeaveCriticalSection
(
&
rwl
->
rtlCS
);
}
...
...
@@ -421,12 +421,9 @@ LARGE_INTEGER WINAPI RtlExtendedIntegerMultiply(
BOOLEAN
WINAPI
RtlDosPathNameToNtPathName_U
(
LPWSTR
from
,
PUNICODE_STRING
us
,
DWORD
x2
,
DWORD
x3
)
{
LPSTR
fromA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
from
);
FIXME
(
"(%s,%p,%08lx,%08lx)
\n
"
,
fromA
,
us
,
x2
,
x3
);
if
(
us
)
RtlInitUnicodeString
(
us
,
HEAP_strdupW
(
GetProcessHeap
(),
0
,
from
));
return
TRUE
;
FIXME
(
"(%s,%p,%08lx,%08lx)
\n
"
,
debugstr_w
(
from
),
us
,
x2
,
x3
);
if
(
us
)
RtlCreateUnicodeString
(
us
,
from
);
return
TRUE
;
}
...
...
dlls/ntdll/sec.c
View file @
cc9cfdff
...
...
@@ -11,6 +11,7 @@
#include <math.h>
#include "windef.h"
#include "winbase.h"
#include "wine/exception.h"
#include "wine/winestring.h"
#include "file.h"
#include "heap.h"
...
...
@@ -27,6 +28,14 @@ DEFAULT_DEBUG_CHANNEL(ntdll);
#define NT_SUCCESS(status) (status == STATUS_SUCCESS)
/* filter for page-fault exceptions */
static
WINE_EXCEPTION_FILTER
(
page_fault
)
{
if
(
GetExceptionCode
()
==
EXCEPTION_ACCESS_VIOLATION
)
return
EXCEPTION_EXECUTE_HANDLER
;
return
EXCEPTION_CONTINUE_SEARCH
;
}
/*
* SID FUNCTIONS
*/
...
...
@@ -226,19 +235,23 @@ DWORD WINAPI RtlCopySid( DWORD nDestinationSidLength, PSID pDestinationSid, PSID
BOOL
WINAPI
RtlValidSid
(
PSID
pSid
)
{
if
(
IsBadReadPtr
(
pSid
,
4
))
BOOL
ret
;
__TRY
{
ret
=
TRUE
;
if
(
!
pSid
||
pSid
->
Revision
!=
SID_REVISION
||
pSid
->
SubAuthorityCount
>
SID_MAX_SUB_AUTHORITIES
)
{
ret
=
FALSE
;
}
}
__EXCEPT
(
page_fault
)
{
WARN
(
"(%p): invalid pointer!
\n
"
,
pSid
);
return
FALSE
;
}
if
(
pSid
->
SubAuthorityCount
>
SID_MAX_SUB_AUTHORITIES
)
return
FALSE
;
if
(
!
pSid
||
pSid
->
Revision
!=
SID_REVISION
)
return
FALSE
;
return
TRUE
;
__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