cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
vigorvick
Level 4

Invalid handle from MsiGetProperty fn

Hi,

I'm invoking a dll using my installscript from a inscript execution "Immediate" custom action.

The following code inside the dll gives an error as ERROR_INVALID_HANDLE:

MsiGetPropertyA(hInstall, g_Prop[eProp].pPropname, &g_PropBuffer[nLenUsed], &nLenUsedorFree);

I found this out by debugging the code, any help or suggestion would be highly appreciated.

Thanks.
Labels (1)
0 Kudos

(3) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The MsiGetProperty function should be used instead of MsiGetPropertyA. The handle passed to a script custom action is not directly passed to MsiGetPropertyA by the InstallScript engine.
0 Kudos
vigorvick
Level 4

I had tried using Msigetproperty also with the same result. Is there any way I can find out the exact cause of the invalid handle error using some return code?
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Where is the hInstall variable declared? Is it the parameter passed to your script custom action function? Can you reproduce this behavior in a sample project?
0 Kudos