Discussion:
Errors when running VFP9 under impersonation
(too old to reply)
WP
2010-04-29 15:01:25 UTC
Permalink
Hi folks,
I run a VFP9 SP2 application with impersonation. So the first sentence in my
menu.mpr is:

IF
LogonUser("specialuser","MyDomain","superpassword",LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_DEFAULT, @nToken) = 0
MESSAGEBOX("Failed to authenticate. Unable to continue",16,"Zest",0)
RETURN
ENDIF
IF ImpersonateLoggedOnUser(nToken) = 0
MESSAGEBOX("Failed to authenticate. Unable to continue",16,"Zest",0)
RETURN
ENDIF

Then, as soon as a WAIT WINDOW "mymessage" appears, the little window on the
top right side of the screen appears, but it appears empty, and the program
hangs.
Same thing happens if immediately after the impersonation I put a SET STEP
ON to follow the program in the debugger window: as soon as I click on a
menu in the debugger, the program hangs.

What's going on here? Does impersonation not work properly?
Dan Freeman
2010-04-29 21:50:47 UTC
Permalink
Hmmm....

You show some code calling a non-Foxpro function, then talk about a
WAIT WINDOW that isn't in your code, and then something else that
displays after the non-existent WAIT WINDOW.

Care to 'splain a little more?

Dan
Post by WP
Hi folks,
I run a VFP9 SP2 application with impersonation. So the first sentence in my
IF
LogonUser("specialuser","MyDomain","superpassword",LOGON32_LOGON_INTERACTIVE,
MESSAGEBOX("Failed to authenticate. Unable to continue",16,"Zest",0)
RETURN
ENDIF
IF ImpersonateLoggedOnUser(nToken) = 0
MESSAGEBOX("Failed to authenticate. Unable to continue",16,"Zest",0)
RETURN
ENDIF
Then, as soon as a WAIT WINDOW "mymessage" appears, the little window on the
top right side of the screen appears, but it appears empty, and the program
hangs.
Same thing happens if immediately after the impersonation I put a SET STEP ON
to follow the program in the debugger window: as soon as I click on a menu in
the debugger, the program hangs.
What's going on here? Does impersonation not work properly?
Loading...