Jump to content

Recommended Posts

Posted

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


Posted

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

Posted

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.

Posted (edited)

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. :ph34r: ninja style

What do you think.

Edited by MrJinje
Posted

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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...