📄 libmsrpc.h
字号:
int cac_SamCreateUser(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamCreateUser *op);struct SamOpenUser { struct { /**Handle to open SAM connection*/ POLICY_HND *dom_hnd; /**desired access - see generic access masks in include/smb.h*/ uint32 access; /**RID of the user*/ uint32 rid; /**(Optional) name of the user - must supply either RID or user name*/ char *name; } in; struct { /**Handle to the user*/ POLICY_HND *user_hnd; } out; };/** * Opens a domain user. * @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_SamOpenUser(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamOpenUser *op);/** * Deletes a domain user. * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param user_hnd Open handle to the user * @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_SamDeleteUser(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *user_hnd);struct SamEnumUsers { struct { /**Open handle to a domain*/ POLICY_HND *dom_hnd; /**Enumerate users with specific ACB. If 0, all users will be enumerated*/ uint16 acb_mask; } in; struct { /**where to resume from. Used over multiple calls*/ uint32 resume_idx; /**the number of users returned this call*/ uint32 num_users; /**Array storing the rids of the returned users*/ uint32 *rids; /**Array storing the names of all the users returned*/ char **names; BOOL done; } out;};/** * Enumerates domain users. Can be used as a loop condition. Example: while(cac_SamEnumUsers(hnd, mem_ctx, op)) { ... } * @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_SamEnumUsers(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamEnumUsers *op);struct SamGetNamesFromRids { struct { /**An open handle to the domain SAM from cac_SamOpenDomain()*/ POLICY_HND *dom_hnd; /**Number of RIDs to resolve*/ uint32 num_rids; /**Array of RIDs to resolve*/ uint32 *rids; } in; struct { /**the number of names returned - if this is 0, the map is NULL*/ uint32 num_names; /**array contiaing the Names and RIDs*/ CacLookupRidsRecord *map; } out;};/** * Returns a list of names which map to a list of RIDs. * @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_SamGetNamesFromRids(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamGetNamesFromRids *op);struct SamGetRidsFromNames { struct { /**An open handle to the domain SAM from cac_SamOpenDomain()*/ POLICY_HND *dom_hnd; /**Number of names to resolve*/ uint32 num_names; /**Array of names to resolve*/ char **names; } in; struct { /**the number of names returned - if this is 0, then map is NULL*/ uint32 num_rids; /**array contiaing the Names and RIDs*/ CacLookupRidsRecord *map; } out;};/** * Returns a list of RIDs which map to a list of names. * @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_SamGetRidsFromNames(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamGetRidsFromNames *op);struct SamGetGroupsForUser { struct { /**An open handle to the user*/ POLICY_HND *user_hnd; } in; struct { /**The number of groups the user is a member of*/ uint32 num_groups; /**The RIDs of the groups*/ uint32 *rids; /**The attributes of the groups*/ uint32 *attributes; } out;};/** * Retrieves a list of groups that a user is a member of. * @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_SamGetGroupsForUser(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamGetGroupsForUser *op);struct SamOpenGroup { struct { /**Open handle to the domain SAM*/ POLICY_HND *dom_hnd; /**Desired access to open the group with. See Generic access masks in include/smb.h*/ uint32 access; /**rid of the group*/ uint32 rid; } in; struct { /**Handle to the group*/ POLICY_HND *group_hnd; } out;};/** * Opens a domain group. * @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_SamOpenGroup(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamOpenGroup *op);struct SamCreateGroup { struct { /**Open handle to the domain SAM*/ POLICY_HND *dom_hnd; /**Desired access to open the group with. See Generic access masks in include/smb.h*/ uint32 access; /**The name of the group*/ char *name; } in; struct { /**Handle to the group*/ POLICY_HND *group_hnd; } out;};/** * Creates a group. If the group already exists it will not be opened. * @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_SamCreateGroup(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamCreateGroup *op);/** * Deletes a domain group. * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param group_hnd Open handle to the group. * @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_SamDeleteGroup(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *group_hnd);struct SamGetGroupMembers { struct { /**Open handle to a group*/ POLICY_HND *group_hnd; } in; struct { /**The number of members in the group*/ uint32 num_members; /**An array storing the RIDs of the users*/ uint32 *rids; /**The attributes*/ uint32 *attributes; } out;};/** * Retrives a list of users in a group. * @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_SamGetGroupMembers(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamGetGroupMembers *op);struct SamAddGroupMember { struct { /**Open handle to a group*/ POLICY_HND *group_hnd; /**RID of new member*/ uint32 rid; } in;};/** * Adds a user to a group. * @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_SamAddGroupMember(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamAddGroupMember *op);struct SamRemoveGroupMember { struct { /**Open handle to a group*/ POLICY_HND *group_hnd; /**RID of member to remove*/ uint32 rid; } in;};/** * Removes a user from a group. * @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_SamRemoveGroupMember(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamRemoveGroupMember *op);/** * Removes all the members of a group - warning: if this function fails is is possible that some but not all members were removed * @param hnd Initialized and connected server handle * @param mem_ctx Context for memory allocation * @param group_hnd Open handle to the group to clear * @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_SamClearGroupMembers(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *group_hnd);struct SamSetGroupMembers { struct { /**Open handle to the group*/ POLICY_HND *group_hnd; /**Number of members in the group - if this is 0, all members of the group will be removed*/ uint32 num_members; /**The RIDs of the users to add*/ uint32 *rids; } in;};/** * Clears the members of a group and adds a list of members to the group * @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_SamSetGroupMembers(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamSetGroupMembers *op);struct SamEnumGroups { struct { /**Open handle to a domain*/ POLICY_HND *dom_hnd; } in; struct { /**Where to resume from _do not_ modify this value. Used over multiple calls.*/ uint32 resume_idx; /**the number of users returned this call*/ uint32 num_groups; /**Array storing the rids of the returned groups*/ uint32 *rids; /**Array storing the names of all the groups returned*/ char **names; /**Array storing the descriptions of all the groups returned*/ char **descriptions; BOOL done; } out;};/** * Enumerates domain groups. Can be used as a loop condition. Example: while(cac_SamEnumGroups(hnd, mem_ctx, op)) { ... } * @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_SamEnumGroups(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamEnumGroups *op);struct SamEnumAliases { struct { /**Open handle to a domain*/ POLICY_HND *dom_hnd; } in; struct { /**where to resume from. Used over multiple calls*/ uint32 resume_idx; /**the number of users returned this call*/ uint32 num_aliases; /**Array storing the rids of the returned groups*/ uint32 *rids; /**Array storing the names of all the groups returned*/ char **names; /**Array storing the descriptions of all the groups returned*/ char **descriptions; BOOL done; } out;};/** * Enumerates domain aliases. Can be used as a loop condition. Example: while(cac_SamEnumAliases(hnd, mem_ctx, op)) { ... } * @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_SamEnumAliases(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, struct SamEnumAliases *op);struct SamCreateAlias { struct { /**Open handle to the domain SAM*/ POLICY_HND *dom_hnd; /**The name of the alias*/ char *name; } in; struct { /**Handle to the group*/ POLICY_HND *alias_hnd; } out;};/** * Creates an alias. If the alias already exists it will not be opened. * @param hnd Initialized and connected server han
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -