2021-11-11 11:18:46 -06:00
using System ;
using System.Collections.Generic ;
using System.Runtime.CompilerServices ;
using System.Runtime.InteropServices ;
using System.Threading ;
using Microsoft.Win32 ;
namespace Microsoft.Zune.Configuration
{
public class CConfigurationManagedBase : IDisposable
{
private string m_basePath ;
private string m_instance ;
private object m_lock ;
2021-11-18 12:01:22 -06:00
private unsafe HKEY * m_hHive ;
2021-11-11 11:18:46 -06:00
private ConfigurationChangeEventHandler m_configurationChangeEventHandler ;
private unsafe NotificationMarshaller * m_pNotificationMarshaller ;
public unsafe string ConfigurationAbsolutePath
{
get
{
//IL_0003: Expected I, but got I8
//IL_001f: Expected I, but got I8
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int configurationManagerInstance = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( configurationManagerInstance >= 0 )
{
IConfigurationManager * intPtr = ptr ;
return string . Concat ( new string (( char *)(( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , ushort *>)(*( ulong *)(*( long *) intPtr + 192 )))(( nint ) intPtr )) + "\\" , ConfigurationPath );
}
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( configurationManagerInstance ));
2021-11-11 11:18:46 -06:00
}
}
public string ConfigurationPath => (!( m_basePath == ( string ) null )) ? string . Concat ( m_basePath + "\\" , m_instance ) : m_instance ;
[SpecialName]
public unsafe event ConfigurationChangeEventHandler OnConfigurationChanged
{
add
{
try
{
Monitor . Enter ( m_lock );
if ( null == m_configurationChangeEventHandler )
{
Subscribe ( OnNativeConfigChangedCallback );
}
m_configurationChangeEventHandler = ( ConfigurationChangeEventHandler ) Delegate . Combine ( m_configurationChangeEventHandler , value );
}
finally
{
Monitor . Exit ( m_lock );
}
}
remove
{
try
{
Monitor . Enter ( m_lock );
if ( null == ( m_configurationChangeEventHandler = ( ConfigurationChangeEventHandler ) Delegate . Remove ( m_configurationChangeEventHandler , value )))
{
Unsubscribe ();
}
}
finally
{
Monitor . Exit ( m_lock );
}
}
}
public unsafe CConfigurationManagedBase ( RegistryHive hive , string basePath , string instance )
{
//IL_0016: Expected I, but got I8
//IL_0046: Expected I, but got I8
//IL_0057: Expected I, but got I8
m_basePath = basePath ;
m_instance = instance ;
m_pNotificationMarshaller = null ;
base . _002Ector ();
switch ( hive )
{
default :
throw new ArgumentException ( "hive" );
case RegistryHive . LocalMachine :
2021-11-18 12:01:22 -06:00
m_hHive = ( HKEY *) 18446744071562067970 uL ;
2021-11-11 11:18:46 -06:00
break ;
case RegistryHive . CurrentUser :
2021-11-18 12:01:22 -06:00
m_hHive = ( HKEY *) 18446744071562067969 uL ;
2021-11-11 11:18:46 -06:00
break ;
}
m_lock = new object ();
}
private void _007ECConfigurationManagedBase ()
{
_0021CConfigurationManagedBase ();
}
private unsafe void _0021CConfigurationManagedBase ()
{
//IL_0017: Expected I, but got I8
//IL_0020: Expected I, but got I8
NotificationMarshaller * pNotificationMarshaller = m_pNotificationMarshaller ;
if ( pNotificationMarshaller != null )
{
(( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , uint >)(*( ulong *)(*( long *) pNotificationMarshaller + 16 )))(( nint ) pNotificationMarshaller );
m_pNotificationMarshaller = null ;
}
}
[return: MarshalAs(UnmanagedType.U1)]
public unsafe bool GetBoolProperty ( string propertyName , [ MarshalAs ( UnmanagedType . U1 )] bool defaultValue )
{
//IL_0028: Expected I, but got I8
//IL_0051: Expected I, but got I8
int num = 0 ;
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num2 = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num2 >= 0 )
{
long num3 = *( long *) ptr + 8 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num2 = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, int *, int , int >)(*( ulong *) num3 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , & num , defaultValue ? 1 : 0 );
2021-11-11 11:18:46 -06:00
if ( num2 >= 0 )
{
return ( num != 0 ) ? true : false ;
}
}
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num2 ));
2021-11-11 11:18:46 -06:00
}
}
}
}
public unsafe void SetBoolProperty ( string propertyName , [ MarshalAs ( UnmanagedType . U1 )] bool value )
{
//IL_0024: Expected I, but got I8
//IL_004b: Expected I, but got I8
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0050 ;
}
long num2 = *( long *) ptr + 16 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, int , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , value ? 1 : 0 );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0050 ;
}
goto end_IL_0023 ;
IL_0050 :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_0023 :;
}
}
}
}
public unsafe int GetIntProperty ( string propertyName , int defaultValue )
{
//IL_0027: Expected I, but got I8
//IL_0050: Expected I, but got I8
int result = 0 ;
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
long num2 = *( long *) ptr + 32 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, int *, int , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , & result , defaultValue );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
return result ;
}
}
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
}
}
}
}
public unsafe void SetIntProperty ( string propertyName , int value )
{
//IL_0024: Expected I, but got I8
//IL_004b: Expected I, but got I8
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0050 ;
}
long num2 = *( long *) ptr + 40 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, int , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , value );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0050 ;
}
goto end_IL_0023 ;
IL_0050 :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_0023 :;
}
}
}
}
public unsafe long GetInt64Property ( string propertyName , long defaultValue )
{
//IL_0028: Expected I, but got I8
//IL_0051: Expected I, but got I8
long result = 0L ;
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
long num2 = *( long *) ptr + 56 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, long *, long , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , & result , defaultValue );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
return result ;
}
}
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
}
}
}
}
public unsafe void SetInt64Property ( string propertyName , long value )
{
//IL_0024: Expected I, but got I8
//IL_004b: Expected I, but got I8
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0050 ;
}
long num2 = *( long *) ptr + 64 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, long , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , value );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0050 ;
}
goto end_IL_0023 ;
IL_0050 :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_0023 :;
}
}
}
}
public unsafe double GetDoubleProperty ( string propertyName , double defaultValue )
{
//IL_002f: Expected I, but got I8
//IL_0058: Expected I, but got I8
double result = 0.0 ;
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
long num2 = *( long *) ptr + 80 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, double *, double , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , & result , defaultValue );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
return result ;
}
}
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
}
}
}
}
public unsafe void SetDoubleProperty ( string propertyName , double value )
{
//IL_0024: Expected I, but got I8
//IL_004b: Expected I, but got I8
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0050 ;
}
long num2 = *( long *) ptr + 88 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, double , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , value );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0050 ;
}
goto end_IL_0023 ;
IL_0050 :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_0023 :;
}
}
}
}
public unsafe DateTime GetDateTimeProperty ( string propertyName , DateTime defaultValue )
{
//IL_0018: Expected I4, but got I8
//IL_0047: Expected I, but got I8
//IL_0072: Expected I, but got I8
DateTime dateTime = default ( DateTime );
_FILETIME fILETIME ;
*( int *)(& fILETIME ) = 0 ;
2021-11-18 12:01:22 -06:00
// IL initblk instruction
Unsafe . InitBlockUnaligned ( ref Unsafe . AddByteOffset ( ref fILETIME , 4 ), 0 , 4 );
2021-11-11 11:18:46 -06:00
_FILETIME fILETIME2 ;
*( long *)(& fILETIME2 ) = defaultValue . ToFileTimeUtc ();
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
long num2 = *( long *) ptr + 104 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
2021-11-11 11:18:46 -06:00
_003F val = ptr2 ;
_003F val2 = ptr3 ;
_003F val3 = ptr4 ;
_FILETIME fILETIME3 = fILETIME2 ;
2021-11-18 12:01:22 -06:00
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, _FILETIME *, _FILETIME , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ( ushort *)( nint ) val , ( ushort *)( nint ) val2 , ( ushort *)( nint ) val3 , & fILETIME , fILETIME3 );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
return DateTime . FromFileTimeUtc (*( long *)(& fILETIME ));
}
}
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
}
}
}
}
public unsafe void SetDateTimeProperty ( string propertyName , DateTime value )
{
//IL_002e: Expected I, but got I8
//IL_0056: Expected I, but got I8
_FILETIME fILETIME ;
*( long *)(& fILETIME ) = value . ToFileTimeUtc ();
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_005b ;
}
long num2 = *( long *) ptr + 112 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
2021-11-11 11:18:46 -06:00
_003F val = ptr2 ;
_003F val2 = ptr3 ;
_003F val3 = ptr4 ;
_FILETIME fILETIME2 = fILETIME ;
2021-11-18 12:01:22 -06:00
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, _FILETIME , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ( ushort *)( nint ) val , ( ushort *)( nint ) val2 , ( ushort *)( nint ) val3 , fILETIME2 );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_005b ;
}
goto end_IL_002d ;
IL_005b :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_002d :;
}
}
}
}
public unsafe string GetStringProperty ( string propertyName , string defaultValue )
{
//IL_002f: Expected I, but got I8
//IL_0066: Expected I, but got I8
//IL_0066: Expected I, but got I8
//IL_00ad: Expected I, but got I8
string result = null ;
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
fixed ( char * defaultValuePtr = defaultValue . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr5 = ( ushort *) defaultValuePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
uint num2 = 0 u ;
if ( num >= 0 )
{
long num3 = *( long *) ptr + 128 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, ushort *, uint *, ushort *, int >)(*( ulong *) num3 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , null , & num2 , ptr5 );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
2021-11-18 12:01:22 -06:00
ushort * ptr6 = ( ushort *) Module . new_005B_005D (( ulong ) num2 * 2 uL );
2021-11-11 11:18:46 -06:00
num = ((( long )( nint ) ptr6 == 0 ) ? (- 2147024882 ) : num );
if ( num >= 0 )
{
long num4 = *( long *) ptr + 128 ;
IConfigurationManager * intPtr2 = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive2 = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, ushort *, uint *, ushort *, int >)(*( ulong *) num4 ))(( nint ) intPtr2 , hHive2 , ptr2 , ptr3 , ptr4 , ptr6 , & num2 , ptr5 );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
result = new string (( char *) ptr6 );
}
}
if ( ptr6 != null )
{
2021-11-18 12:01:22 -06:00
Module . delete_005B_005D ( ptr6 );
2021-11-11 11:18:46 -06:00
}
if ( num >= 0 )
{
return result ;
}
}
}
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
}
}
}
}
}
public unsafe void SetStringProperty ( string propertyName , string value )
{
//IL_002c: Expected I, but got I8
//IL_0057: Expected I, but got I8
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
fixed ( char * valuePtr = value . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr5 = ( ushort *) valuePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_005c ;
}
long num2 = *( long *) ptr + 136 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, ushort *, int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , ptr5 );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_005c ;
}
goto end_IL_002b ;
IL_005c :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_002b :;
}
}
}
}
}
public unsafe IList < string > GetStringListProperty ( string propertyName )
{
//IL_0028: Expected I, but got I8
//IL_0033: Expected I, but got I8
//IL_0061: Expected I, but got I8
//IL_0061: Expected I, but got I8
//IL_00aa: Expected I, but got I8
//IL_00dc: Expected I, but got I8
List < string > list = null ;
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr5 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
ushort * ptr2 = null ;
uint num2 = 0 u ;
if ( num >= 0 )
{
long num3 = *( long *) ptr + 144 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, ushort *, uint *, int >)(*( ulong *) num3 ))(( nint ) intPtr , hHive , ptr3 , ptr4 , ptr5 , null , & num2 );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
2021-11-18 12:01:22 -06:00
ptr2 = ( ushort *) Module . new_005B_005D (( ulong ) num2 * 2 uL );
2021-11-11 11:18:46 -06:00
num = ((( long )( nint ) ptr2 == 0 ) ? (- 2147024882 ) : num );
if ( num >= 0 )
{
long num4 = *( long *) ptr + 144 ;
IConfigurationManager * intPtr2 = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive2 = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, ushort *, uint *, int >)(*( ulong *) num4 ))(( nint ) intPtr2 , hHive2 , ptr3 , ptr4 , ptr5 , ptr2 , & num2 );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
list = new List < string >();
ushort * ptr6 = ptr2 ;
if (* ptr2 != 0 )
{
do
{
string item = new string (( char *) ptr6 );
list . Add ( item );
2021-11-18 12:01:22 -06:00
ptr6 = ( ushort *)(( long )( Module . lstrlenW ( ptr6 ) + 1 ) * 2L + ( nint ) ptr6 );
2021-11-11 11:18:46 -06:00
}
while (* ptr6 != 0 );
}
goto IL_00ef ;
}
}
}
}
if ( num == - 2147024894 )
{
num = 0 ;
list = null ;
}
goto IL_00ef ;
IL_00ef :
if ( ptr2 != null )
{
2021-11-18 12:01:22 -06:00
Module . delete_005B_005D ( ptr2 );
2021-11-11 11:18:46 -06:00
}
if ( num < 0 )
{
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
}
return list ;
}
}
}
}
public unsafe void SetStringListProperty ( string propertyName , IList < string > value )
{
//IL_0026: Expected I, but got I8
//IL_008f: Expected I4, but got I8
//IL_00e1: Expected I, but got I8
//IL_0133: Expected I, but got I8
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr5 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr6 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
uint num2 = 0 u ;
if ( num < 0 )
{
goto IL_0141 ;
}
int num3 = 0 ;
if ( 0 < value . Count )
{
do
{
num2 += ( uint )( value [ num3 ]. Length + 1 );
num3 ++;
}
while ( num3 < value . Count );
}
num2 ++;
ulong num4 = ( ulong ) num2 * 2 uL ;
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) Module . new_005B_005D ( num4 );
2021-11-11 11:18:46 -06:00
if ( ptr2 == null )
{
num = - 2147024882 ;
}
else
{
2021-11-18 12:01:22 -06:00
// IL initblk instruction
Unsafe . InitBlockUnaligned ( ptr2 , 0 , num4 );
2021-11-11 11:18:46 -06:00
ushort * ptr3 = ptr2 ;
int num5 = 0 ;
if ( 0 < value . Count )
{
do
{
int length = value [ num5 ]. Length ;
2021-11-18 12:01:22 -06:00
fixed ( char * value [ num5 ] Ptr = value [ num5 ]. ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * s = ( ushort *) value [ num5 ] Ptr ;
2021-11-11 11:18:46 -06:00
try
{
2021-11-18 12:01:22 -06:00
if ( Module . wmemcpy_s ( ptr3 , num2 , s , ( ulong ) length ) == 0 )
2021-11-11 11:18:46 -06:00
{
num2 += ( uint )(- 1 - length );
ptr3 = ( ushort *)(( long ) length * 2L + ( nint ) ptr3 + 2 );
goto IL_00ee ;
}
}
catch
{
//try-fault
s = null ;
throw ;
}
try
{
num = - 2147418113 ;
}
catch
{
//try-fault
s = null ;
throw ;
}
}
break ;
IL_00ee :
num5 ++;
}
while ( num5 < value . Count );
}
if ( num >= 0 )
{
long num6 = *( long *) ptr + 152 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, ushort *, int >)(*( ulong *) num6 ))(( nint ) intPtr , hHive , ptr4 , ptr5 , ptr6 , ptr2 );
2021-11-11 11:18:46 -06:00
}
}
if ( ptr2 != null )
{
2021-11-18 12:01:22 -06:00
Module . delete_005B_005D ( ptr2 );
2021-11-11 11:18:46 -06:00
}
if ( num < 0 )
{
goto IL_0141 ;
}
goto end_IL_0024 ;
IL_0141 :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_0024 :;
}
}
}
}
public unsafe byte [] GetBinaryProperty ( string propertyName )
{
//IL_0025: Expected I, but got I8
//IL_0058: Expected I, but got I8
//IL_0058: Expected I, but got I8
//IL_0090: Expected I, but got I8
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
IConfigurationManager * ptr = null ;
2021-11-18 12:01:22 -06:00
int num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
uint num2 = 0 u ;
if ( num >= 0 )
{
long num3 = *( long *) ptr + 160 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, byte *, uint *, int >)(*( ulong *) num3 ))(( nint ) intPtr , hHive , ptr2 , ptr3 , ptr4 , null , & num2 );
2021-11-11 11:18:46 -06:00
if ( num >= 0 )
{
byte [] array = new byte [ num2 ];
fixed ( byte * ptr5 = & array [ 0 ])
{
try
{
long num4 = *( long *) ptr + 160 ;
IConfigurationManager * intPtr2 = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive2 = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, byte *, uint *, int >)(*( ulong *) num4 ))(( nint ) intPtr2 , hHive2 , ptr2 , ptr3 , ptr4 , ptr5 , & num2 );
2021-11-11 11:18:46 -06:00
}
catch
{
//try-fault
ptr5 = null ;
throw ;
}
}
if ( num >= 0 )
{
return array ;
}
}
}
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
}
}
}
}
public unsafe void SetBinaryProperty ( string propertyName , byte [] value )
{
//IL_0034: Expected I, but got I8
//IL_0061: Expected I, but got I8
//The blocks IL_0031, IL_0040, IL_0066 are reachable both inside and outside the pinned region starting at IL_0030. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement.
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
fixed ( char * propertyNamePtr = propertyName . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) propertyNamePtr ;
2021-11-11 11:18:46 -06:00
/*pinned*/ ref byte reference = ref *( byte *) null ;
IConfigurationManager * ptr ;
IConfigurationManager * intPtr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive ;
2021-11-11 11:18:46 -06:00
_003F val ;
_003F val2 ;
_003F val3 ;
ref byte val4 ;
IntPtr intPtr2 ;
int num ;
if ( value . Length != 0 )
{
fixed ( byte * ptr5 = & value [ 0 ])
{
ptr = null ;
2021-11-18 12:01:22 -06:00
num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0066 ;
}
long num2 = *( long *) ptr + 168 ;
intPtr = ptr ;
hHive = m_hHive ;
val = ptr2 ;
val2 = ptr3 ;
val3 = ptr4 ;
val4 = ptr5 ;
intPtr2 = ( nint ) value . LongLength ;
2021-11-18 12:01:22 -06:00
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, byte *, uint , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ( ushort *)( nint ) val , ( ushort *)( nint ) val2 , ( ushort *)( nint ) val3 , ( byte *)( nint ) val4 , ( uint )( nint ) intPtr2 );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0066 ;
}
goto end_IL_0031 ;
IL_0066 :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_0031 :;
}
}
else
{
ptr = null ;
2021-11-18 12:01:22 -06:00
num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0066_2 ;
}
long num2 = *( long *) ptr + 168 ;
intPtr = ptr ;
hHive = m_hHive ;
val = ptr2 ;
val2 = ptr3 ;
val3 = ptr4 ;
val4 = ref reference ;
intPtr2 = ( nint ) value . LongLength ;
2021-11-18 12:01:22 -06:00
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, ushort *, byte *, uint , int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ( ushort *)( nint ) val , ( ushort *)( nint ) val2 , ( ushort *)( nint ) val3 , ( byte *) Unsafe . AsPointer ( ref val4 ), ( uint )( nint ) intPtr2 );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0066_2 ;
}
}
goto end_IL_0024 ;
IL_0066_2 :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_0024 :;
}
}
}
}
[SpecialName]
public void raise_OnConfigurationChanged ( object sender , ConfigurationChangeEventArgs args )
{
ConfigurationChangeEventHandler configurationChangeEventHandler = m_configurationChangeEventHandler ;
if ( configurationChangeEventHandler != null )
{
configurationChangeEventHandler ( sender , args );
}
}
private unsafe void OnNativeConfigChangedCallback ( ushort * pwszPropertyName )
{
string propertyName = new string (( char *) pwszPropertyName );
raise_OnConfigurationChanged ( this , new ConfigurationChangeEventArgs ( propertyName ));
}
private unsafe void Subscribe ( NativeConfigurationChangeEventHandler handler )
{
//IL_0005: Expected I, but got I8
//IL_0065: Expected I, but got I8
//IL_00a6: Expected I, but got I8
int num = 0 ;
IConfigurationManager * ptr = null ;
if ( m_pNotificationMarshaller != null )
{
2021-11-18 12:01:22 -06:00
Module . _ZuneShipAssert ( 1004 u , 1181 u );
2021-11-11 11:18:46 -06:00
num = - 2147418113 ;
}
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr4 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr5 = ( ushort *) m_instancePtr ;
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_00ab ;
}
2021-11-18 12:01:22 -06:00
num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_00ab ;
}
2021-11-18 12:01:22 -06:00
NotificationMarshaller * ptr2 = ( NotificationMarshaller *) Module . @new ( 24 uL );
2021-11-11 11:18:46 -06:00
NotificationMarshaller * ptr3 ;
try
{
2021-11-18 12:01:22 -06:00
ptr3 = (( ptr2 == null ) ? null : Module . Microsoft_002EZune_002EConfiguration_002ENotificationMarshaller_002E_007Bctor_007D ( ptr2 , handler ));
2021-11-11 11:18:46 -06:00
}
catch
{
//try-fault
2021-11-18 12:01:22 -06:00
Module . delete ( ptr2 );
2021-11-11 11:18:46 -06:00
throw ;
}
m_pNotificationMarshaller = ptr3 ;
num = ((( long )( nint ) ptr3 == 0 ) ? (- 2147024882 ) : num );
if ( num < 0 )
{
goto IL_00ab ;
}
long num2 = *( long *) ptr + 176 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, INotifySubscriber *, int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ptr4 , ptr5 , ( INotifySubscriber *) ptr3 );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_00ab ;
}
goto end_IL_003e ;
IL_00ab :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_003e :;
}
}
}
private unsafe void Unsubscribe ()
{
//IL_0005: Expected I, but got I8
//IL_0064: Expected I, but got I8
//IL_008c: Expected I, but got I8
//IL_0095: Expected I, but got I8
int num = 0 ;
IConfigurationManager * ptr = null ;
num = ((( long )( nint ) m_pNotificationMarshaller == 0 ) ? (- 2147418113 ) : num );
2021-11-18 12:01:22 -06:00
fixed ( char * m_basePathPtr = m_basePath . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr2 = ( ushort *) m_basePathPtr ;
fixed ( char * m_instancePtr = m_instance . ToCharArray ())
2021-11-11 11:18:46 -06:00
{
2021-11-18 12:01:22 -06:00
ushort * ptr3 = ( ushort *) m_instancePtr ;
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0069 ;
}
2021-11-18 12:01:22 -06:00
num = Module . GetConfigurationManagerInstance (& ptr );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0069 ;
}
long num2 = *( long *) ptr + 184 ;
IConfigurationManager * intPtr = ptr ;
2021-11-18 12:01:22 -06:00
HKEY * hHive = m_hHive ;
2021-11-11 11:18:46 -06:00
_003F val = ptr2 ;
_003F val2 = ptr3 ;
NotificationMarshaller * pNotificationMarshaller = m_pNotificationMarshaller ;
2021-11-18 12:01:22 -06:00
num = (( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , HKEY *, ushort *, ushort *, INotifySubscriber *, int >)(*( ulong *) num2 ))(( nint ) intPtr , hHive , ( ushort *)( nint ) val , ( ushort *)( nint ) val2 , ( INotifySubscriber *) pNotificationMarshaller );
2021-11-11 11:18:46 -06:00
if ( num < 0 )
{
goto IL_0069 ;
}
NotificationMarshaller * pNotificationMarshaller2 = m_pNotificationMarshaller ;
if ( pNotificationMarshaller2 != null )
{
(( delegate * unmanaged [ Cdecl , Cdecl ]< IntPtr , uint >)(*( ulong *)(*( long *) pNotificationMarshaller2 + 16 )))(( nint ) pNotificationMarshaller2 );
m_pNotificationMarshaller = null ;
}
goto end_IL_0034 ;
IL_0069 :
2021-11-18 12:01:22 -06:00
throw new ApplicationException ( Module . GetErrorDescription ( num ));
2021-11-11 11:18:46 -06:00
end_IL_0034 :;
}
}
}
protected virtual void Dispose ([ MarshalAs ( UnmanagedType . U1 )] bool P_0 )
{
if ( P_0 )
{
_0021CConfigurationManagedBase ();
return ;
}
try
{
_0021CConfigurationManagedBase ();
}
finally
{
base . Finalize ();
}
}
public sealed override void Dispose ()
{
Dispose ( true );
GC . SuppressFinalize ( this );
}
~ CConfigurationManagedBase ()
{
Dispose ( false );
}
}
}