Function SCPreferencesSetComputerName

Source
pub unsafe extern "C-unwind" fn SCPreferencesSetComputerName(
    prefs: &SCPreferences,
    name: Option<&CFString>,
    name_encoding: CFStringEncoding,
) -> bool
Available on crate features SCPreferences and SCPreferencesSetSpecific only.
Expand description

Updates the computer name preference.

Note: To commit these changes to permanent storage you must call the SCPreferencesCommitChanges function. In addition, you must call the SCPreferencesApplyChanges function for the new name to become active.

Parameter prefs: The preferences session.

Parameter name: The computer name to be set.

Parameter nameEncoding: The encoding associated with the computer name.

Returns: Returns TRUE if successful; FALSE otherwise.