fn create_key(&self) -> Result<winreg::RegKey, ImageGlobalFlagsError> {
        use winreg::enums::HKEY_LOCAL_MACHINE;
        use winreg::RegKey;

        let key_name = {
            let mut name = String::from(
                r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\",
            );
            name.push_str(&self.image.name);
            name
        };

        let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
        let (key, _key_disposition) =
            hklm.create_subkey(&key_name)
                .map_err(|source| ImageGlobalFlagsError::CreateKey {
                    source,
                    image: self.image.clone(),
                })?;

        Ok(key)
    }
/// Create a registry key to set global flags for the image file.
Create a registry key to set global flags for the image file.
Create a registry key to set global flags for the image file .
fn create_key(&self) -> Result<winreg::RegKey, ImageGlobalFlagsError> {
        use winreg::enums::HKEY_LOCAL_MACHINE;
        use winreg::RegKey;
        let key_name = {
            let mut name = String::from(
                r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\",
            );
            name.push_str(&self.image.name);
            name
        };
        let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
        let (key, _key_disposition) =
            hklm.create_subkey(&key_name)
                .map_err(|source| ImageGlobalFlagsError::CreateKey {
                    source,
                    image: self.image.clone(),
                })?;
        Ok(key)
    }
fn create_key ( & self ) -> Result < winreg :: RegKey , ImageGlobalFlagsError > { use winreg :: enums :: HKEY_LOCAL_MACHINE ; use winreg :: RegKey ; let key_name = { let mut name = String :: from ( r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\" , ) ; name . push_str ( & self . image . name ) ; name } ; let hklm = RegKey :: predef ( HKEY_LOCAL_MACHINE ) ; let ( key , _key_disposition ) = hklm . create_subkey ( & key_name ) . map_err ( | source | ImageGlobalFlagsError :: CreateKey { source , image : self . image . clone ( ) , } ) ? ; Ok ( key ) }
Create a registry key to set global flags for the image file.
Create a registry key to set global flags for the image file .
&self