Beispiel #1
0
        private static void SetPermissionsForAppId(string appId)
        {
            string subkey = "AppID\\" + appId;

            using (RegistryKey registryKey = Registry.ClassesRoot.CreateSubKey(subkey))
            {
                byte[] binaryDescriptor = OleConverterRegistry.GetBinaryDescriptor("O:BAG:BAD:(A;;CCDC;;;BA)(A;;CCDC;;;SY)(A;;CCDC;;;NS)(A;;CCDC;;;LS)(A;;CCDC;;;IU)");
                registryKey.SetValue("AccessPermission", binaryDescriptor);
                byte[] binaryDescriptor2 = OleConverterRegistry.GetBinaryDescriptor("O:BAG:BAD:(A;;CCDCSW;;;BA)(A;;CCDCSW;;;SY)(A;;CCDCSW;;;NS)(A;;CCDCSW;;;LS)(A;;CCDCSW;;;IU)");
                registryKey.SetValue("LaunchPermission", binaryDescriptor2);
            }
        }
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter();
     try
     {
         OleConverterRegistry.UnregisterOleConverter();
     }
     catch (Win32Exception e)
     {
         base.WriteError(new TaskWin32Exception(e), ErrorCategory.WriteError, null);
     }
     catch (SecurityException exception)
     {
         base.WriteError(exception, ErrorCategory.WriteError, null);
     }
     TaskLogger.LogExit();
 }
Beispiel #3
0
 public static void UnregisterOleConverter()
 {
     ComRunAsPwdUtil.SetRunAsPassword("{131473D0-EC52-4001-A295-E2DD73A7B115}", null);
     OleConverterRegistry.RemovePermissionsForAppId("{13147291-05DE-4577-B1AF-E0BB444B3B27}");
     OleConverterRegistry.RemovePermissionsForAppId("{131473D0-EC52-4001-A295-E2DD73A7B115}");
 }
Beispiel #4
0
 public static void RegisterOleConverter()
 {
     OleConverterRegistry.SetPermissionsForAppId("{13147291-05DE-4577-B1AF-E0BB444B3B27}");
     OleConverterRegistry.SetPermissionsForAppId("{131473D0-EC52-4001-A295-E2DD73A7B115}");
     ComRunAsPwdUtil.SetRunAsPassword("{131473D0-EC52-4001-A295-E2DD73A7B115}", string.Empty);
 }