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
8ffb9b31
Commit
8ffb9b31
authored
Apr 13, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Initialize version and session id on the Unix side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4904d908
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
process.c
dlls/kernel32/tests/process.c
+12
-0
loader.c
dlls/ntdll/loader.c
+0
-5
virtual.c
dlls/ntdll/unix/virtual.c
+12
-0
No files found.
dlls/kernel32/tests/process.c
View file @
8ffb9b31
...
...
@@ -3455,6 +3455,18 @@ static void test_SuspendProcessState(void)
"wrong entry point %p/%p
\n
"
,
entry_ptr
,
(
char
*
)
exe_base
+
nt_header
.
OptionalHeader
.
AddressOfEntryPoint
);
ok
(
!
child_peb
.
LdrData
,
"LdrData set %p
\n
"
,
child_peb
.
LdrData
);
ok
(
!
child_peb
.
FastPebLock
,
"FastPebLock set %p
\n
"
,
child_peb
.
FastPebLock
);
ok
(
!
child_peb
.
TlsBitmap
,
"TlsBitmap set %p
\n
"
,
child_peb
.
TlsBitmap
);
ok
(
!
child_peb
.
TlsExpansionBitmap
,
"TlsExpansionBitmap set %p
\n
"
,
child_peb
.
TlsExpansionBitmap
);
ok
(
!
child_peb
.
LoaderLock
,
"LoaderLock set %p
\n
"
,
child_peb
.
LoaderLock
);
ok
(
!
child_peb
.
ProcessHeap
,
"ProcessHeap set %p
\n
"
,
child_peb
.
ProcessHeap
);
ok
(
!
child_peb
.
CSDVersion
.
Buffer
,
"CSDVersion set %s
\n
"
,
debugstr_w
(
child_peb
.
CSDVersion
.
Buffer
)
);
ok
(
child_peb
.
OSMajorVersion
,
"OSMajorVersion not set %u
\n
"
,
child_peb
.
OSMajorVersion
);
ok
(
child_peb
.
OSPlatformId
==
VER_PLATFORM_WIN32_NT
,
"OSPlatformId not set %u
\n
"
,
child_peb
.
OSPlatformId
);
ok
(
child_peb
.
SessionId
==
1
,
"SessionId not set %u
\n
"
,
child_peb
.
SessionId
);
ret
=
SetThreadContext
(
pi
.
hThread
,
&
ctx
);
ok
(
ret
,
"Failed to set remote thread context (%d)
\n
"
,
GetLastError
());
...
...
dlls/ntdll/loader.c
View file @
8ffb9b31
...
...
@@ -3636,11 +3636,6 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
peb
->
TlsBitmap
=
&
tls_bitmap
;
peb
->
TlsExpansionBitmap
=
&
tls_expansion_bitmap
;
peb
->
LoaderLock
=
&
loader_section
;
peb
->
OSMajorVersion
=
5
;
peb
->
OSMinorVersion
=
1
;
peb
->
OSBuildNumber
=
0xA28
;
peb
->
OSPlatformId
=
VER_PLATFORM_WIN32_NT
;
peb
->
SessionId
=
1
;
peb
->
ProcessHeap
=
RtlCreateHeap
(
HEAP_GROWABLE
,
NULL
,
0
,
0
,
NULL
,
NULL
);
RtlInitializeBitMap
(
&
tls_bitmap
,
peb
->
TlsBitmapBits
,
sizeof
(
peb
->
TlsBitmapBits
)
*
8
);
...
...
dlls/ntdll/unix/virtual.c
View file @
8ffb9b31
...
...
@@ -2805,6 +2805,17 @@ NTSTATUS virtual_create_builtin_view( void *module, const UNICODE_STRING *nt_nam
}
/* set some initial values in the new PEB */
static
void
init_peb
(
PEB
*
peb
)
{
peb
->
OSMajorVersion
=
6
;
peb
->
OSMinorVersion
=
1
;
peb
->
OSBuildNumber
=
0x1db1
;
peb
->
OSPlatformId
=
VER_PLATFORM_WIN32_NT
;
peb
->
SessionId
=
1
;
}
/* set some initial values in a new TEB */
static
void
init_teb
(
TEB
*
teb
,
PEB
*
peb
)
{
...
...
@@ -2870,6 +2881,7 @@ TEB *virtual_alloc_first_teb(void)
peb
=
(
PEB
*
)((
char
*
)
teb_block
+
32
*
block_size
-
peb_size
);
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
ptr
,
0
,
&
block_size
,
MEM_COMMIT
,
PAGE_READWRITE
);
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
peb
,
0
,
&
peb_size
,
MEM_COMMIT
,
PAGE_READWRITE
);
init_peb
(
peb
);
init_teb
(
teb
,
peb
);
*
(
ULONG_PTR
*
)
&
peb
->
CloudFileFlags
=
get_image_address
();
return
teb
;
...
...
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