PDA

View Full Version : Trusted storage license path issue



cummins
03-26-2009, 12:22 PM
I'm new to FLEXnet, evaluating its use. I am trying to prototype in getting a license from trusted storage (through VB .NET).

I have created a DLL that uses a lot of code from the ezcalc application since it uses the FLEXible API (because the VB example used the deprecated Trival interface). However, I get the license finder dialog (unless I suppress it with the LM_A_PROMPT_FOR_FILE). Whether I suppress license file dialog or not, I get error -15,570 "checkout failed: Cannot connect to the license server system"

I have run installanchorservice with the "demo" and "ezcalc" prior to executing the code and ezcalc.exe works with no issues.



stat = lc_flexinit_property_handle_create(&initHandle);

stat = lc_flexinit_property_handle_set(initHandle,
(FLEXINIT_PROPERTY_TYPE)FLEXINIT_PROPERTY_USE_TRUSTED_STORAGE,
(FLEXINIT_VALUE_TYPE)1);

stat = lc_flexinit(initHandle);


// Create a new job
if (lc_new_job(0, lc_new_job_arg2, &code, &lm_job))
{
errorInfoNum = lc_get_errno(lm_job);

lc_perror(lm_job, "Failed in license handle creation");
cleanup(initHandle);
}

// Set the license path attribute
lc_set_attr(lm_job, LM_A_LICENSE_DEFAULT, (LM_A_VAL_TYPE)szLicFileList);

// Disable the License Finder window (it currently pops up with out this)
lc_set_attr(lm_job, LM_A_PROMPT_FOR_FILE, (LM_A_VAL_TYPE) 0);

// Checkout the license for the feature/version
if(lc_checkout(lm_job, szFeatureName, szFeatureVer, 1, LM_CO_NOWAIT, &code, LM_DUP_NONE))

In the above code, I set szLicFileList="@localhost;license.dat;.", szFeatureName = "ADD", szFeatureVer = "1.0".

Any suggestions?

Joe

RobertDickau
03-26-2009, 12:32 PM
A couple of things: are there any license rights in trusted storage (does appactutil -view show anything, for example)? I assume so, since you mention ezcalc works, but just in case...

Have you "prepped" the DLL using preptool? Anything that touches or reads from trusted storage needs to be prepped; see makefile.act to see how ezcalc gets prepped, for example.

P.S. Please consult the documentation for recommendations and cautions about this kind of "proxy DLL" approach; for example, you should include some vital functionality in the DLL to make the application less susceptible to DLL spoofing...

cummins
03-26-2009, 02:24 PM
Thanks for the quick response. I missed the preptool step -- I used it and now it works. :)

cummins
03-26-2009, 02:26 PM
P.S. Please consult the documentation for recommendations and cautions about this kind of "proxy DLL" approach; for example, you should include some vital functionality in the DLL to make the application less susceptible to DLL spoofing...

I did see this documentation -- when we do a production DLL, we'll follow that advice. Thanks again.