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
e0ce6dc3
Commit
e0ce6dc3
authored
Oct 07, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Move Get/SetProcessDword to kernel16.c.
parent
806deab0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
107 deletions
+119
-107
kernel16.c
dlls/kernel32/kernel16.c
+115
-0
krnl386.exe.spec
dlls/kernel32/krnl386.exe.spec
+2
-2
process.c
dlls/kernel32/process.c
+2
-105
No files found.
dlls/kernel32/kernel16.c
View file @
e0ce6dc3
...
...
@@ -25,6 +25,7 @@
#include "winbase.h"
#include "winternl.h"
#include "wownt32.h"
#include "wine/winuser16.h"
#include "kernel_private.h"
#include "kernel16_private.h"
...
...
@@ -32,6 +33,10 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
module
);
extern
DWORD
WINAPI
GetProcessFlags
(
DWORD
processid
);
static
DWORD
process_dword
;
/**************************************************************************
* DllEntryPoint (KERNEL.669)
*/
...
...
@@ -580,6 +585,116 @@ DWORD WINAPI MapProcessHandle( HANDLE hProcess )
}
/***********************************************************************
* SetProcessDword (KERNEL.484)
* 'Of course you cannot directly access Windows internal structures'
*/
void
WINAPI
SetProcessDword16
(
DWORD
dwProcessID
,
INT
offset
,
DWORD
value
)
{
TRACE
(
"(%d, %d)
\n
"
,
dwProcessID
,
offset
);
if
(
dwProcessID
&&
dwProcessID
!=
GetCurrentProcessId
())
{
ERR
(
"%d: process %x not accessible
\n
"
,
offset
,
dwProcessID
);
return
;
}
switch
(
offset
)
{
case
GPD_APP_COMPAT_FLAGS
:
case
GPD_LOAD_DONE_EVENT
:
case
GPD_HINSTANCE16
:
case
GPD_WINDOWS_VERSION
:
case
GPD_THDB
:
case
GPD_PDB
:
case
GPD_STARTF_SHELLDATA
:
case
GPD_STARTF_HOTKEY
:
case
GPD_STARTF_SHOWWINDOW
:
case
GPD_STARTF_SIZE
:
case
GPD_STARTF_POSITION
:
case
GPD_STARTF_FLAGS
:
case
GPD_PARENT
:
case
GPD_FLAGS
:
ERR
(
"Not allowed to modify offset %d
\n
"
,
offset
);
break
;
case
GPD_USERDATA
:
process_dword
=
value
;
break
;
default:
ERR
(
"Unknown offset %d
\n
"
,
offset
);
break
;
}
}
/***********************************************************************
* GetProcessDword (KERNEL.485)
* 'Of course you cannot directly access Windows internal structures'
*/
DWORD
WINAPI
GetProcessDword16
(
DWORD
dwProcessID
,
INT
offset
)
{
DWORD
x
,
y
;
STARTUPINFOW
siw
;
TRACE
(
"(%d, %d)
\n
"
,
dwProcessID
,
offset
);
if
(
dwProcessID
&&
dwProcessID
!=
GetCurrentProcessId
())
{
ERR
(
"%d: process %x not accessible
\n
"
,
offset
,
dwProcessID
);
return
0
;
}
switch
(
offset
)
{
case
GPD_APP_COMPAT_FLAGS
:
return
GetAppCompatFlags16
(
0
);
case
GPD_LOAD_DONE_EVENT
:
return
0
;
case
GPD_HINSTANCE16
:
return
GetTaskDS16
();
case
GPD_WINDOWS_VERSION
:
return
GetExeVersion16
();
case
GPD_THDB
:
return
(
DWORD_PTR
)
NtCurrentTeb
()
-
0x10
/* FIXME */
;
case
GPD_PDB
:
return
(
DWORD_PTR
)
NtCurrentTeb
()
->
Peb
;
/* FIXME: truncating a pointer */
case
GPD_STARTF_SHELLDATA
:
/* return stdoutput handle from startupinfo ??? */
GetStartupInfoW
(
&
siw
);
return
HandleToULong
(
siw
.
hStdOutput
);
case
GPD_STARTF_HOTKEY
:
/* return stdinput handle from startupinfo ??? */
GetStartupInfoW
(
&
siw
);
return
HandleToULong
(
siw
.
hStdInput
);
case
GPD_STARTF_SHOWWINDOW
:
GetStartupInfoW
(
&
siw
);
return
siw
.
wShowWindow
;
case
GPD_STARTF_SIZE
:
GetStartupInfoW
(
&
siw
);
x
=
siw
.
dwXSize
;
if
(
(
INT
)
x
==
CW_USEDEFAULT
)
x
=
CW_USEDEFAULT16
;
y
=
siw
.
dwYSize
;
if
(
(
INT
)
y
==
CW_USEDEFAULT
)
y
=
CW_USEDEFAULT16
;
return
MAKELONG
(
x
,
y
);
case
GPD_STARTF_POSITION
:
GetStartupInfoW
(
&
siw
);
x
=
siw
.
dwX
;
if
(
(
INT
)
x
==
CW_USEDEFAULT
)
x
=
CW_USEDEFAULT16
;
y
=
siw
.
dwY
;
if
(
(
INT
)
y
==
CW_USEDEFAULT
)
y
=
CW_USEDEFAULT16
;
return
MAKELONG
(
x
,
y
);
case
GPD_STARTF_FLAGS
:
GetStartupInfoW
(
&
siw
);
return
siw
.
dwFlags
;
case
GPD_PARENT
:
return
0
;
case
GPD_FLAGS
:
return
GetProcessFlags
(
0
);
case
GPD_USERDATA
:
return
process_dword
;
default:
ERR
(
"Unknown offset %d
\n
"
,
offset
);
return
0
;
}
}
/***********************************************************************
* FreeLibrary32 (KERNEL.486)
*/
BOOL
WINAPI
FreeLibrary32_16
(
HINSTANCE
module
)
...
...
dlls/kernel32/krnl386.exe.spec
View file @
e0ce6dc3
...
...
@@ -386,8 +386,8 @@
481 pascal -ret16 _LeaveWin16Lock() _LeaveWin16Lock
482 pascal LoadSystemLibrary32(str) LoadLibrary32_16 # FIXME!
483 pascal MapProcessHandle(long) MapProcessHandle
484 pascal SetProcessDword(long s_word long) SetProcessDword
485 pascal GetProcessDword(long s_word) GetProcessDword
484 pascal SetProcessDword(long s_word long) SetProcessDword
16
485 pascal GetProcessDword(long s_word) GetProcessDword
16
486 pascal FreeLibrary32(long) FreeLibrary32_16
487 pascal GetModuleFileName32(long str word) GetModuleFileName32_16
488 pascal GetModuleHandle32(str) GetModuleHandle32_16
...
...
dlls/kernel32/process.c
View file @
e0ce6dc3
...
...
@@ -74,7 +74,6 @@ static UINT process_error_mode;
static
DWORD
shutdown_flags
=
0
;
static
DWORD
shutdown_priority
=
0x280
;
static
DWORD
process_dword
;
static
BOOL
is_wow64
;
HMODULE
kernel32_handle
=
0
;
...
...
@@ -2537,114 +2536,12 @@ DWORD WINAPI GetProcessFlags( DWORD processid )
/***********************************************************************
* GetProcessDword (KERNEL.485)
* GetProcessDword (KERNEL32.18)
* 'Of course you cannot directly access Windows internal structures'
*/
DWORD
WINAPI
GetProcessDword
(
DWORD
dwProcessID
,
INT
offset
)
{
DWORD
x
,
y
;
STARTUPINFOW
siw
;
TRACE
(
"(%d, %d)
\n
"
,
dwProcessID
,
offset
);
if
(
dwProcessID
&&
dwProcessID
!=
GetCurrentProcessId
())
{
ERR
(
"%d: process %x not accessible
\n
"
,
offset
,
dwProcessID
);
return
0
;
}
switch
(
offset
)
{
case
GPD_APP_COMPAT_FLAGS
:
return
GetAppCompatFlags16
(
0
);
case
GPD_LOAD_DONE_EVENT
:
return
0
;
case
GPD_HINSTANCE16
:
return
GetTaskDS16
();
case
GPD_WINDOWS_VERSION
:
return
GetExeVersion16
();
case
GPD_THDB
:
return
(
DWORD_PTR
)
NtCurrentTeb
()
-
0x10
/* FIXME */
;
case
GPD_PDB
:
return
(
DWORD_PTR
)
NtCurrentTeb
()
->
Peb
;
/* FIXME: truncating a pointer */
case
GPD_STARTF_SHELLDATA
:
/* return stdoutput handle from startupinfo ??? */
GetStartupInfoW
(
&
siw
);
return
HandleToULong
(
siw
.
hStdOutput
);
case
GPD_STARTF_HOTKEY
:
/* return stdinput handle from startupinfo ??? */
GetStartupInfoW
(
&
siw
);
return
HandleToULong
(
siw
.
hStdInput
);
case
GPD_STARTF_SHOWWINDOW
:
GetStartupInfoW
(
&
siw
);
return
siw
.
wShowWindow
;
case
GPD_STARTF_SIZE
:
GetStartupInfoW
(
&
siw
);
x
=
siw
.
dwXSize
;
if
(
(
INT
)
x
==
CW_USEDEFAULT
)
x
=
CW_USEDEFAULT16
;
y
=
siw
.
dwYSize
;
if
(
(
INT
)
y
==
CW_USEDEFAULT
)
y
=
CW_USEDEFAULT16
;
return
MAKELONG
(
x
,
y
);
case
GPD_STARTF_POSITION
:
GetStartupInfoW
(
&
siw
);
x
=
siw
.
dwX
;
if
(
(
INT
)
x
==
CW_USEDEFAULT
)
x
=
CW_USEDEFAULT16
;
y
=
siw
.
dwY
;
if
(
(
INT
)
y
==
CW_USEDEFAULT
)
y
=
CW_USEDEFAULT16
;
return
MAKELONG
(
x
,
y
);
case
GPD_STARTF_FLAGS
:
GetStartupInfoW
(
&
siw
);
return
siw
.
dwFlags
;
case
GPD_PARENT
:
return
0
;
case
GPD_FLAGS
:
return
GetProcessFlags
(
0
);
case
GPD_USERDATA
:
return
process_dword
;
default
:
ERR
(
"Unknown offset %d
\n
"
,
offset
);
return
0
;
}
}
/***********************************************************************
* SetProcessDword (KERNEL.484)
* 'Of course you cannot directly access Windows internal structures'
*/
void
WINAPI
SetProcessDword
(
DWORD
dwProcessID
,
INT
offset
,
DWORD
value
)
{
TRACE
(
"(%d, %d)
\n
"
,
dwProcessID
,
offset
);
if
(
dwProcessID
&&
dwProcessID
!=
GetCurrentProcessId
())
{
ERR
(
"%d: process %x not accessible
\n
"
,
offset
,
dwProcessID
);
return
;
}
switch
(
offset
)
{
case
GPD_APP_COMPAT_FLAGS
:
case
GPD_LOAD_DONE_EVENT
:
case
GPD_HINSTANCE16
:
case
GPD_WINDOWS_VERSION
:
case
GPD_THDB
:
case
GPD_PDB
:
case
GPD_STARTF_SHELLDATA
:
case
GPD_STARTF_HOTKEY
:
case
GPD_STARTF_SHOWWINDOW
:
case
GPD_STARTF_SIZE
:
case
GPD_STARTF_POSITION
:
case
GPD_STARTF_FLAGS
:
case
GPD_PARENT
:
case
GPD_FLAGS
:
ERR
(
"Not allowed to modify offset %d
\n
"
,
offset
);
break
;
case
GPD_USERDATA
:
process_dword
=
value
;
break
;
default
:
ERR
(
"Unknown offset %d
\n
"
,
offset
);
break
;
}
FIXME
(
"(%d, %d): not supported
\n
"
,
dwProcessID
,
offset
);
return
0
;
}
...
...
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