Skip to content

Commit fa3458e

Browse files
committed
Let Get-PhpExtensionDetail return the absolute path of DLLs
1 parent faf275a commit fa3458e

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
20.9 KB
Binary file not shown.
22.7 KB
Binary file not shown.

src/Inspect-PhpExtension.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,14 @@ void parseDll(HMODULE hModule, extensionInfo* extensionInfo)
142142

143143
void parseFile(LPCSTR filename, LPCSTR architecture)
144144
{
145-
HMODULE hModule = LoadLibraryEx(filename, NULL, DONT_RESOLVE_DLL_REFERENCES);
145+
DWORD rc;
146+
TCHAR fullpath[MAX_PATH];
147+
rc = GetFullPathName(filename, MAX_PATH, fullpath, NULL);
148+
if (rc == 0 || rc > MAX_PATH) {
149+
printf("Unable to determine the absolute path of the file %s\n", filename);
150+
return;
151+
}
152+
HMODULE hModule = LoadLibraryEx(fullpath, NULL, DONT_RESOLVE_DLL_REFERENCES);
146153
if (hModule == NULL) {
147154
printf("Unable to open the DLL.\n");
148155
} else {
@@ -162,7 +169,7 @@ void parseFile(LPCSTR filename, LPCSTR architecture)
162169
extensionInfo.type,
163170
extensionInfo.name == NULL ? "" : extensionInfo.name,
164171
extensionInfo.version == NULL ? "" : extensionInfo.version,
165-
filename
172+
fullpath
166173
);
167174
}
168175
FreeLibrary(hModule);

0 commit comments

Comments
 (0)