Jump to content
Sign in to follow this  
pcjogi

dllcall with non Microsoft dll

Recommended Posts

pcjogi

Hi,

sorry for my first question, but I am not familiar with dllcalls.

How do I do a dllcall with a dll witch has the following functions. I tried something like that:

$result=DllCall ( "C:\Programme\RSA Security\RSA SecurID Software Token\stauto32.dll", "int", "OpenTokenService")

but didn´t had success. result was never a handle not zero.

Thanks

int WINAPI OpenTokenService(LPLONG pServiceHandle);

pServiceHandle

[out] Pointer to a LONG that will receive the handle of the token service started if

the function succeeds. This handle must be used in all future calls to the token

service. If another program or process is using the DLL, it will be assigned its own

handle that will allow parallel use of the token service.

int WINAPI GetPasscode(LONG lServiceHandle, LPCSTR pPin, LPSTR pPasscode,

LPSTR pNextPasscode, LPSTR pTokencode, LPSTR pNextTokencode);

Parameters

lServiceHandle

[in] Handle that identifies the instance of the token service.

pPin

[in] Pointer to a constant null-terminated string that contains the PIN to be used for

generating PASSCODEs.

pPasscode

[out] Pointer to a string that will receive the current PASSCODE of the default

token.

pNextPasscode

[out] Pointer to a string that will receive the next PASSCODE of the default token.

pTokencode

[out] Pointer to a string that will receive the current tokencode of the default token.

pNextTokencode

[out] Pointer to a string that will receive the next tokencode of the default token.

Share this post


Link to post
Share on other sites
Jon

$result=DllCall ( "C:\Programme\RSA Security\RSA SecurID Software Token\stauto32.dll", "int", "OpenTokenService", "long_ptr", 0)

$result will be an array, the return value is in $result[0] and $result[1] will contain the pServiceHandle.

Edited by Jon

Share this post


Link to post
Share on other sites
pcjogi

Thanks for your help, but I still get 0 (zero) in the variable result back.

Any sugestions?

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.