diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-04-28 12:47:06 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-04-28 12:47:06 +0400 |
commit | aacf1864d89d9cf6b80b517655605ee73720e40a (patch) | |
tree | 7ed5815983554596092838a5096af8e91eaac8ac /winsup | |
parent | 533ce3fb55349f6d9fcfd000be47f2dd52446de8 (diff) |
* autoload.cc (IsWow64Process): Remove.
(Wow64DisableWow64FsRedirection): Remove.
(Wow64RevertWow64FsRedirection): Remove.
* ntdll.h (enum _PROCESSINFOCLASS): Define ProcessWow64Information.
* init.cc (respawn_wow64_process): Use NtQueryInformationProcess to
get WOW64 state.
* wincap.cc (wincapc::init): Ditto.
* wincap.h (wincapc::wow64): Change type to ULONG.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 11 | ||||
-rw-r--r-- | winsup/cygwin/autoload.cc | 3 | ||||
-rw-r--r-- | winsup/cygwin/init.cc | 12 | ||||
-rw-r--r-- | winsup/cygwin/ntdll.h | 1 | ||||
-rw-r--r-- | winsup/cygwin/wincap.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/wincap.h | 2 |
6 files changed, 24 insertions, 11 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 89a8b8ed4..5e14cd540 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,14 @@ +2008-04-28 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (IsWow64Process): Remove. + (Wow64DisableWow64FsRedirection): Remove. + (Wow64RevertWow64FsRedirection): Remove. + * ntdll.h (enum _PROCESSINFOCLASS): Define ProcessWow64Information. + * init.cc (respawn_wow64_process): Use NtQueryInformationProcess to + get WOW64 state. + * wincap.cc (wincapc::init): Ditto. + * wincap.h (wincapc::wow64): Change type to ULONG. + 2008-04-27 Corinna Vinschen <corinna@vinschen.de> * wincap.h (wincapc::wow64): Change type to BOOL. diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc index fdbebb332..7f9dbe992 100644 --- a/winsup/cygwin/autoload.cc +++ b/winsup/cygwin/autoload.cc @@ -402,9 +402,6 @@ LoadDLLfuncEx (FindNextVolumeA, 12, kernel32, 1) LoadDLLfuncEx (FindVolumeClose, 4, kernel32, 1) LoadDLLfuncEx (GetConsoleWindow, 0, kernel32, 1) LoadDLLfuncEx (GetVolumeNameForVolumeMountPointA, 12, kernel32, 1) -LoadDLLfuncEx (IsWow64Process, 8, kernel32, 1); -LoadDLLfuncEx (Wow64DisableWow64FsRedirection, 4, kernel32, 1) -LoadDLLfuncEx (Wow64RevertWow64FsRedirection, 4, kernel32, 1) LoadDLLfunc (SHGetDesktopFolder, 4, shell32) diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc index 4fe62063d..b05427592 100644 --- a/winsup/cygwin/init.cc +++ b/winsup/cygwin/init.cc @@ -71,25 +71,25 @@ respawn_wow64_process () PROCESS_BASIC_INFORMATION pbi; HANDLE parent; - BOOL is_wow64_proc = TRUE; /* Opt on the safe side. */ + ULONG wow64 = TRUE; /* Opt on the safe side. */ /* Unfortunately there's no simpler way to retrieve the parent process in NT, as far as I know. Hints welcome. */ ret = NtQueryInformationProcess (GetCurrentProcess (), ProcessBasicInformation, - (PVOID) &pbi, - sizeof pbi, NULL); - if (ret == STATUS_SUCCESS + &pbi, sizeof pbi, NULL); + if (NT_SUCCESS (ret) && (parent = OpenProcess (PROCESS_QUERY_INFORMATION, FALSE, pbi.InheritedFromUniqueProcessId))) { - IsWow64Process (parent, &is_wow64_proc); + NtQueryInformationProcess (parent, ProcessWow64Information, + &wow64, sizeof wow64, NULL); CloseHandle (parent); } /* The parent is a real 64 bit process? Respawn! */ - if (!is_wow64_proc) + if (!wow64) { PROCESS_INFORMATION pi; STARTUPINFOW si; diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h index 2d7d6f640..bf901eaaa 100644 --- a/winsup/cygwin/ntdll.h +++ b/winsup/cygwin/ntdll.h @@ -464,6 +464,7 @@ typedef enum _PROCESSINFOCLASS ProcessVmCounters = 3, ProcessTimes = 4, ProcessSessionInformation = 24, + ProcessWow64Information = 26, } PROCESSINFOCLASS; typedef struct _DEBUG_BUFFER diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index eee302036..4ce3ca1ce 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -11,6 +11,7 @@ details. */ #include "winsup.h" #include "security.h" +#include "ntdll.h" /* Minimal set of capabilities which is equivalent to NT4. */ static NO_COPY wincaps wincap_unknown = { @@ -394,7 +395,10 @@ wincapc::init () if (has_osversioninfoex && version.wProductType != VER_NT_WORKSTATION) ((wincaps *)caps)->is_server = true; - if (IsWow64Process (GetCurrentProcess (), &wow64) && !wow64) + if (NT_SUCCESS (NtQueryInformationProcess (GetCurrentProcess (), + ProcessWow64Information, + &wow64, sizeof wow64, NULL)) + && !wow64) { ((wincaps *)caps)->needs_count_in_si_lpres2 = false; ((wincaps *)caps)->has_restricted_stack_args = false; diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h index 89eba6150..b1b8a3c72 100644 --- a/winsup/cygwin/wincap.h +++ b/winsup/cygwin/wincap.h @@ -46,7 +46,7 @@ class wincapc { OSVERSIONINFOEX version; char osnam[40]; - BOOL wow64; + ULONG wow64; void *caps; public: |