dllimport


WOW64 Redirection and LoadLibrary


I'm trying to build a 32-bit program that can run correctly on 64-bit Windows; that is, if it needs to open a text file for the user, the file needs to not be redirected from C:\Program Files to C:\Program Files (x86). However, if I just call Wow64DisableWow64FsRedirection, then my program fails to load at all because some system libraries call LoadLibrary when portions of the GUI are loading, which tries to load a 64-bit version of a system DLL into my program.
How do I solve this problem?
Edit:
See the problem in the screenshot below:
Edit 2:
Here's another question that'll solve the problem: Is there any way to disable WOW64 redirection for an arbitrary thread in your process, or for your process as a whole?
Easy, call Wow64DisableWow64FsRedirection just before you call CreateFile, and then call Wow64RevertWow64FsRedirection just as soon as it is done.

Related Links

Mangled member function name different during dllimport
how to use DllImport in metro-style app
Converting doc file to post script
How can I get a COM component which can be used on Windows phone 8 project with C#
Externs and DLL imports
Mixed native and managed code heap corruption
MarshalDirectiveException
call unmanaged C++ code from C# using pinvoke
Detecting DLL Code Splicing
WOW64 Redirection and LoadLibrary
Using C# dll in Windows phone 7
Python 2.5 Import dll AttributeError
Replacing the Import Table in PE file by standart LoadLibrary
Unresolved external symbol
Declare and <DllImport> in VB.NET have different results
how to import/export dll and use its function

Categories

HOME
search
localization
apache-flink
phpmyadmin
datastore
apache-spark-mllib
hessian
obfuscation
solver
scripting
tail
modal-dialog
recordrtc
qpython
spin
jquery-ui-sortable
mod-security
tput
intercom
mvc-mini-profiler
feathersjs
google-picker
cfml
definitelytyped
jackson-modules
fragment-backstack
nstimer
cppreference
user-defined-functions
sqlpackage
realm-mobile-platform
google-earth
boost-asio
sql-server-2000
kodi
jbutton
playstation-portable
sendbird
navigator
python-pptx
hivemq
reactivekit
nohup
google-data-api
magento-1.9.3
logback-groovy
smoothstate.js
flask-login
openrasta
robomongo
dbcontext
identification
zenhub
qtranslate
appdomain
flac
renaming
chromium-os
flex-monkey
macaulay2
spreadjs
html-to-pdf
exim4
jaunt-api
directdraw
character-replacement
text-search
cgi-bin
rpart
ms-access-2000
entity-framework-4.3
cryptographichashfunction
cross-join
addressing-mode
dct
fpdi
decoupling
gae-quotas
gwt-openlayers
ie8-compatibility-mode
code-duplication
nevron
bjyauthorize
monotouch.dialog
qtconcurrent
pyunit
jsr286
luabind
creole
umra
svk
hbm2java
skype4java
lobo-cobra
mathematical-typesetting

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App