views:

289

answers:

3

I have Credential manager implemented in VC++ which captures credentials during login process. It works well in XP/Vista/Windows 7 32 bit env. But is not working in 64 bit. Any idea ? Thanks in advance for any help

A: 

first of all can i ask that have you build your app in x64 platform in visual studio?

because any vc++ application which is build for 32 bit env won't work directly in 64 bit env.

for that you need to build it in x64 platform (compiler option in visual studio 2005 and later ver has the x64 compiler).

Please, visit the link http://msdn.microsoft.com/en-us/library/ms185328.aspx

John
@John : I m pretty sure that application build for 32 bit env works for 64 bit using WOW64.
Unicorn
+1  A: 

If you want your DLL to be loaded by a 64-bit process, your DLL has to be compiled for 64 bits.

If you want your DLL to be loaded by a 32-bit process, your DLL has to be compiled for 32 bits. This is true on both 64-bit Windows systems and 32-bit Windows systems.

John gave you a useful link, even though John's wording is wrong. An application (exe) which is built for 32 bits will run in 64 bit Windows, but it can only load 32-bit DLLs.

Windows programmer
Agreed, I have compiled it for 64 bit and the dllmain gets called at winlogon (Verified by putting logs). But now the problem is I am not receiving "NOLogonNotify" function (Which i get in 32 bit) at all..Any thoughts ??????
Unicorn
You're probably missing some registry entries. If a 32-bit app added registry entries then the app probably put them in a WoW6432 node, which won't even be noticed by 64-bit apps. You need to make sure they're in the correct location for ordinary 64-bit credential registrations.
Windows programmer
Well, got it working, the problem was in runtime exception with calling convention. Thanks for you help for suggesting 32 bit dll vs 64 bit dll.
Unicorn
A: 

Can you post the output of dumpbin /exports yourcredmgr.dll, and the signatures of the NP* functions you're implementing in your DLL?

Arnout
@Arnout : Signature : DWORD WINAPI NPLogonNotify (PLUID lpLogonId,LPCWSTR lpAuthentInfoType,LPVOID lpAuthentInfo,LPCWSTR lpPreviousAuthentInfoType, LPVOID lpPreviousAuthentInfo,LPWSTR lpStationName,LPVOID StationHandle,LPWSTR *lpLogonScript)exports : NPGetCaps @1 NPLogonNotify @2 NPPasswordChangeNotify @3
Unicorn
Hmm... That looks OK to me.I quickly whipped up a logging-only cred mgr and ran it on 2008 R2 (x64) -- only DllMain seems to be called. No calls to NPGetCaps, NPLogonNotify or NPPasswordChangeNotify...Will give that code a go on an x86 box tomorrow to see if that's any different (maybe I didn't implement it correctly).What does your NPGetCaps look like? Also, how did you register your cred mgr in the registry?
Arnout