📄 libmsrpc.h
字号:
/**name of the key class*/ char *class_name; /**number of subkeys of the key*/ uint32 num_subkeys; /**length (in characters) of the longest subkey name*/ uint32 longest_subkey; /**length (in characters) of the longest class name*/ uint32 longest_class; /**number of values in this key*/ uint32 num_values; /**length (in characters) of the longest value name*/ uint32 longest_value_name; /**length (in bytes) of the biggest value data*/ uint32 longest_value_data; /**size (in bytes) of the security descriptor*/ uint32 security_desc_size; /**time of the last write*/ time_t last_write_time; } out;};/** * Retrieves information about an open 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_RegQueryKeyInfo(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegQueryKeyInfo *op);struct RegSaveKey { struct { /**Open key to be saved*/ POLICY_HND *key; /**The path (on the remote computer) to save the file to*/ char *filename; } in;};/** * Saves a key to a file on the remote machine __Not currently working__. * @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_RegSaveKey(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegSaveKey *op);struct RegQueryValue { struct { /**handle to open registry key*/ POLICY_HND *key; /**name of the value to query*/ char *val_name; } in; struct { /**Value type. * One of: * - REG_DWORD (equivalent to REG_DWORD_LE) * - REG_DWORD_BE * - REG_SZ * - REG_EXPAND_SZ * - REG_MULTI_SZ * - REG_BINARY */ uint32 type; /**The value*/ REG_VALUE_DATA *data; } out;};/** * Retrieves a value (type and data) _not currently working_. * @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_RegQueryValue(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegQueryValue *op);struct RegEnumValues { struct { /**handle to open key*/ POLICY_HND *key; /**max number of values returned per call*/ uint32 max_values; } in; struct { /**keeps track of the index to resume from - used over multiple calls*/ uint32 resume_idx; /**the number of values that were returned this call*/ uint32 num_values; /**Array of value types. A type can be one of: * - REG_DWORD (equivalent to REG_DWORD_LE) * - REG_DWORD_BE * - REG_SZ * - REG_EXPAND_SZ * - REG_MULTI_SZ * - REG_BINARY */ uint32 *types; /**array of strings storing the names of the values*/ char **value_names; /**array of pointers to the value data returned*/ REG_VALUE_DATA **values; } out;};/** * Enumerates a number of Registry values in an open registry key. * Can be run in a loop. Example: while(cac_RegEnumValues(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_RegEnumValues(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegEnumValues *op);struct RegSetValue { struct { /**Handle to open registry key*/ POLICY_HND *key; /**Name of the value*/ char *val_name; /**Value type. * One of: * - REG_DWORD (equivalent to REG_DWORD_LE) * - REG_DWORD_BE * - REG_SZ * - REG_EXPAND_SZ * - REG_MULTI_SZ * - REG_BINARY */ uint32 type; /**the value*/ REG_VALUE_DATA value; } in;};/** * Sets or creates value (type and data). * @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_RegSetValue(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegSetValue *op);struct RegGetVersion { struct { /**open registry key*/ POLICY_HND *key; } in; struct { /**version number*/ uint32 version; } out;};/** * Retrieves the registry version number * @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_RegGetVersion(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegGetVersion *op);struct RegGetKeySecurity { struct { /**Handle to key to query*/ POLICY_HND *key; /**Info that you want. Should be a combination of (1 or more or'd): * - OWNER_SECURITY_INFORMATION * - GROUP_SECURITY_INFORMATION * - DACL_SECURITY_INFORMATION * - SACL_SECURITY_INFORMATION * - UNPROTECTED_SACL_SECURITY_INFORMATION * - UNPROTECTED_DACL_SECURITY_INFORMATION * - PROTECTED_SACL_SECURITY_INFORMATION * - PROTECTED_DACL_SECURITY_INFORMATION * * or use: * - ALL_SECURITY_INFORMATION * * all definitions from include/rpc_secdes.h */ uint32 info_type; } in; struct { /**size of the data returned*/ uint32 size; /**Security descriptor*/ SEC_DESC *descriptor; } out;};/** * Retrieves a key security descriptor. * @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_RegGetKeySecurity(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegGetKeySecurity *op);struct RegSetKeySecurity { struct { /**Handle to key to query*/ POLICY_HND *key; /**Info that you want. Should be a combination of (1 or more or'd): * - OWNER_SECURITY_INFORMATION * - GROUP_SECURITY_INFORMATION * - DACL_SECURITY_INFORMATION * - SACL_SECURITY_INFORMATION * - UNPROTECTED_SACL_SECURITY_INFORMATION * - UNPROTECTED_DACL_SECURITY_INFORMATION * - PROTECTED_SACL_SECURITY_INFORMATION * - PROTECTED_DACL_SECURITY_INFORMATION * * or use: * - ALL_SECURITY_INFORMATION * * all definitions from include/rpc_secdes.h */ uint32 info_type; /**size of the descriptor*/ size_t size; /**Security descriptor*/ SEC_DESC *descriptor; } in;};/** * Sets the key security descriptor. * @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_RegSetKeySecurity(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct RegSetKeySecurity *op);/**@}*/ /*Reg_Functions*/struct Shutdown { struct { /**the message to display (can be NULL)*/ char *message; /**timeout in seconds*/ uint32 timeout; /**False = shutdown, True = reboot*/ BOOL reboot; /**force the*/ BOOL force; /*FIXME: make this useful*/ uint32 reason; } in;};/** * Shutdown the server _not currently working_. * @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_Shutdown(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct Shutdown *op);/** * Attempt to abort initiated shutdown on the server _not currently working_. * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @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_AbortShutdown(CacServerHandle *hnd, TALLOC_CTX *mem_ctx);/***************** * SAM Functions * *****************//**@addtogroup SAM_Functions * @{ */struct SamConnect { struct { /**Access mask to open with * see generic access masks in include/smb.h*/ uint32 access; } in; struct { POLICY_HND *sam; } out;};/** * Connects to the SAM. This can be skipped by just calling cac_SamOpenDomain() * @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_SamConnect(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamConnect *op);/** * Closes any (SAM, domain, user, group, etc.) SAM handle. * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param sam 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_SamClose(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *sam);struct SamOpenDomain { struct { /**The desired access. See generic access masks - include/smb.h*/ uint32 access; /**(Optional) An open handle to the SAM. If it is NULL, the function will connect to the SAM with the access mask above*/ POLICY_HND *sam; /**(Optional) The SID of the domain to open. * If this this is NULL, the function will attempt to open the domain specified in hnd->domain */ DOM_SID *sid; } in; struct { /**handle to the open domain*/ POLICY_HND *dom_hnd; /**Handle to the open SAM*/ POLICY_HND *sam; } out;};/** * Opens a handle to a domain. This must be called before any other SAM functions * @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_SamOpenDomain(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamOpenDomain *op);struct SamCreateUser { struct { /**Open domain handle*/ POLICY_HND *dom_hnd; /**Username*/ char *name; /**See Allowable account control bits in include/smb.h*/ uint32 acb_mask; } in; struct { /**handle to the user*/ POLICY_HND *user_hnd; /**rid of the user*/ uint32 rid; } out;};/** * Creates a new domain user, if the account already exists it will _not_ be opened and hnd->status will be NT_STATUS_USER_EXISTS * @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 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -