Beispiel #1
0
        // Token: 0x060002F9 RID: 761 RVA: 0x0000D33C File Offset: 0x0000B53C
        internal static int ClusterRegCloseKey(IntPtr RegKeyHandle, string name)
        {
            int retCode = ClusApiHook.CallBackDriver(ClusApiHooks.ClusterRegCloseKey, string.Format("KeyName = {0}, Handle = {1}", name, RegKeyHandle), delegate
            {
                retCode = ClusapiMethods.ClusterRegCloseKeyInternal(RegKeyHandle);
                return(retCode);
            });

            return(retCode);
        }
Beispiel #2
0
        // Token: 0x060002FD RID: 765 RVA: 0x0000D450 File Offset: 0x0000B650
        internal static int ClusterRegBatchAddCommand([In] AmClusterBatchHandle hBatch, [In] CLUSTER_REG_COMMAND dwCommand, [MarshalAs(UnmanagedType.LPWStr)][In] string wzName, [In] RegistryValueKind dwOptions, [In] IntPtr lpData, [In] int cbData)
        {
            int retCode = ClusApiHook.CallBackDriver(ClusApiHooks.ClusterRegBatchAddCommand, string.Format("hBatch = {0} dwCommand = {1} wsName = {2}", hBatch, dwCommand, wzName), delegate
            {
                retCode = ClusapiMethods.ClusterRegBatchAddCommandInternal(hBatch, dwCommand, wzName, dwOptions, lpData, cbData);
                return(retCode);
            });

            return(retCode);
        }
Beispiel #3
0
        // Token: 0x060002FF RID: 767 RVA: 0x0000D4FC File Offset: 0x0000B6FC
        internal static int ClusterRegCloseBatch([In] IntPtr hBatch, [MarshalAs(UnmanagedType.Bool)][In] bool bCommit, [Optional] out int failedCommandNumber)
        {
            int failedCommandNumberTmp = 0;
            int retCode = ClusApiHook.CallBackDriver(ClusApiHooks.ClusterRegCloseBatch, string.Format("hBatch = {0} bCommit = {1}", hBatch, bCommit), delegate
            {
                retCode = ClusapiMethods.ClusterRegCloseBatchInternal(hBatch, bCommit, out failedCommandNumberTmp);
                return(retCode);
            });

            failedCommandNumber = failedCommandNumberTmp;
            return(retCode);
        }
Beispiel #4
0
        // Token: 0x060002FB RID: 763 RVA: 0x0000D3B4 File Offset: 0x0000B5B4
        internal static int ClusterRegCreateBatch([In] AmClusterRegkeyHandle hKey, out AmClusterBatchHandle hBatch)
        {
            AmClusterBatchHandle hBatchTmp = null;
            int retCode = ClusApiHook.CallBackDriver(ClusApiHooks.ClusterRegCreateBatch, string.Format("KeyName = {0}", hKey.Name), delegate
            {
                retCode = ClusapiMethods.ClusterRegCreateBatchInternal(hKey, out hBatchTmp);
                return(retCode);
            });

            hBatch = hBatchTmp;
            return(retCode);
        }
Beispiel #5
0
        // Token: 0x060002AD RID: 685 RVA: 0x0000CCE8 File Offset: 0x0000AEE8
        internal static bool CloseCluster([In] IntPtr hCluster)
        {
            bool isSuccess = false;

            ClusApiHook.CallBackDriver(ClusApiHooks.CloseCluster, string.Format("hCluster = {0}", hCluster), delegate
            {
                int result = 0;
                isSuccess  = ClusapiMethods.CloseClusterInternal(hCluster);
                return(result);
            });
            return(isSuccess);
        }
Beispiel #6
0
        // Token: 0x060002F3 RID: 755 RVA: 0x0000D114 File Offset: 0x0000B314
        internal static int ClusterRegQueryValue(AmClusterRegkeyHandle RegKeyHandle, string lpszValueName, out RegistryValueKind valueType, IntPtr lpbData, ref int lpcbData)
        {
            int lpcbDataTmp  = lpcbData;
            int valueTypeInt = 0;
            int retCode      = ClusApiHook.CallBackDriver(ClusApiHooks.ClusterRegQueryValue, string.Format("KeyName = {0} lpszValueName = {1}", RegKeyHandle.Name, lpszValueName), delegate
            {
                retCode = ClusapiMethods.ClusterRegQueryValueInternal(RegKeyHandle, lpszValueName, out valueTypeInt, lpbData, ref lpcbDataTmp);
                return(retCode);
            });

            valueType = (RegistryValueKind)valueTypeInt;
            lpcbData  = lpcbDataTmp;
            return(retCode);
        }
Beispiel #7
0
        // Token: 0x060002AB RID: 683 RVA: 0x0000CC70 File Offset: 0x0000AE70
        internal static AmClusterHandle OpenCluster([In] string clusterName)
        {
            AmClusterHandle handle = null;

            ClusApiHook.CallBackDriver(ClusApiHooks.OpenCluster, string.Format("clusterName = {0}", clusterName), delegate
            {
                int result = 0;
                handle     = ClusapiMethods.OpenClusterInternal(clusterName);
                if (handle == null || handle.IsInvalid)
                {
                    result = Marshal.GetLastWin32Error();
                }
                return(result);
            });
            return(handle);
        }
Beispiel #8
0
        // Token: 0x060002F7 RID: 759 RVA: 0x0000D28C File Offset: 0x0000B48C
        internal static int ClusterRegDeleteValue(AmClusterRegkeyHandle RegKeyHandle, string lpszValueName)
        {
            int num = 0;
            RegistryValueKind registryValueKind;
            int retCode = ClusapiMethods.ClusterRegQueryValue(RegKeyHandle, lpszValueName, out registryValueKind, IntPtr.Zero, ref num);

            if (retCode == 0)
            {
                retCode = ClusApiHook.CallBackDriver(ClusApiHooks.ClusterRegDeleteValue, string.Format("KeyName = {0} lpszValueName = {1}", RegKeyHandle.Name, lpszValueName), delegate
                {
                    retCode = ClusapiMethods.ClusterRegDeleteValueUnsafe(RegKeyHandle, lpszValueName);
                    return(retCode);
                });
            }
            return(retCode);
        }
Beispiel #9
0
        // Token: 0x060002F5 RID: 757 RVA: 0x0000D1D0 File Offset: 0x0000B3D0
        internal static int ClusterRegSetValue(AmClusterRegkeyHandle RegKeyHandle, string lpszValueName, RegistryValueKind dwType, IntPtr lpbData, int cbData)
        {
            string text    = "ClusterRegSetValue";
            string text2   = string.Format("KeyName = {0} lpszValueName = {1}", RegKeyHandle.Name, lpszValueName);
            int    retCode = ClusApiHook.CallBackDriver(ClusApiHooks.ClusterRegSetValue, text2, delegate
            {
                retCode = ClusapiMethods.ClusterRegSetValueInternal(RegKeyHandle, lpszValueName, dwType, lpbData, cbData);
                return(retCode);
            });

            if (retCode != 0)
            {
                ReplayCrimsonEvents.CriticalClusterApiFailed.Log <string, string, int>(text, text2, retCode);
            }
            return(retCode);
        }
Beispiel #10
0
        // Token: 0x060002EF RID: 751 RVA: 0x0000CF50 File Offset: 0x0000B150
        internal static int ClusterRegOpenKey(AmClusterRegkeyHandle RegKeyHandle, string lpszSubKey, RegSAM samDesired, out AmClusterRegkeyHandle phkResult)
        {
            AmClusterRegkeyHandle phkResultTmp = null;
            int retCode = ClusApiHook.CallBackDriver(ClusApiHooks.ClusterRegOpenKey, string.Format("RootKeyName = {0} SubKey = {1}", RegKeyHandle.Name, lpszSubKey), delegate
            {
                retCode = ClusapiMethods.ClusterRegOpenKeyInternal(RegKeyHandle, lpszSubKey, samDesired, out phkResultTmp);
                if (retCode == 0 && phkResultTmp != null)
                {
                    phkResultTmp.Name = RegKeyHandle.Name + "\\" + lpszSubKey;
                }
                return(retCode);
            });

            phkResult = phkResultTmp;
            return(retCode);
        }
Beispiel #11
0
        // Token: 0x060002A4 RID: 676 RVA: 0x0000CB9C File Offset: 0x0000AD9C
        public static int ClusterRegDeleteKey(AmClusterRegkeyHandle RegKeyHandle, string lpszSubKey)
        {
            AmClusterRegkeyHandle amClusterRegkeyHandle = null;
            int retCode = ClusapiMethods.ClusterRegOpenKey(RegKeyHandle, lpszSubKey, RegSAM.Read, out amClusterRegkeyHandle);

            if (retCode == 0)
            {
                amClusterRegkeyHandle.Dispose();
                retCode = ClusApiHook.CallBackDriver(ClusApiHooks.ClusterRegDeleteKey, string.Format("RootKey = {0} Subkey = {1}", RegKeyHandle.Name, lpszSubKey), delegate
                {
                    retCode = ClusapiMethods.ClusterRegDeleteKeyUnsafe(RegKeyHandle, lpszSubKey);
                    return(retCode);
                });
            }
            return(retCode);
        }
Beispiel #12
0
        // Token: 0x060002F1 RID: 753 RVA: 0x0000D048 File Offset: 0x0000B248
        internal static int ClusterRegCreateKey(AmClusterRegkeyHandle RegKeyHandle, string lpszSubKey, uint options, RegSAM samDesired, IntPtr securityAttributes, out AmClusterRegkeyHandle phkResult, out uint disposition)
        {
            AmClusterRegkeyHandle phkResultTmp = null;
            uint dispositionTmp = 0U;
            int  retCode        = ClusApiHook.CallBackDriver(ClusApiHooks.ClusterRegCreateKey, string.Format("RootKeyName = {0} SubKey = {1}", RegKeyHandle.Name, lpszSubKey), delegate
            {
                retCode = ClusapiMethods.ClusterRegCreateKeyInternal(RegKeyHandle, lpszSubKey, options, samDesired, securityAttributes, out phkResultTmp, out dispositionTmp);
                if (retCode == 0 && phkResultTmp != null)
                {
                    phkResultTmp.Name = RegKeyHandle.Name + "\\" + lpszSubKey;
                }
                return(retCode);
            });

            phkResult   = phkResultTmp;
            disposition = dispositionTmp;
            return(retCode);
        }
Beispiel #13
0
        // Token: 0x060002ED RID: 749 RVA: 0x0000CE80 File Offset: 0x0000B080
        internal static AmClusterRegkeyHandle GetClusterKey(AmClusterHandle clusterHandle, RegSAM samDesired)
        {
            AmClusterRegkeyHandle handle = null;

            ClusApiHook.CallBackDriver(ClusApiHooks.GetClusterKey, string.Format("clusterHandle = {0} samDesired = {1}", clusterHandle, samDesired), delegate
            {
                int result = 0;
                handle     = ClusapiMethods.GetClusterKeyInternal(clusterHandle, samDesired);
                if (handle == null || handle.IsInvalid)
                {
                    result = Marshal.GetLastWin32Error();
                }
                else
                {
                    handle.Name = "HKLM:\\Cluster";
                }
                return(result);
            });
            return(handle);
        }