Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7

GetFileInfo using FILE_SHARED_COUNT constant always returns -1

I'm having difficulty getting the shareddll reference count for a file that is installed on my machine. In the registry the reference count for this particular file is 3. When I call this function it is always returning -1. Here's how I am calling it:

NUMBER nCount, rnVal;
STRING sCount, fileToCheck;


fileToCheck = CommonFiles64Folder ^ "MyCompany\\myfile.dll";
rnVal = GetFileInfo (fileToCheck, FILE_SHARED_COUNT, nCount, sCount);

What am I doing wrong?
Labels (1)
0 Kudos
(2) Replies
Level 7

I think the function, at least as it relates to getting FILE_SHARED_COUNT, is meant for Installscript projects, not basic msi, which is the project type I'm working with. That's unfortunate.
0 Kudos
Level 13

You can always make a CA that calls a batch file. Find what you need in
HKLM\SOFTWARE\[Wow6432Node\]Microsoft\Windows\CurrentVersion\SharedDLLs YourAppHere
Or use PowerShell if you prefer that.
0 Kudos