Link to home
Start Free TrialLog in
Avatar of jamie77777
jamie77777

asked on

VB6 Impersonation in Windows 7

Hi,

I have a legacy application that contains some VB6 impersonation code on startup.

I am trying to make the application function on Windows 7.  I've tried creating a SHIM and also used the Standard User Analyzer to 'mitigate' issues, with no success.

To be clear, I am right-clicking the application and selecting 'run as administrator'.  There is a chance the application is calling another application, but I'm sure if the first app is run as 'admin' then the rest would follow?

The error message:

ImpersonationVB6:
CreateProcessWithLogonW() failed with error 740

I don't require the application to process the impersonation seqment and simply want the error to go away!

Any ideas?
Avatar of _
_
Flag of Bahamas image

What about Right-click, run in XP Compatibility Mode?
Avatar of jamie77777
jamie77777

ASKER

Thanks for the vey quick response, but no, unfortunately that doesn't work...
Try creating a manifest file for your application.

Here's a sample that I think should work:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.1.0.24" processorArchitecture="X86" name="MyApplication" type="win32"/>
    <description>This is my VB6 application</description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" 
             version="6.0.0.0" processorArchitecture="X86" 
             publicKeyToken="6595b64144ccf1df" language="*"/>
        </dependentAssembly>
    </dependency>
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
            <requestedPrivileges>
                 <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
            </requestedPrivileges>
        </security>
    </trustInfo>
</assembly>

Open in new window


Copy the above into a text file, adjust the "name" and "description" tags to fit your application, call the file like your application and add a '.manifest', i.e. "myapp.exe.manifest". Copy that manifest file into the application's installation folder next to the executable. Then try launching the program again.
That didn't work, thanks anyway :)  I'm thinking I need to 'fool' the OS into thinking the VB6 impersonation code is working... any more ideas anyone?
Just came across this one application virtualizer: http://www.evalaze.de/en/Evalaze-Softwarevirtualisierung-Evalazer/

It promises to be able to run "old applications" (even 16-bit ones) under modern operating systems.
Maybe that will also apply to your problem program.
Hi torimar, thanks but virtualising the app isn't an option...
I'd still really like some help with this. It's to the point of the vendor reengineering the app, a very expensive project..
ASKER CERTIFIED SOLUTION
Avatar of BrianVSoft
BrianVSoft
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yep, figured as much.  I guess the only plus side is the amount of work it'll generate in the industry (I'm clutching at straws here...).  Thanks the information, interesting site.