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
0f556bf8
Commit
0f556bf8
authored
Nov 23, 2009
by
Dan Kegel
Committed by
Alexandre Julliard
Nov 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement RtlGetNtGlobalFlags(), add related defines to winternl.h.
parent
5b4fdcc8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
1 deletion
+65
-1
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-1
process.c
dlls/ntdll/process.c
+9
-0
thread.c
dlls/ntdll/thread.c
+50
-0
winternl.h
include/winternl.h
+5
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
0f556bf8
...
...
@@ -632,7 +632,7 @@
@ stdcall RtlGetLongestNtPathLength()
# @ stub RtlGetNativeSystemInformation
# @ stub RtlGetNextRange
@ st
ub RtlGetNtGlobalFlags
@ st
dcall RtlGetNtGlobalFlags()
@ stdcall RtlGetNtProductType(ptr)
@ stdcall RtlGetNtVersionNumbers(ptr ptr ptr)
@ stdcall RtlGetOwnerSecurityDescriptor(ptr ptr ptr)
...
...
dlls/ntdll/process.c
View file @
0f556bf8
...
...
@@ -73,6 +73,15 @@ PEB * WINAPI RtlGetCurrentPeb(void)
return
NtCurrentTeb
()
->
Peb
;
}
/******************************************************************************
* RtlGetNtGlobalFlags [NTDLL.@]
*
*/
ULONG
WINAPI
RtlGetNtGlobalFlags
(
void
)
{
return
NtCurrentTeb
()
->
Peb
->
NtGlobalFlag
;
}
/***********************************************************************
* __wine_make_process_system (NTDLL.@)
*
...
...
dlls/ntdll/thread.c
View file @
0f556bf8
...
...
@@ -216,6 +216,53 @@ done:
return
status
;
}
/***********************************************************************
* get_global_flag
*
* This is called before the process heap is created,
* but after the connection to the server is established.
* No windows heap allocation is permitted.
*/
static
DWORD
get_global_flag
(
void
)
{
static
const
WCHAR
sessionman_keyW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'\\'
,
'S'
,
'e'
,
's'
,
's'
,
'i'
,
'o'
,
'n'
,
' '
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
global_flagW
[]
=
{
'G'
,
'l'
,
'o'
,
'b'
,
'a'
,
'l'
,
'F'
,
'l'
,
'a'
,
'g'
,
0
};
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
,
valueW
;
HANDLE
hkey
;
char
tmp
[
32
];
DWORD
count
;
KEY_VALUE_PARTIAL_INFORMATION
*
info
=
(
KEY_VALUE_PARTIAL_INFORMATION
*
)
tmp
;
NTSTATUS
status
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
nameW
;
attr
.
Attributes
=
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
sessionman_keyW
);
status
=
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
);
if
(
status
!=
STATUS_SUCCESS
)
return
0
;
RtlInitUnicodeString
(
&
valueW
,
global_flagW
);
status
=
NtQueryValueKey
(
hkey
,
&
valueW
,
KeyValuePartialInformation
,
tmp
,
sizeof
(
tmp
)
-
1
,
&
count
);
if
(
status
!=
STATUS_SUCCESS
)
return
0
;
/* Some documents say this can be a string, so handle either type */
if
(
info
->
Type
==
REG_DWORD
)
return
*
(
DWORD
*
)
info
->
Data
;
if
(
info
->
Type
==
REG_SZ
)
return
strtol
((
char
*
)
info
->
Data
,
NULL
,
16
);
return
0
;
}
/***********************************************************************
* thread_init
...
...
@@ -297,6 +344,9 @@ HANDLE thread_init(void)
server_init_process
();
info_size
=
server_init_thread
(
peb
);
/* retrieve the global flags settings from the registry */
peb
->
NtGlobalFlag
=
get_global_flag
();
/* create the process heap */
if
(
!
(
peb
->
ProcessHeap
=
RtlCreateHeap
(
HEAP_GROWABLE
,
NULL
,
0
,
0
,
NULL
,
NULL
)))
{
...
...
include/winternl.h
View file @
0f556bf8
...
...
@@ -1732,6 +1732,10 @@ typedef void (NTAPI *RTL_WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN); /* FIXME: not
#define SE_CREATE_GLOBAL_PRIVILEGE 30L
#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
/* NtGlobalFlag bits */
#define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
#define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
#define FLG_HEAP_DISABLE_COALESCING 0x00200000
/* Rtl*Registry* functions structs and defines */
#define RTL_REGISTRY_ABSOLUTE 0
...
...
@@ -2404,6 +2408,7 @@ NTSYSAPI NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSI
NTSYSAPI
NTSTATUS
WINAPI
RtlGetLastNtStatus
(
void
);
NTSYSAPI
DWORD
WINAPI
RtlGetLastWin32Error
(
void
);
NTSYSAPI
DWORD
WINAPI
RtlGetLongestNtPathLength
(
void
);
NTSYSAPI
ULONG
WINAPI
RtlGetNtGlobalFlags
(
void
);
NTSYSAPI
BOOLEAN
WINAPI
RtlGetNtProductType
(
LPDWORD
);
NTSYSAPI
NTSTATUS
WINAPI
RtlGetOwnerSecurityDescriptor
(
PSECURITY_DESCRIPTOR
,
PSID
*
,
PBOOLEAN
);
NTSYSAPI
ULONG
WINAPI
RtlGetProcessHeaps
(
ULONG
,
HANDLE
*
);
...
...
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