Example #1
0
/*
* MainWindowOnRefresh
*
* Purpose:
*
* Main Window Refresh handler.
*
*/
VOID MainWindowOnRefresh(
	_In_ HWND hwnd
	)
{
	LPWSTR	CurrentObject;
	SIZE_T	len;

	UNREFERENCED_PARAMETER(hwnd);

	supSetWaitCursor(TRUE);

	if (g_kdctx.hDevice != NULL) {
		ObListDestroy(&g_kdctx.ObjectList);
		if (g_kdctx.hThreadWorker) {
			WaitForSingleObject(g_kdctx.hThreadWorker, INFINITE);
			CloseHandle(g_kdctx.hThreadWorker);
			g_kdctx.hThreadWorker = NULL;
		}

		//query object list info
		g_kdctx.hThreadWorker = CreateThread(NULL, 0,
			kdQueryProc,
			&g_kdctx, 0, NULL);
	}

	supFreeSCMSnapshot(g_enumParams.scmSnapshot);
	sapiFreeSnapshot(g_enumParams.sapiDB);
	RtlSecureZeroMemory(&g_enumParams, sizeof(g_enumParams));
	g_enumParams.scmSnapshot = supCreateSCMSnapshot(&g_enumParams.scmNumberOfEntries);
	g_enumParams.sapiDB = sapiCreateSetupDBSnapshot();
	g_enumParams.lpSubDirName = CurrentObjectPath;

	len = _strlen(CurrentObjectPath);
	CurrentObject = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len + 1)*sizeof(WCHAR));
	if (CurrentObject)
		_strcpy(CurrentObject, CurrentObjectPath);

	TreeView_DeleteAllItems(ObjectTree);
	ListObjectDirectoryTree(L"\\", NULL, NULL);
	TreeView_SelectItem(ObjectTree, TreeView_GetRoot(ObjectTree));

	if (CurrentObject) {
		ListToObject(CurrentObject);
		HeapFree(GetProcessHeap(), 0, CurrentObject);
	}

	supSetWaitCursor(FALSE);
}
Example #2
0
/*
* MainWindowOnRefresh
*
* Purpose:
*
* Main Window Refresh handler.
*
*/
VOID MainWindowOnRefresh(
    _In_ HWND hwnd
)
{
    LPWSTR  CurrentPath = NULL;
    SIZE_T  len;

    UNREFERENCED_PARAMETER(hwnd);

    supSetWaitCursor(TRUE);

    if (g_kdctx.hDevice != NULL) {
        ObListDestroy(&g_kdctx.ObjectList);
        if (g_kdctx.hThreadWorker) {
            WaitForSingleObject(g_kdctx.hThreadWorker, INFINITE);
            CloseHandle(g_kdctx.hThreadWorker);
            g_kdctx.hThreadWorker = NULL;
        }

        //query object list info
        g_kdctx.hThreadWorker = CreateThread(NULL, 0,
            kdQueryProc,
            &g_kdctx, 0, NULL);
    }

    supFreeSCMSnapshot();
    sapiFreeSnapshot();

    supCreateSCMSnapshot();
    sapiCreateSetupDBSnapshot();

    len = _strlen(g_WinObj.CurrentObjectPath);
    CurrentPath = supHeapAlloc((len + 1) * sizeof(WCHAR));
    if (CurrentPath)
        _strcpy(CurrentPath, g_WinObj.CurrentObjectPath);

    TreeView_DeleteAllItems(g_hwndObjectTree);
    ListObjectDirectoryTree(L"\\", NULL, NULL);
    TreeView_SelectItem(g_hwndObjectTree, TreeView_GetRoot(g_hwndObjectTree));

    if (CurrentPath) {
        ListToObject(CurrentPath);
        supHeapFree(CurrentPath);
    }

    supSetWaitCursor(FALSE);
}
Example #3
0
/*
* supInit
*
* Purpose:
*
* Initializes support subset related resources including kldbg subset.
*
* Must be called once during program startup
*
*/
VOID supInit(
	BOOL IsFullAdmin
	)
{
	RtlSecureZeroMemory(&g_enumParams, sizeof(g_enumParams));

	supQueryKnownDlls();
	kdInit(IsFullAdmin);

	if (IsFullAdmin != FALSE) {
		g_enumParams.scmSnapshot = supCreateSCMSnapshot(&g_enumParams.scmNumberOfEntries);
	}

	g_enumParams.sapiDB = sapiCreateSetupDBSnapshot();

	g_pObjectTypesInfo = supGetObjectTypesInfo();
}