关于32/64位操作系统下,应用程序兼容性问题
-
最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。
-
最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。
-
最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。
This is an english only website, please translate your question: we are not able to understand it
-
最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。
xjh_sz wrote:
For example UpdateDriverforPlugAndDevice (), I used GetLastError (), see the error.
And what is that error?
xjh_sz wrote:
The problem is solved, but I now maintain two versions with the next 32, 64 a; do not know what a good way, just run a version.
Not sure I understand this. Are you wanting one set of source code, but two separate exe files?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。
You would get more help if you describe your problems in English. 以前你也用中文在这里叫过吧?鬼佬们不懂中文,白瞎了~~ 个人理解,仅供参考: win32程序在win64上面是通过wow64工作的,被。64位程隔离在一个独立的环境里面序和32位程序在用户层不可互访。因此没有办法只用一个程序在64位和32位间无缝转换。即64环境中必须用64的程序才能安装64位的驱动,32位环境中只能用32位程序安装驱动。 不过完全可以做到在源代码层面统一。
modified on Wednesday, July 21, 2010 9:19 AM
-
xjh_sz wrote:
For example UpdateDriverforPlugAndDevice (), I used GetLastError (), see the error.
And what is that error?
xjh_sz wrote:
The problem is solved, but I now maintain two versions with the next 32, 64 a; do not know what a good way, just run a version.
Not sure I understand this. Are you wanting one set of source code, but two separate exe files?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
Dave, It is nice of you to translate OP question and try to give some clue. Shouldn't you tranlated your answer to chinease though ;P ;)
Yusuf May I help you?
-
Dave, It is nice of you to translate OP question and try to give some clue. Shouldn't you tranlated your answer to chinease though ;P ;)
Yusuf May I help you?
Yusuf wrote:
Shouldn't you tranlated your answer to chinease though
不,我不会说中文。
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。
xjh_sz wrote:
I recently created a driver installation program, which uses a number of core functions such as UpdateDriverforPlugAndDevices(), using vs2008, in 32-bit operating system everything is working properly. But win32 program can run in x64, but under x64 it does not work. For example UpdateDriverForPlugandPlayDevices() raises an error, I used GetLastError (), and I see an error code. Later I was using a 64-bit system with vs2008 and compiled the x64 program, everything works fine, but the program can not run in win32. The problem is now solved, but I now maintain two versions of the installer 32 and 64; I do not know what a better way, I just run a seperate version of the executable.
Hi xjh_sz, I believe that you are doing the correct thing by creating two separate installers for 32 and 64 bit. UpdateDriverForPlugAndPlayDevices does not support WOW64. You might be able to get your 32 bit installer to work by calling Wow64EnableWow64FsRedirection[^] but I honestly don't know for sure. Some additional documentation: Driver Installation for 32-bit and 64-bit Platforms[^] Best Wishes, -David Delaune
-
This is an english only website, please translate your question: we are not able to understand it
No it isn't. We even have non-English forums, such as this http://www.codeproject.com/Forums/1580230/General-Programming-Chinese.aspx[^] :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
最近在写个驱动安装程序,里面用到一些内核函数比如UpdateDriverforPlugAndDevice(),用的vs2008,在32位操作系统下工作正常,win32的程序可以在x64下运行,但是在64位下就会出错,比如UpdateDriverforPlugAndDevice(),我用GetLastError(),看到出错。后来我在64位系统下装了vs2008,编译出x64程序,一切运行正常,但是这个程序无法在win32下运行。问题是解决了,但是我现在用维护两个版本32下一个,64位一个;不知道大家有什么好方法,只要运行一个版本。
First,thanks for your replies.I am sorry to you because I asked question in chinese. My question is as fllows. I recently created a driver installation program, which uses a number of core functions such as UpdateDriverforPlugAndDevice(), using vs2008, in 32-bit operating system everything is working properly. But win32 program can run in x64, but under x64 it does not work. For example UpdateDriverForPlugandPlayDevices() raises an error, I used GetLastError (), and I see an error code. Later I was using a 64-bit system with vs2008 and compiled the x64 program, everything works fine, but the program can not run in win32. The problem is now solved, but I now maintain two versions of the installer 32 and 64; I do not know what a better way, I just run a seperate version of the executable.