2020-09-30 17:12:29 +02:00

122 lines
2.1 KiB
C
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright (c) 1991 Microsoft Corporation
Module Name:
Init.c
Abstract:
This module contains the entry point for the Win32 Registry APIs
client side DLL.
Author:
David J. Gilman (davegi) 06-Feb-1992
--*/
#include <rpc.h>
#include "regrpc.h"
#include "client.h"
#if DBG
BOOLEAN BreakPointOnEntry = FALSE;
#endif
BOOL LocalInitializeRegCreateKey();
BOOL LocalCleanupRegCreateKey();
BOOL InitializePredefinedHandlesTable();
BOOL CleanupPredefinedHandlesTable();
BOOL
RegInitialize (
IN HANDLE Handle,
IN DWORD Reason,
IN PVOID Reserved
)
/*++
Routine Description:
Returns TRUE.
Arguments:
Handle - Unused.
Reason - Unused.
Reserved - Unused.
Return Value:
BOOL - Returns TRUE.
--*/
{
UNREFERENCED_PARAMETER( Handle );
switch( Reason ) {
case DLL_PROCESS_ATTACH:
#ifndef REMOTE_NOTIFICATION_DISABLED
if( !InitializeRegNotifyChangeKeyValue( ) ||
!LocalInitializeRegCreateKey() ||
!InitializePredefinedHandlesTable()) {
return( FALSE );
}
#else
if( !LocalInitializeRegCreateKey() ||
!InitializePredefinedHandlesTable() ) {
return( FALSE );
}
#endif
return( TRUE );
break;
case DLL_PROCESS_DETACH:
// Reserved == NULL when this is called via FreeLibrary,
// we need to cleanup Performance keys.
// Reserved != NULL when this is called during process exits,
// no need to do anything.
if( Reserved == NULL &&
!CleanupPredefinedHandles()) {
return( FALSE );
}
#ifndef REMOTE_NOTIFICATION_DISABLED
if( !CleanupRegNotifyChangeKeyValue( ) ||
!LocalCleanupRegCreateKey() ||
!CleanupPredefinedHandlesTable()) {
return( FALSE );
}
#else
if( !LocalCleanupRegCreateKey() ||
!CleanupPredefinedHandlesTable()) {
return( FALSE );
}
#endif
return( TRUE );
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}