Hi All,
I have run into a problem that I just can't seem to resolve. I am writing a 32bit C++ app that mounts/unmounts .wim files using the wimgapi dll supplied with Windows AIK for Win7. I have been testing under 32bit WinXP for the past few months, and everything has been working perfectly... at least until I switched to Win7 64bit.
Under Win7 the wim file never mounts, at least it doesn't appear to. The call to WIMMountImage returns success, as does a call to GetLastError, but it doesn't appear to actually mount as the target folder never shows the mounted wim structure. I have to believe the proper wimgapi.dll was installed by the AIK installer under Win7, otherwise I shouldn't even be able to make the function call, let alone get a successful response.
I have read everything I can find, and I can't see that I'm doing anything wrong. I have reached an impasse, and don't even know where to keep looking. Please help! I welcome any suggestions!
Thanks,
Jim
Page 1 of 1
Wimgapi on Windows 7 64bit
#2
Posted 14 November 2009 - 07:38 AM
My guess is you need to reference the correct wimgapi.dll, I have 2 different wimgapi.dll's
One in my System32 folder 492 KB (64 bit version), and another in my SysWOW64 397KB (32 bit version)
Don't have the WAIK installed (prefer OPK myself), but you should be able to find the x64 version in your WAIK Tools\amd64 folder
One in my System32 folder 492 KB (64 bit version), and another in my SysWOW64 397KB (32 bit version)
Don't have the WAIK installed (prefer OPK myself), but you should be able to find the x64 version in your WAIK Tools\amd64 folder
#3
Posted 14 November 2009 - 08:44 AM
Thanks for the quick response!
I found my Win7 system has both dll's as you mentioned, but how do I know which one is being loaded? I am linking the wimgapi.lib to my app, so the dll is being auto loaded. Are you suggesting that I need to load the 32 or 64 bit dll? And how can I make sure the correct version (System32/SysWOW64) gets loaded?
I don't think I can distribute the AIK components, so I need to verify and use the appropriate pre-installed components at runtime.
I found my Win7 system has both dll's as you mentioned, but how do I know which one is being loaded? I am linking the wimgapi.lib to my app, so the dll is being auto loaded. Are you suggesting that I need to load the 32 or 64 bit dll? And how can I make sure the correct version (System32/SysWOW64) gets loaded?
I don't think I can distribute the AIK components, so I need to verify and use the appropriate pre-installed components at runtime.
#4
Posted 14 November 2009 - 10:46 AM
As for distributing the files, probably not a good idea, but can easily run an If Exist script and check for both files.
C:\Windows\System32\wimgapi.dll
C:\Windows\SysWOW64\wimgapi.dll
Could probably even script your install.exe to copy these files from each users W7 directly into your EXE's folder. Then users could copy that folder to XP/Vista and you have created them a portable application without actually redistributing any files. Plus users would not need to know/do anything.
ninja style
What do you think.
C:\Windows\System32\wimgapi.dll
C:\Windows\SysWOW64\wimgapi.dll
Could probably even script your install.exe to copy these files from each users W7 directly into your EXE's folder. Then users could copy that folder to XP/Vista and you have created them a portable application without actually redistributing any files. Plus users would not need to know/do anything.
What do you think.
This post has been edited by MrJinje: 14 November 2009 - 10:49 AM
#5
Posted 16 November 2009 - 04:27 PM
So, I spent WAYYYYY too much time on this over the weekend, but finally found some answers. Finally!
First, the core problem appears to be permissions based. I accidently stumbled upon this once I found the wimgapi function WIMRegisterLogFile. The information contained in the log files led me to UAC permissions. However, I don't understand why the Mount calls returned successful when in fact they were failing. Strange.
Secondly, there is still something funky with using the proper DLLs. "If it ain't broke don't fix it", right? Well, it's working for me right now so I will continue debugging the app, then come back to troubleshooting the dll problems once I start building the install routines.
Anyway, thanks for leading me down the right path. The world suddenly makes sense again, and my sanity is still intact! Life is good!
First, the core problem appears to be permissions based. I accidently stumbled upon this once I found the wimgapi function WIMRegisterLogFile. The information contained in the log files led me to UAC permissions. However, I don't understand why the Mount calls returned successful when in fact they were failing. Strange.
Secondly, there is still something funky with using the proper DLLs. "If it ain't broke don't fix it", right? Well, it's working for me right now so I will continue debugging the app, then come back to troubleshooting the dll problems once I start building the install routines.
Anyway, thanks for leading me down the right path. The world suddenly makes sense again, and my sanity is still intact! Life is good!
- ← Import registry entries from hive file
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- Encrypts & Decrypts text file and stores the plain text in a text →
Share this topic:
Page 1 of 1



Help
Back to top









