📄 libmsrpc.h
字号:
uint16 info_class; /**(Optional)SID of trusted domain to query (must specify either SID or name of trusted domain)*/ DOM_SID *domain_sid; /**(Optional)Name of trusted domain to query (must specify either SID or name of trusted domain)*/ char *domain_name; } in; struct { /**information about the trusted domain*/ LSA_TRUSTED_DOMAIN_INFO *info; } out;};/** * Retrieves information a trusted domain. * @param hnd An initialized and connected server handle * @param mem_ctx Talloc context for memory allocation * @param op initialized I/O parameters * @return CAC_FAILURE a handle to the domain could not be opened. hnd->status is set with approriate NT_STATUS code * @return CAC_SUCCESS the domain was opened successfully */int cac_LsaQueryTrustedDomainInfo(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaQueryTrustedDomainInfo *op);struct LsaEnumPrivileges { struct { /**An open LSA policy handle*/ POLICY_HND *pol; /**The _preferred_ maxinum number of privileges returned per call*/ uint32 pref_max_privs; } in; struct { /**Used to keep track of how many privileges have been retrieved over multiple calls. Do not modify this value between calls*/ uint32 resume_idx; /**The number of privileges returned this call*/ uint32 num_privs; /**Array of privilege names*/ char **priv_names; /**Array of high bits for privilege LUID*/ uint32 *high_bits; /**Array of low bits for privilege LUID*/ uint32 *low_bits; } out; };/** * Enumerates the Privileges supported by the LSA. Can be enumerated in blocks by calling the function multiple times. * Example: while(cac_LsaEnumPrivileges(hnd, mem_ctx, op) { ... } * @param hnd An initialized and connected server handle * @param mem_ctx Talloc context for memory allocation * @param op Initialized parameters * @return CAC_FAILURE there was an error during operations OR there are no more results * @return CAC_SUCCESS the operation completed and results were returned * @see CAC_OP_FAILED() */int cac_LsaEnumPrivileges(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaEnumPrivileges *op);struct LsaOpenAccount { struct { /**An open LSA policy handle*/ POLICY_HND *pol; /**(Optional) account SID - must supply either sid or name*/ DOM_SID *sid; /**(Optional) account name - must supply either sid or name*/ char *name; /**desired access for the handle*/ uint32 access; } in; struct { /**A handle to the opened user*/ POLICY_HND *user; } out;};/** * Opens a handle to an account in the LSA * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized Parameters * @return CAC_FAILURE the account could not be opened. hnd->status has appropriate NT_STATUS code * @return CAC_SUCCESS the account was opened */int cac_LsaOpenAccount(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaOpenAccount *op);struct LsaAddPrivileges { struct { /**An open LSA policy handle*/ POLICY_HND *pol; /**(Optional) The user's SID (must specify at least sid or name)*/ DOM_SID *sid; /**(Optional) The user's name (must specify at least sid or name)*/ char *name; /**The privilege names of the privileges to add for the account*/ char **priv_names; /**The number of privileges in the priv_names array*/ uint32 num_privs; } in;};/** * Adds Privileges an account. * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized Parameters * @return CAC_FAILURE the privileges could not be set. hnd->status has appropriate NT_STATUS code * @return CAC_SUCCESS the privileges were set. */int cac_LsaAddPrivileges(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaAddPrivileges *op);struct LsaRemovePrivileges { struct { /**An open handle to the LSA*/ POLICY_HND *pol; /**(Optional) The account SID (must specify at least sid or name)*/ DOM_SID *sid; /**(Optional) The account name (must specify at least sid or name)*/ char *name; /**The privilege names of the privileges to remove from the account*/ char **priv_names; /**The number of privileges in the priv_names array*/ uint32 num_privs; } in;};/** * Removes a _specific_ set of privileges from an account * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized Parameters * @return CAC_FAILURE the privileges could not be removed. hnd->status is set with NT_STATUS code * @return CAC_SUCCESS the privileges were removed */int cac_LsaRemovePrivileges(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaRemovePrivileges *op);struct LsaClearPrivileges { struct { /**An open handle to the LSA*/ POLICY_HND *pol; /**(Optional) The user's SID (must specify at least sid or name)*/ DOM_SID *sid; /**(Optional) The user's name (must specify at least sid or name)*/ char *name; } in;};/** * Removes ALL privileges from an account * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized Parameters * @return CAC_FAILURE the operation was not successful, hnd->status set with NT_STATUS code * @return CAC_SUCCESS the opeartion was successful. */int cac_LsaClearPrivileges(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaClearPrivileges *op);/** * Sets an accounts priviliges. Removes all privileges and then adds specified privileges. * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized Parameters * @return CAC_FAILURE The operation could not complete successfully * @return CAC_SUCCESS The operation completed successfully */int cac_LsaSetPrivileges(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaAddPrivileges *op);struct LsaGetSecurityObject { struct { /**Open LSA policy handle*/ POLICY_HND *pol; } in; struct { /**Returned security descriptor information*/ SEC_DESC_BUF *sec; } out;};/** * Retrieves Security Descriptor information about the LSA * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized Parameters * @return CAC_FAILURE The operation could not complete successfully * @return CAC_SUCCESS The operation completed successfully */int cac_LsaGetSecurityObject(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct LsaGetSecurityObject *op);/**@}*/ /*LSA_Functions*/ /********************** * Registry Functions * *********************//**@addtogroup Reg_Functions * @{ */struct RegConnect { struct { /** must be one of : * HKEY_CLASSES_ROOT, * HKEY_LOCAL_MACHINE, * HKEY_USERS, * HKEY_PERFORMANCE_DATA, */ int root; /**desired access on the root key * combination of: * REG_KEY_READ, * REG_KEY_WRITE, * REG_KEY_EXECUTE, * REG_KEY_ALL, * found in include/rpc_secdes.h*/ uint32 access; } in; struct { POLICY_HND *key; } out;};/** * Opens a handle to the registry on the server * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized Parameters * @return CAC_FAILURE The operation could not complete successfully. hnd->status is set with appropriate NTSTATUS code * @return CAC_SUCCESS The operation completed successfully */int cac_RegConnect(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegConnect *op);/** * Closes an open registry handle * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param key The Key/Handle to close * @return CAC_FAILURE The operation could not complete successfully. hnd->status is set with appropriate NTSTATUS code * @return CAC_SUCCESS The operation completed successfully */int cac_RegClose(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *key);struct RegOpenKey { struct { /**(Optional)parent key. * If this is NULL, then cac_RegOpenKey() will attempt to connect to the registry, name MUST start with something like:<br> * HKEY_LOCAL_MACHINE\ or an abbreviation like HKCR\ * * supported root names: * - HKEY_LOCAL_MACHINE\ or HKLM\ * - HKEY_CLASSES_ROOT\ or HKCR\ * - HKEY_USERS\ or HKU\ * - HKEY_PERFORMANCE_DATA or HKPD\ */ POLICY_HND *parent_key; /**name/path of key*/ char *name; /**desired access on this key*/ uint32 access; } in; struct { POLICY_HND *key; } out;}; /** * Opens a registry key * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized parameters * @return CAC_FAILURE The operation could not complete successfully. hnd->status is set with appropriate NTSTATUS code * @return CAC_SUCCESS The operation completed successfully */int cac_RegOpenKey(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegOpenKey *op);struct RegEnumKeys { struct { /**enumerate subkeys of this key*/ POLICY_HND *key; /**maximum number of keys to enumerate each call*/ uint32 max_keys; } in; struct { /**keeps track of the index to resume enumerating*/ uint32 resume_idx; /**the number of keys returned this call*/ uint32 num_keys; /**array of key names*/ char **key_names; /**class names of the keys*/ char **class_names; /**last modification time of the key*/ time_t *mod_times; } out;};/** * Enumerates Subkeys of a given key. Can be run in a loop. Example: while(cac_RegEnumKeys(hnd, mem_ctx, op)) { ... } * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized Parameters * @see CAC_OP_FAILED() * @return CAC_FAILURE The operation could not complete successfully. hnd->status is set with appropriate NTSTATUS code * @return CAC_SUCCESS The operation completed successfully */int cac_RegEnumKeys(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegEnumKeys *op);struct RegCreateKey { struct { /**create a subkey of parent_key*/ POLICY_HND *parent_key; /**name of the key to create*/ char *key_name; /**class of the key*/ char *class_name; /**Access mask to open the key with. See REG_KEY_* in include/rpc_secdes.h*/ uint32 access; } in; struct { /**Open handle to the key*/ POLICY_HND *key; } out;};/** * Creates a registry key, if the key already exists, it will be opened __Creating keys is not currently working__. * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized Parmeters * @return CAC_FAILURE The operation could not complete successfully. hnd->status is set with appropriate NTSTATUS code * @return CAC_SUCCESS The operation completed successfully */int cac_RegCreateKey(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegCreateKey *op);struct RegDeleteKey { struct { /**handle to open registry key*/ POLICY_HND *parent_key; /**name of the key to delete*/ char *name; /**delete recursively. WARNING: this might not always work as planned*/ BOOL recursive; } in;};/** * Deletes a subkey of an open key. Note: if you run this with op->in.recursive == True, and the operation fails, it may leave the key in an inconsistent state. * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized parameters * @return CAC_FAILURE The operation could not complete successfully. hnd->status is set with appropriate NTSTATUS code * @return CAC_SUCCESS The operation completed successfully */int cac_RegDeleteKey(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegDeleteKey *op);struct RegDeleteValue { struct { /**handle to open registry key*/ POLICY_HND *parent_key; /**name of the value to delete*/ char *name; } in;};/** * Deletes a registry value. * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param op Initialized Parameters * @return CAC_FAILURE The operation could not complete successfully. hnd->status is set with appropriate NTSTATUS code * @return CAC_SUCCESS The operation completed successfully */int cac_RegDeleteValue(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegDeleteValue *op);struct RegQueryKeyInfo { struct { /**Open handle to the key to query*/ POLICY_HND *key; } in; struct {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -