Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
Restore the ability to use full package names.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetopia committed Apr 2, 2024
1 parent 400a0b8 commit 8ca9ba5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions WinMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ int WinMainCRTStartup()
{
INT NumArgs = 0;
LPWSTR *ArgvW = CommandLineToArgvW(GetCommandLineW(), &NumArgs);
HANDLE hHeap = GetProcessHeap();

CoInitialize(NULL);
IPackageDebugSettings *pPackageDebugSettings = NULL;
Expand All @@ -20,12 +19,14 @@ int WinMainCRTStartup()
UINT32 count = 0, bufferLength = 0;
PCWSTR packageFamilyName = ArgvW[nArg];

pPackageDebugSettings->lpVtbl->EnableDebugging(pPackageDebugSettings, packageFamilyName, NULL, NULL);

if (GetPackagesByPackageFamily(packageFamilyName, &count, NULL, &bufferLength, NULL) !=
ERROR_INSUFFICIENT_BUFFER)
continue;

PWSTR *packageFullNames = HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(PWSTR) * count),
buffer = HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(WCHAR) * bufferLength);
PWSTR *packageFullNames = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PWSTR) * count),
buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WCHAR) * bufferLength);

if (!GetPackagesByPackageFamily(packageFamilyName, &count, packageFullNames, &bufferLength, buffer))
for (UINT32 nIndex = 0; nIndex < count; nIndex++)
Expand Down

0 comments on commit 8ca9ba5

Please sign in to comment.