2vision2
2vision2

Reputation: 5023

call multiple functions from same dll

This could be a simple one.. I searched for an answer in SO and couldnt find what am looking for and thats why I posted a question here. Following are my doubts,

I'm developing an application where I'm using Windows default dlls. I'm using multiple functions from the same loaded dll. For example:

HINSTANCE hinstLib;
hinstLib = LoadLibrary( "Crypt32.dll" );

And later use the below code to export the function:

CertOpenStore = (fptr1)GetProcAddress(hinstLib, "CertOpenStore");

Now I want to use another function from the same dll. How would I do as above in cases like this:

CertAddEncodedCertificateToStore(CertOpenSystemStore(0,"TrustedPublisher"),PKCS_7_ASN_ENCODING |X509_ASN_ENCODING,pbEncodedCert,dwSize,CERT_STORE_ADD_REPLACE_EXISTING,NULL);

where both CertAddEncodedCertificateToStore and CertOpenSystemStore belong to same dll?

Upvotes: 0

Views: 1015

Answers (1)

RedX
RedX

Reputation: 15175

Just as you did before but for a different function name:

fptr1 OtherFunc = GetProcAddress(hinstLib, "OtherFunc");

Upvotes: 5

Related Questions