include/rpc_samr.h

説明を見る。
00001 /* 
00002    Unix SMB/CIFS implementation.
00003    SMB parameters and setup
00004    Copyright (C) Andrew Tridgell              1992-2000
00005    Copyright (C) Luke Kenneth Casson Leighton 1996-2000
00006    Copyright (C) Paul Ashton                  1997-2000
00007    Copyright (C) Jean Fran巽ois Micouleau      1998-2001
00008    Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
00009    
00010    
00011    This program is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; either version 2 of the License, or
00014    (at your option) any later version.
00015    
00016    This program is distributed in the hope that it will be useful,
00017    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019    GNU General Public License for more details.
00020    
00021    You should have received a copy of the GNU General Public License
00022    along with this program; if not, write to the Free Software
00023    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024 */
00025 
00026 #ifndef _RPC_SAMR_H /* _RPC_SAMR_H */
00027 #define _RPC_SAMR_H 
00028 
00029 /*******************************************************************
00030  the following information comes from a QuickView on samsrv.dll,
00031  and gives an idea of exactly what is needed:
00032  
00033 x SamrAddMemberToAlias
00034 x SamrAddMemberToGroup
00035 SamrAddMultipleMembersToAlias
00036 x SamrChangePasswordUser
00037 x SamrCloseHandle
00038 x SamrConnect
00039 x SamrCreateAliasInDomain
00040 x SamrCreateGroupInDomain
00041 x SamrCreateUserInDomain
00042 ? SamrDeleteAlias
00043 SamrDeleteGroup
00044 x SamrDeleteUser
00045 x SamrEnumerateAliasesInDomain
00046 SamrEnumerateDomainsInSamServer
00047 x SamrEnumerateGroupsInDomain
00048 x SamrEnumerateUsersInDomain
00049 SamrGetUserDomainPasswordInformation
00050 SamrLookupDomainInSamServer
00051 ? SamrLookupIdsInDomain
00052 x SamrLookupNamesInDomain
00053 x SamrOpenAlias
00054 x SamrOpenDomain
00055 x SamrOpenGroup
00056 x SamrOpenUser
00057 x SamrQueryDisplayInformation
00058 x SamrQueryInformationAlias
00059 SamrQueryInformationDomain
00060 ? SamrQueryInformationUser
00061 x SamrQuerySecurityObject
00062 SamrRemoveMemberFromAlias
00063 SamrRemoveMemberFromForiegnDomain
00064 SamrRemoveMemberFromGroup
00065 SamrRemoveMultipleMembersFromAlias
00066 x SamrSetInformationAlias
00067 SamrSetInformationDomain
00068 x SamrSetInformationGroup
00069 x SamrSetInformationUser
00070 SamrSetMemberAttributesOfGroup
00071 SamrSetSecurityObject
00072 SamrShutdownSamServer
00073 SamrTestPrivateFunctionsDomain
00074 SamrTestPrivateFunctionsUser
00075 
00076 ********************************************************************/
00077 
00078 #define SAMR_CONNECT_ANON      0x00
00079 #define SAMR_CLOSE_HND         0x01
00080 #define SAMR_SET_SEC_OBJECT    0x02
00081 #define SAMR_QUERY_SEC_OBJECT  0x03
00082 
00083 #define SAMR_UNKNOWN_4         0x04 /* profile info? */
00084 #define SAMR_LOOKUP_DOMAIN     0x05
00085 #define SAMR_ENUM_DOMAINS      0x06
00086 #define SAMR_OPEN_DOMAIN       0x07
00087 #define SAMR_QUERY_DOMAIN_INFO 0x08
00088 #define SAMR_SET_DOMAIN_INFO   0x09
00089 
00090 #define SAMR_CREATE_DOM_GROUP  0x0a
00091 #define SAMR_ENUM_DOM_GROUPS   0x0b
00092 #define SAMR_ENUM_DOM_USERS    0x0d
00093 #define SAMR_CREATE_DOM_ALIAS  0x0e
00094 #define SAMR_ENUM_DOM_ALIASES  0x0f
00095 #define SAMR_QUERY_USERALIASES 0x10
00096 
00097 #define SAMR_LOOKUP_NAMES      0x11
00098 #define SAMR_LOOKUP_RIDS       0x12
00099 
00100 #define SAMR_OPEN_GROUP        0x13
00101 #define SAMR_QUERY_GROUPINFO   0x14
00102 #define SAMR_SET_GROUPINFO     0x15
00103 #define SAMR_ADD_GROUPMEM      0x16
00104 #define SAMR_DELETE_DOM_GROUP  0x17
00105 #define SAMR_DEL_GROUPMEM      0x18
00106 #define SAMR_QUERY_GROUPMEM    0x19
00107 #define SAMR_UNKNOWN_1A        0x1a
00108 
00109 #define SAMR_OPEN_ALIAS        0x1b
00110 #define SAMR_QUERY_ALIASINFO   0x1c
00111 #define SAMR_SET_ALIASINFO     0x1d
00112 #define SAMR_DELETE_DOM_ALIAS  0x1e
00113 #define SAMR_ADD_ALIASMEM      0x1f
00114 #define SAMR_DEL_ALIASMEM      0x20
00115 #define SAMR_QUERY_ALIASMEM    0x21
00116 
00117 #define SAMR_OPEN_USER         0x22
00118 #define SAMR_DELETE_DOM_USER   0x23
00119 #define SAMR_QUERY_USERINFO    0x24
00120 #define SAMR_SET_USERINFO2     0x25
00121 #define SAMR_QUERY_USERGROUPS  0x27
00122 
00123 #define SAMR_QUERY_DISPINFO    0x28
00124 #define SAMR_GET_DISPENUM_INDEX 0x29
00125 #define SAMR_UNKNOWN_2a        0x2a
00126 #define SAMR_UNKNOWN_2b        0x2b
00127 #define SAMR_GET_USRDOM_PWINFO 0x2c
00128 #define SAMR_REMOVE_SID_FOREIGN_DOMAIN        0x2d
00129 #define SAMR_QUERY_DOMAIN_INFO2  0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */
00130 #define SAMR_UNKNOWN_2f        0x2f
00131 #define SAMR_QUERY_DISPINFO3   0x30 /* Alias for SAMR_QUERY_DISPINFO
00132                                        with info level 3 */
00133 #define SAMR_GET_DISPENUM_INDEX2 0x31
00134 #define SAMR_CREATE_USER       0x32
00135 #define SAMR_QUERY_DISPINFO4   0x33 /* Alias for SAMR_QUERY_DISPINFO
00136                                        with info level 4 */
00137 #define SAMR_ADDMULTI_ALIASMEM 0x34
00138 
00139 #define SAMR_UNKNOWN_35        0x35
00140 #define SAMR_UNKNOWN_36        0x36
00141 #define SAMR_CHGPASSWD_USER    0x37
00142 #define SAMR_GET_DOM_PWINFO    0x38
00143 #define SAMR_CONNECT           0x39
00144 #define SAMR_SET_USERINFO      0x3A
00145 #define SAMR_CONNECT4          0x3E
00146 #define SAMR_CHGPASSWD_USER3   0x3F
00147 #define SAMR_CONNECT5          0x40
00148 
00149 /* SAMR account creation flags/permissions */
00150 #define SAMR_USER_GETNAME               0x1
00151 #define SAMR_USER_GETLOCALE             0x2
00152 #define SAMR_USER_GETLOCCOM             0x4
00153 #define SAMR_USER_GETLOGONINFO          0x8
00154 #define SAMR_USER_GETATTR               0x10
00155 #define SAMR_USER_SETATTR               0x20
00156 #define SAMR_USER_CHPASS                0x40
00157 #define SAMR_USER_SETPASS               0x80
00158 #define SAMR_USER_GETGROUPS             0x100
00159 #define SAMR_USER_GETMEMBERSHIP         0x200
00160 #define SAMR_USER_CHMEMBERSHIP          0x400
00161 #define SAMR_STANDARD_DELETE            0x10000
00162 #define SAMR_STANDARD_READCTRL          0x20000
00163 #define SAMR_STANDARD_WRITEDAC          0x40000
00164 #define SAMR_STANDARD_WRITEOWNER        0x80000
00165 #define SAMR_STANDARD_SYNC              0x100000
00166 #define SAMR_GENERIC_ACCESSSACL         0x800000
00167 #define SAMR_GENERIC_MAXALLOWED         0x2000000
00168 #define SAMR_GENERIC_ALL                0x10000000
00169 #define SAMR_GENERIC_EXECUTE            0x20000000
00170 #define SAMR_GENERIC_WRITE              0x40000000
00171 #define SAMR_GENERIC_READ               0x80000000
00172 
00173 
00174 typedef struct logon_hours_info
00175 {
00176         uint32 max_len; /* normally 1260 bytes */
00177         uint32 offset;
00178         uint32 len; /* normally 21 bytes */
00179         uint8 hours[32];
00180 
00181 } LOGON_HRS;
00182 
00183 /* SAM_USER_INFO_23 */
00184 typedef struct sam_user_info_23
00185 {
00186         /* TIMES MAY NOT IN RIGHT ORDER!!!! */
00187         NTTIME logon_time;            /* logon time */
00188         NTTIME logoff_time;           /* logoff time */
00189         NTTIME kickoff_time;          /* kickoff time */
00190         NTTIME pass_last_set_time;    /* password last set time */
00191         NTTIME pass_can_change_time;  /* password can change time */
00192         NTTIME pass_must_change_time; /* password must change time */
00193 
00194         UNIHDR hdr_user_name;    /* NULL - user name unicode string header */
00195         UNIHDR hdr_full_name;    /* user's full name unicode string header */
00196         UNIHDR hdr_home_dir;     /* home directory unicode string header */
00197         UNIHDR hdr_dir_drive;    /* home drive unicode string header */
00198         UNIHDR hdr_logon_script; /* logon script unicode string header */
00199         UNIHDR hdr_profile_path; /* profile path unicode string header */
00200         UNIHDR hdr_acct_desc  ;  /* user description */
00201         UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
00202         UNIHDR hdr_comment;
00203         UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
00204 
00205         uint8 lm_pwd[16];    /* lm user passwords */
00206         uint8 nt_pwd[16];    /* nt user passwords */
00207 
00208         uint32 user_rid;      /* Primary User ID */
00209         uint32 group_rid;     /* Primary Group ID */
00210 
00211         uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
00212 
00213         uint32 fields_present; /* 0x09f8 27fa */
00214 
00215         uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
00216         /* uint8 pad[2] */
00217         uint32 ptr_logon_hrs; /* pointer to logon hours */
00218 
00219         /* Was unknown_5. */
00220         uint16 bad_password_count;
00221         uint16 logon_count;
00222 
00223         uint8 padding1[6];
00224                 
00225         uint8 passmustchange; /* 0x00 must change = 0x01 */
00226 
00227         uint8 padding2;
00228 
00229         uint8 pass[516];
00230 
00231         UNISTR2 uni_user_name;    /* NULL - username unicode string */
00232         UNISTR2 uni_full_name;    /* user's full name unicode string */
00233         UNISTR2 uni_home_dir;     /* home directory unicode string */
00234         UNISTR2 uni_dir_drive;    /* home directory drive unicode string */
00235         UNISTR2 uni_logon_script; /* logon script unicode string */
00236         UNISTR2 uni_profile_path; /* profile path unicode string */
00237         UNISTR2 uni_acct_desc  ;  /* user description unicode string */
00238         UNISTR2 uni_workstations; /* login from workstations unicode string */
00239         UNISTR2 uni_comment;
00240         UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
00241 
00242         LOGON_HRS logon_hrs;
00243 
00244 } SAM_USER_INFO_23;
00245 
00246 /* SAM_USER_INFO_24 */
00247 typedef struct sam_user_info_24
00248 {
00249         uint8 pass[516];
00250         uint8 pw_len;
00251 } SAM_USER_INFO_24;
00252 
00253 /*
00254  * NB. This structure is *definately* incorrect. It's my best guess
00255  * currently for W2K SP2. The password field is encrypted in a different
00256  * way than normal... And there are definately other problems. JRA.
00257  */
00258 
00259 /* SAM_USER_INFO_25 */
00260 typedef struct sam_user_info_25
00261 {
00262         /* TIMES MAY NOT IN RIGHT ORDER!!!! */
00263         NTTIME logon_time;            /* logon time */
00264         NTTIME logoff_time;           /* logoff time */
00265         NTTIME kickoff_time;          /* kickoff time */
00266         NTTIME pass_last_set_time;    /* password last set time */
00267         NTTIME pass_can_change_time;  /* password can change time */
00268         NTTIME pass_must_change_time; /* password must change time */
00269 
00270         UNIHDR hdr_user_name;    /* NULL - user name unicode string header */
00271         UNIHDR hdr_full_name;    /* user's full name unicode string header */
00272         UNIHDR hdr_home_dir;     /* home directory unicode string header */
00273         UNIHDR hdr_dir_drive;    /* home drive unicode string header */
00274         UNIHDR hdr_logon_script; /* logon script unicode string header */
00275         UNIHDR hdr_profile_path; /* profile path unicode string header */
00276         UNIHDR hdr_acct_desc  ;  /* user description */
00277         UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
00278         UNIHDR hdr_comment;
00279         UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
00280 
00281         uint8 lm_pwd[16];    /* lm user passwords */
00282         uint8 nt_pwd[16];    /* nt user passwords */
00283 
00284         uint32 user_rid;      /* Primary User ID */
00285         uint32 group_rid;     /* Primary Group ID */
00286 
00287         uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
00288         uint32 fields_present;
00289 
00290         uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
00291         /* uint8 pad[2] */
00292         uint32 ptr_logon_hrs; /* pointer to logon hours */
00293 
00294         /* Was unknown_5. */
00295         uint16 bad_password_count;
00296         uint16 logon_count;
00297 
00298         uint8 padding1[6];
00299                 
00300         uint8 passmustchange; /* 0x00 must change = 0x01 */
00301 
00302         uint8 padding2;
00303 
00304         uint8 pass[532];
00305 
00306         UNISTR2 uni_user_name;    /* NULL - username unicode string */
00307         UNISTR2 uni_full_name;    /* user's full name unicode string */
00308         UNISTR2 uni_home_dir;     /* home directory unicode string */
00309         UNISTR2 uni_dir_drive;    /* home directory drive unicode string */
00310         UNISTR2 uni_logon_script; /* logon script unicode string */
00311         UNISTR2 uni_profile_path; /* profile path unicode string */
00312         UNISTR2 uni_acct_desc  ;  /* user description unicode string */
00313         UNISTR2 uni_workstations; /* login from workstations unicode string */
00314         UNISTR2 uni_comment;
00315         UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
00316         LOGON_HRS logon_hrs;
00317 
00318 } SAM_USER_INFO_25;
00319 
00320 /* SAM_USER_INFO_26 */
00321 typedef struct sam_user_info_26
00322 {
00323         uint8 pass[532];
00324         uint8 pw_len;
00325 } SAM_USER_INFO_26;
00326 
00327 
00328 /* SAM_USER_INFO_21 */
00329 typedef struct sam_user_info_21
00330 {
00331         NTTIME logon_time;            /* logon time */
00332         NTTIME logoff_time;           /* logoff time */
00333         NTTIME kickoff_time;          /* kickoff time */
00334         NTTIME pass_last_set_time;    /* password last set time */
00335         NTTIME pass_can_change_time;  /* password can change time */
00336         NTTIME pass_must_change_time; /* password must change time */
00337 
00338         UNIHDR hdr_user_name;    /* username unicode string header */
00339         UNIHDR hdr_full_name;    /* user's full name unicode string header */
00340         UNIHDR hdr_home_dir;     /* home directory unicode string header */
00341         UNIHDR hdr_dir_drive;    /* home drive unicode string header */
00342         UNIHDR hdr_logon_script; /* logon script unicode string header */
00343         UNIHDR hdr_profile_path; /* profile path unicode string header */
00344         UNIHDR hdr_acct_desc  ;  /* user description */
00345         UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
00346         UNIHDR hdr_comment;
00347         UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
00348 
00349         uint8 lm_pwd[16];    /* lm user passwords */
00350         uint8 nt_pwd[16];    /* nt user passwords */
00351 
00352         uint32 user_rid;      /* Primary User ID */
00353         uint32 group_rid;     /* Primary Group ID */
00354 
00355         uint32 acb_info; /* account info (ACB_xxxx bit-mask) */
00356 
00357         /* Was unknown_3 */
00358         uint32 fields_present; /* 0x00ff ffff */
00359 
00360         uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */
00361         /* uint8 pad[2] */
00362         uint32 ptr_logon_hrs; /* unknown pointer */
00363 
00364         /* Was unknown_5. */
00365         uint16 bad_password_count;
00366         uint16 logon_count;
00367 
00368         uint8 padding1[6];
00369                 
00370         uint8 passmustchange; /* 0x00 must change = 0x01 */
00371 
00372         uint8 padding2;
00373 
00374         UNISTR2 uni_user_name;    /* username unicode string */
00375         UNISTR2 uni_full_name;    /* user's full name unicode string */
00376         UNISTR2 uni_home_dir;     /* home directory unicode string */
00377         UNISTR2 uni_dir_drive;    /* home directory drive unicode string */
00378         UNISTR2 uni_logon_script; /* logon script unicode string */
00379         UNISTR2 uni_profile_path; /* profile path unicode string */
00380         UNISTR2 uni_acct_desc  ;  /* user description unicode string */
00381         UNISTR2 uni_workstations; /* login from workstations unicode string */
00382         UNISTR2 uni_comment;
00383         UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
00384 
00385         LOGON_HRS logon_hrs;
00386 
00387 } SAM_USER_INFO_21;
00388 
00389 #define PASS_MUST_CHANGE_AT_NEXT_LOGON  0x01
00390 #define PASS_DONT_CHANGE_AT_NEXT_LOGON  0x00
00391 
00392 /* SAM_USER_INFO_20 */
00393 typedef struct sam_user_info_20
00394 {
00395         UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
00396 
00397         UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
00398 
00399 } SAM_USER_INFO_20;
00400 
00401 /* SAM_USER_INFO_18 */
00402 typedef struct sam_user_info_18
00403 {
00404         uint8 lm_pwd[16];    /* lm user passwords */
00405         uint8 nt_pwd[16];    /* nt user passwords */
00406 
00407         uint8 lm_pwd_active; 
00408         uint8 nt_pwd_active; 
00409 
00410 } SAM_USER_INFO_18;
00411 
00412 /* SAM_USER_INFO_17 */
00413 typedef struct sam_user_info_17
00414 {
00415         uint8  padding_0[16];  /* 0 - padding 16 bytes */
00416         NTTIME expiry;         /* expiry time or something? */
00417         uint8  padding_1[24];  /* 0 - padding 24 bytes */
00418 
00419         UNIHDR hdr_mach_acct;  /* unicode header for machine account */
00420         uint32 padding_2;      /* 0 - padding 4 bytes */
00421 
00422         uint32 ptr_1;          /* pointer */
00423         uint8  padding_3[32];  /* 0 - padding 32 bytes */
00424         uint32 padding_4;      /* 0 - padding 4 bytes */
00425 
00426         uint32 ptr_2;          /* pointer */
00427         uint32 padding_5;      /* 0 - padding 4 bytes */
00428 
00429         uint32 ptr_3;          /* pointer */
00430         uint8  padding_6[32];  /* 0 - padding 32 bytes */
00431 
00432         uint32 rid_user;       /* user RID */
00433         uint32 rid_group;      /* group RID */
00434 
00435         uint16 acct_ctrl;      /* 0080 - ACB_XXXX */
00436         uint16 unknown_3;      /* 16 bit padding */
00437 
00438         uint16 unknown_4;      /* 0x003f      - 16 bit unknown */
00439         uint16 unknown_5;      /* 0x003c      - 16 bit unknown */
00440 
00441         uint8  padding_7[16];  /* 0 - padding 16 bytes */
00442         uint32 padding_8;      /* 0 - padding 4 bytes */
00443         
00444         UNISTR2 uni_mach_acct; /* unicode string for machine account */
00445 
00446         uint8  padding_9[48];  /* 0 - padding 48 bytes */
00447 
00448 } SAM_USER_INFO_17;
00449 
00450 
00451 /* SAM_USER_INFO_16 */
00452 typedef struct sam_user_info_16
00453 {
00454         uint32 acb_info;
00455 
00456 } SAM_USER_INFO_16;
00457 
00458 
00459 /* SAM_USER_INFO_7 */
00460 typedef struct sam_user_info_7
00461 {
00462         UNIHDR hdr_name;  /* unicode header for name */
00463         UNISTR2 uni_name; /* unicode string for name */
00464 
00465 } SAM_USER_INFO_7;
00466 
00467 
00468 /* SAM_USER_INFO_9 */
00469 typedef struct sam_user_info_9
00470 {
00471         uint32 rid_group;     /* Primary Group RID */
00472 } SAM_USER_INFO_9;
00473 
00474 
00475 /* SAMR_Q_CLOSE_HND - probably a policy handle close */
00476 typedef struct q_samr_close_hnd_info
00477 {
00478     POLICY_HND pol;          /* policy handle */
00479 
00480 } SAMR_Q_CLOSE_HND;
00481 
00482 
00483 /* SAMR_R_CLOSE_HND - probably a policy handle close */
00484 typedef struct r_samr_close_hnd_info
00485 {
00486         POLICY_HND pol;       /* policy handle */
00487         NTSTATUS status;         /* return status */
00488 
00489 } SAMR_R_CLOSE_HND;
00490 
00491 
00492 /****************************************************************************
00493 SAMR_Q_GET_USRDOM_PWINFO - a "set user info" occurs just after this
00494 *****************************************************************************/
00495 
00496 /* SAMR_Q_GET_USRDOM_PWINFO */
00497 typedef struct q_samr_usrdom_pwinfo_info
00498 {
00499         POLICY_HND user_pol;          /* policy handle */
00500 
00501 } SAMR_Q_GET_USRDOM_PWINFO;
00502 
00503 
00504 /****************************************************************************
00505 SAMR_R_GET_USRDOM_PWINFO - a "set user info" occurs just after this
00506 *****************************************************************************/
00507 
00508 /* SAMR_R_GET_USRDOM_PWINFO */
00509 typedef struct r_samr_usrdom_pwinfo_info
00510 {
00511         uint16 min_pwd_length;
00512         uint16 unknown_1; /* 0x0016 or 0x0015 */
00513         uint32 password_properties;
00514         NTSTATUS status; 
00515 
00516 } SAMR_R_GET_USRDOM_PWINFO;
00517 
00518 /****************************************************************************
00519 SAMR_Q_SET_SEC_OBJ - info level 4.
00520 *****************************************************************************/
00521 
00522 /* SAMR_Q_SET_SEC_OBJ - */
00523 typedef struct q_samr_set_sec_obj_info
00524 {
00525         POLICY_HND pol;          /* policy handle */
00526         uint32 sec_info;         /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
00527         SEC_DESC_BUF *buf;
00528 
00529 } SAMR_Q_SET_SEC_OBJ;
00530 
00531 /* SAMR_R_SET_SEC_OBJ - */
00532 typedef struct r_samr_set_sec_obj_info
00533 {
00534         NTSTATUS status;         /* return status */
00535 
00536 } SAMR_R_SET_SEC_OBJ;
00537 
00538 
00539 /****************************************************************************
00540 SAMR_Q_QUERY_SEC_OBJ - info level 4.  returns SIDs.
00541 *****************************************************************************/
00542 
00543 /* SAMR_Q_QUERY_SEC_OBJ - probably get domain info... */
00544 typedef struct q_samr_query_sec_obj_info
00545 {
00546         POLICY_HND user_pol;          /* policy handle */
00547         uint32 sec_info;     /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
00548 
00549 } SAMR_Q_QUERY_SEC_OBJ;
00550 
00551 /* SAMR_R_QUERY_SEC_OBJ - probably an open */
00552 typedef struct r_samr_query_sec_obj_info
00553 {
00554         uint32 ptr;
00555         SEC_DESC_BUF *buf;
00556 
00557         NTSTATUS status;         /* return status */
00558 
00559 } SAMR_R_QUERY_SEC_OBJ;
00560 
00561 
00562 /****************************************************************************
00563 SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info.
00564 *****************************************************************************/
00565 
00566 /* SAMR_Q_QUERY_DOMAIN_INFO - */
00567 typedef struct q_samr_query_domain_info
00568 {
00569         POLICY_HND domain_pol;   /* policy handle */
00570         uint16 switch_value;     /* 0x0002, 0x0001 */
00571 
00572 } SAMR_Q_QUERY_DOMAIN_INFO;
00573 
00574 typedef struct sam_unknown_info_1_inf
00575 {
00576         uint16 min_length_password;
00577         uint16 password_history;
00578         uint32 password_properties;
00579         NTTIME expire;
00580         NTTIME min_passwordage;
00581 
00582 } SAM_UNK_INFO_1;
00583 
00584 typedef struct sam_unknown_info_2_inf
00585 {
00586         NTTIME logout; /* whether users are forcibly disconnected when logon hours expire */
00587         UNIHDR hdr_comment; /* comment according to samba4 idl */
00588         UNIHDR hdr_domain; /* domain name unicode header */
00589         UNIHDR hdr_server; /* server name unicode header */
00590 
00591         /* put all the data in here, at the moment, including what the above
00592            pointer is referring to
00593          */
00594 
00595         uint64 seq_num;
00596         
00597         uint32 unknown_4; /* 0x0000 0001 */
00598         uint32 server_role;
00599         uint32 unknown_6; /* 0x0000 0001 */
00600         uint32 num_domain_usrs; /* number of users in domain */
00601         uint32 num_domain_grps; /* number of domain groups in domain */
00602         uint32 num_local_grps; /* number of local groups in domain */
00603 
00604         UNISTR2 uni_comment; /* comment unicode string */
00605         UNISTR2 uni_domain; /* domain name unicode string */
00606         UNISTR2 uni_server; /* server name unicode string */
00607 
00608 } SAM_UNK_INFO_2;
00609 
00610 typedef struct sam_unknown_info_3_info
00611 {
00612         NTTIME logout;  
00613         /* 0x8000 0000 */ /* DON'T forcibly disconnect remote users from server when logon hours expire*/
00614         /* 0x0000 0000 */ /* forcibly disconnect remote users from server when logon hours expire*/
00615 
00616 } SAM_UNK_INFO_3;
00617 
00618 typedef struct sam_unknown_info_4_inf
00619 {
00620         UNIHDR hdr_comment; /* comment according to samba4 idl */
00621         UNISTR2 uni_comment; /* comment unicode string */
00622 
00623 } SAM_UNK_INFO_4;
00624 
00625 typedef struct sam_unknown_info_5_inf
00626 {
00627         UNIHDR hdr_domain; /* domain name unicode header */
00628         UNISTR2 uni_domain; /* domain name unicode string */
00629 
00630 } SAM_UNK_INFO_5;
00631 
00632 typedef struct sam_unknown_info_6_info
00633 {
00634         UNIHDR hdr_server; /* server name unicode header */
00635         UNISTR2 uni_server; /* server name unicode string */
00636 
00637 } SAM_UNK_INFO_6;
00638 
00639 typedef struct sam_unknown_info_7_info
00640 {
00641         uint16 server_role;
00642 
00643 } SAM_UNK_INFO_7;
00644 
00645 typedef struct sam_unknown_info_8_info
00646 {
00647         uint64 seq_num;
00648         NTTIME domain_create_time;
00649 
00650 } SAM_UNK_INFO_8;
00651 
00652 typedef struct sam_unknown_info_9_info
00653 {
00654         uint32 unknown;
00655 
00656 } SAM_UNK_INFO_9;
00657 
00658 typedef struct sam_unknown_info_12_inf
00659 {
00660         NTTIME duration;
00661         NTTIME reset_count;
00662         uint16 bad_attempt_lockout;
00663 
00664 } SAM_UNK_INFO_12;
00665 
00666 typedef struct sam_unknown_info_13_info
00667 {
00668         uint64 seq_num;
00669         NTTIME domain_create_time;
00670         uint32 unknown1;
00671         uint32 unknown2;
00672 
00673 } SAM_UNK_INFO_13;
00674 
00675 typedef struct sam_unknown_ctr_info
00676 {
00677         union
00678         {
00679                 SAM_UNK_INFO_1 inf1;
00680                 SAM_UNK_INFO_2 inf2;
00681                 SAM_UNK_INFO_3 inf3;
00682                 SAM_UNK_INFO_4 inf4;
00683                 SAM_UNK_INFO_5 inf5;
00684                 SAM_UNK_INFO_6 inf6;
00685                 SAM_UNK_INFO_7 inf7;
00686                 SAM_UNK_INFO_8 inf8;
00687                 SAM_UNK_INFO_9 inf9;
00688                 SAM_UNK_INFO_12 inf12;
00689                 SAM_UNK_INFO_13 inf13;
00690 
00691         } info;
00692 
00693 } SAM_UNK_CTR;
00694 
00695 
00696 /* SAMR_R_QUERY_DOMAIN_INFO - */
00697 typedef struct r_samr_query_domain_info
00698 {
00699         uint32 ptr_0;
00700         uint16 switch_value; /* same as in query */
00701 
00702         SAM_UNK_CTR *ctr;
00703 
00704         NTSTATUS status;         /* return status */
00705 
00706 } SAMR_R_QUERY_DOMAIN_INFO;
00707 
00708 
00709 /* SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain */
00710 typedef struct q_samr_lookup_domain_info
00711 {
00712         POLICY_HND connect_pol;
00713 
00714         UNIHDR  hdr_domain;
00715         UNISTR2 uni_domain;
00716 
00717 } SAMR_Q_LOOKUP_DOMAIN;
00718 
00719 
00720 /* SAMR_R_LOOKUP_DOMAIN */
00721 typedef struct r_samr_lookup_domain_info
00722 {
00723         uint32   ptr_sid;
00724         DOM_SID2 dom_sid;
00725 
00726         NTSTATUS status;
00727 
00728 } SAMR_R_LOOKUP_DOMAIN;
00729 
00730 
00731 /****************************************************************************
00732 SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs:
00733 
00734 0x0000 03f1 and a specific   domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
00735 0x0000 0200 and a specific   domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0
00736 *****************************************************************************/
00737 
00738 /* SAMR_Q_OPEN_DOMAIN */
00739 typedef struct q_samr_open_domain_info
00740 {
00741         POLICY_HND pol;   /* policy handle */
00742         uint32 flags;               /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */
00743         DOM_SID2 dom_sid;         /* domain SID */
00744 
00745 } SAMR_Q_OPEN_DOMAIN;
00746 
00747 
00748 /* SAMR_R_OPEN_DOMAIN - probably an open */
00749 typedef struct r_samr_open_domain_info
00750 {
00751         POLICY_HND domain_pol; /* policy handle associated with the SID */
00752         NTSTATUS status;         /* return status */
00753 
00754 } SAMR_R_OPEN_DOMAIN;
00755 
00756 #define MAX_SAM_ENTRIES_W2K 0x400
00757 #define MAX_SAM_ENTRIES_W95 50
00758 /* The following should be the greater of the preceeding two. */
00759 #define MAX_SAM_ENTRIES MAX_SAM_ENTRIES_W2K
00760 
00761 typedef struct samr_entry_info
00762 {
00763         uint32 rid;
00764         UNIHDR hdr_name;
00765 
00766 } SAM_ENTRY;
00767 
00768 
00769 /* SAMR_Q_ENUM_DOMAINS - SAM rids and names */
00770 typedef struct q_samr_enum_domains_info
00771 {
00772         POLICY_HND pol;     /* policy handle */
00773 
00774         uint32 start_idx;   /* enumeration handle */
00775         uint32 max_size;    /* 0x0000 ffff */
00776 
00777 } SAMR_Q_ENUM_DOMAINS;
00778 
00779 /* SAMR_R_ENUM_DOMAINS - SAM rids and Domain names */
00780 typedef struct r_samr_enum_domains_info
00781 {
00782         uint32 next_idx;     /* next starting index required for enum */
00783         uint32 ptr_entries1;  
00784 
00785         uint32 num_entries2;
00786         uint32 ptr_entries2;
00787 
00788         uint32 num_entries3;
00789 
00790         SAM_ENTRY *sam;
00791         UNISTR2 *uni_dom_name;
00792 
00793         uint32 num_entries4;
00794 
00795         NTSTATUS status;
00796 
00797 } SAMR_R_ENUM_DOMAINS;
00798 
00799 /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
00800 typedef struct q_samr_enum_dom_users_info
00801 {
00802         POLICY_HND pol;          /* policy handle */
00803 
00804         uint32 start_idx;   /* number of values (0 indicates unlimited?) */
00805         uint32 acb_mask;          /* 0x0000 indicates all */
00806 
00807         uint32 max_size;              /* 0x0000 ffff */
00808 
00809 } SAMR_Q_ENUM_DOM_USERS;
00810 
00811 
00812 /* SAMR_R_ENUM_DOM_USERS - SAM rids and names */
00813 typedef struct r_samr_enum_dom_users_info
00814 {
00815         uint32 next_idx;     /* next starting index required for enum */
00816         uint32 ptr_entries1;  
00817 
00818         uint32 num_entries2;
00819         uint32 ptr_entries2;
00820 
00821         uint32 num_entries3;
00822 
00823         SAM_ENTRY *sam;
00824         UNISTR2 *uni_acct_name;
00825 
00826         uint32 num_entries4;
00827 
00828         NTSTATUS status;
00829 
00830 } SAMR_R_ENUM_DOM_USERS;
00831 
00832 
00833 /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */
00834 typedef struct q_samr_enum_dom_groups_info
00835 {
00836         POLICY_HND pol;          /* policy handle */
00837 
00838         /* this is possibly an enumeration context handle... */
00839         uint32 start_idx;         /* 0x0000 0000 */
00840 
00841         uint32 max_size;              /* 0x0000 ffff */
00842 
00843 } SAMR_Q_ENUM_DOM_GROUPS;
00844 
00845 
00846 /* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */
00847 typedef struct r_samr_enum_dom_groups_info
00848 {
00849         uint32 next_idx;
00850         uint32 ptr_entries1;
00851 
00852         uint32 num_entries2;
00853         uint32 ptr_entries2;
00854 
00855         uint32 num_entries3;
00856 
00857         SAM_ENTRY *sam;
00858         UNISTR2 *uni_grp_name;
00859 
00860         uint32 num_entries4;
00861 
00862         NTSTATUS status;
00863 
00864 } SAMR_R_ENUM_DOM_GROUPS;
00865 
00866 
00867 /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */
00868 typedef struct q_samr_enum_dom_aliases_info
00869 {
00870         POLICY_HND pol;          /* policy handle */
00871 
00872         /* this is possibly an enumeration context handle... */
00873         uint32 start_idx;         /* 0x0000 0000 */
00874 
00875         uint32 max_size;              /* 0x0000 ffff */
00876 
00877 } SAMR_Q_ENUM_DOM_ALIASES;
00878 
00879 
00880 /* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */
00881 typedef struct r_samr_enum_dom_aliases_info
00882 {
00883         uint32 next_idx;
00884         uint32 ptr_entries1;
00885 
00886         uint32 num_entries2;
00887         uint32 ptr_entries2;
00888 
00889         uint32 num_entries3;
00890 
00891         SAM_ENTRY *sam;
00892         UNISTR2 *uni_grp_name;
00893 
00894         uint32 num_entries4;
00895 
00896         NTSTATUS status;
00897 
00898 } SAMR_R_ENUM_DOM_ALIASES;
00899 
00900 
00901 /* -- Level 1 Display Info - User Information -- */
00902 
00903 typedef struct samr_entry_info1
00904 {
00905         uint32 user_idx;
00906 
00907         uint32 rid_user;
00908         uint32 acb_info;
00909 
00910         UNIHDR hdr_acct_name;
00911         UNIHDR hdr_user_name;
00912         UNIHDR hdr_user_desc;
00913 
00914 } SAM_ENTRY1;
00915 
00916 typedef struct samr_str_entry_info1
00917 {
00918         UNISTR2 uni_acct_name;
00919         UNISTR2 uni_full_name;
00920         UNISTR2 uni_acct_desc;
00921 
00922 } SAM_STR1;
00923 
00924 typedef struct sam_entry_info_1
00925 {
00926         SAM_ENTRY1 *sam;
00927         SAM_STR1   *str;
00928 
00929 } SAM_DISPINFO_1;
00930 
00931 
00932 /* -- Level 2 Display Info - Trust Account Information -- */
00933 
00934 typedef struct samr_entry_info2
00935 {
00936         uint32 user_idx;
00937 
00938         uint32 rid_user;
00939         uint32 acb_info;
00940 
00941         UNIHDR hdr_srv_name;
00942         UNIHDR hdr_srv_desc;
00943 
00944 } SAM_ENTRY2;
00945 
00946 typedef struct samr_str_entry_info2
00947 {
00948         UNISTR2 uni_srv_name;
00949         UNISTR2 uni_srv_desc;
00950 
00951 } SAM_STR2;
00952 
00953 typedef struct sam_entry_info_2
00954 {
00955         SAM_ENTRY2 *sam;
00956         SAM_STR2   *str;
00957 
00958 } SAM_DISPINFO_2;
00959 
00960 
00961 /* -- Level 3 Display Info - Domain Group Information -- */
00962 
00963 typedef struct samr_entry_info3
00964 {
00965         uint32 grp_idx;
00966 
00967         uint32 rid_grp;
00968         uint32 attr;     /* SE_GROUP_xxx, usually 7 */
00969 
00970         UNIHDR hdr_grp_name;
00971         UNIHDR hdr_grp_desc;
00972 
00973 } SAM_ENTRY3;
00974 
00975 typedef struct samr_str_entry_info3
00976 {
00977         UNISTR2 uni_grp_name;
00978         UNISTR2 uni_grp_desc;
00979 
00980 } SAM_STR3;
00981 
00982 typedef struct sam_entry_info_3
00983 {
00984         SAM_ENTRY3 *sam;
00985         SAM_STR3   *str;
00986 
00987 } SAM_DISPINFO_3;
00988 
00989 
00990 /* -- Level 4 Display Info - User List (ASCII) -- */
00991 
00992 typedef struct samr_entry_info4
00993 {
00994         uint32 user_idx;
00995         STRHDR hdr_acct_name;
00996 
00997 } SAM_ENTRY4;
00998 
00999 typedef struct samr_str_entry_info4
01000 {
01001         STRING2 acct_name;
01002 
01003 } SAM_STR4;
01004 
01005 typedef struct sam_entry_info_4
01006 {
01007         SAM_ENTRY4 *sam;
01008         SAM_STR4   *str;
01009 
01010 } SAM_DISPINFO_4;
01011 
01012 
01013 /* -- Level 5 Display Info - Group List (ASCII) -- */
01014 
01015 typedef struct samr_entry_info5
01016 {
01017         uint32 grp_idx;
01018         STRHDR hdr_grp_name;
01019 
01020 } SAM_ENTRY5;
01021 
01022 typedef struct samr_str_entry_info5
01023 {
01024         STRING2 grp_name;
01025 
01026 } SAM_STR5;
01027 
01028 typedef struct sam_entry_info_5
01029 {
01030         SAM_ENTRY5 *sam;
01031         SAM_STR5   *str;
01032 
01033 } SAM_DISPINFO_5;
01034 
01035 
01036 typedef struct sam_dispinfo_ctr_info
01037 {
01038         union
01039         {
01040                 SAM_DISPINFO_1 *info1; /* users/names/descriptions */
01041                 SAM_DISPINFO_2 *info2; /* trust accounts */
01042                 SAM_DISPINFO_3 *info3; /* domain groups/descriptions */
01043                 SAM_DISPINFO_4 *info4; /* user list (ASCII) - used by Win95 */
01044                 SAM_DISPINFO_5 *info5; /* group list (ASCII) */
01045                 void       *info; /* allows assignment without typecasting, */
01046 
01047         } sam;
01048 
01049 } SAM_DISPINFO_CTR;
01050 
01051 
01052 /* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */
01053 typedef struct q_samr_query_disp_info
01054 {
01055         POLICY_HND domain_pol;
01056 
01057         uint16 switch_level;    /* see SAM_DISPINFO_CTR above */
01058         /* align */
01059 
01060         uint32 start_idx;       /* start enumeration index */
01061         uint32 max_entries;     /* maximum number of entries to return */
01062         uint32 max_size;        /* recommended data size; if exceeded server
01063                                    should return STATUS_MORE_ENTRIES */
01064 
01065 } SAMR_Q_QUERY_DISPINFO;
01066 
01067 
01068 /* SAMR_R_QUERY_DISPINFO  */
01069 typedef struct r_samr_query_dispinfo_info
01070 {
01071         uint32 total_size;     /* total data size for all matching entries
01072                                   (0 = uncalculated) */
01073         uint32 data_size;      /* actual data size returned = size of SAM_ENTRY
01074                                   structures + total length of strings */
01075 
01076         uint16 switch_level;   /* see SAM_DISPINFO_CTR above */
01077         /* align */
01078 
01079         uint32 num_entries;    /* number of entries returned */
01080         uint32 ptr_entries;
01081         uint32 num_entries2;
01082 
01083         SAM_DISPINFO_CTR *ctr;
01084 
01085         NTSTATUS status;
01086 
01087 } SAMR_R_QUERY_DISPINFO;
01088 
01089 /* SAMR_Q_GET_DISPENUM_INDEX */
01090 typedef struct q_samr_get_dispenum_index
01091 {
01092         POLICY_HND domain_pol;
01093         uint16 switch_level;
01094         LSA_STRING name;
01095 
01096 } SAMR_Q_GET_DISPENUM_INDEX;
01097 
01098 /* SAMR_R_GET_DISPENUM_INDEX */
01099 typedef struct r_samr_get_dispenum_index
01100 {
01101         uint32 idx;
01102         NTSTATUS status;
01103         
01104 } SAMR_R_GET_DISPENUM_INDEX;
01105 
01106 /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */
01107 typedef struct q_samr_delete_dom_group_info
01108 {
01109     POLICY_HND group_pol;          /* policy handle */
01110 
01111 } SAMR_Q_DELETE_DOM_GROUP;
01112 
01113 
01114 /* SAMR_R_DELETE_DOM_GROUP - delete domain group */
01115 typedef struct r_samr_delete_dom_group_info
01116 {
01117         POLICY_HND pol;       /* policy handle */
01118         NTSTATUS status;        /* return status */
01119 
01120 } SAMR_R_DELETE_DOM_GROUP;
01121 
01122 
01123 /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */
01124 typedef struct q_samr_create_dom_group_info
01125 {
01126         POLICY_HND pol;        /* policy handle */
01127 
01128         UNIHDR hdr_acct_desc;
01129         UNISTR2 uni_acct_desc;
01130 
01131         uint32 access_mask;    
01132 
01133 } SAMR_Q_CREATE_DOM_GROUP;
01134 
01135 /* SAMR_R_CREATE_DOM_GROUP - SAM create group */
01136 typedef struct r_samr_create_dom_group_info
01137 {
01138         POLICY_HND pol;        /* policy handle */
01139 
01140         uint32 rid;    
01141         NTSTATUS status;    
01142 
01143 } SAMR_R_CREATE_DOM_GROUP;
01144 
01145 /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */
01146 typedef struct q_samr_query_group_info
01147 {
01148         POLICY_HND pol;        /* policy handle */
01149 
01150         uint16 switch_level;    /* 0x0001 seen */
01151 
01152 } SAMR_Q_QUERY_GROUPINFO;
01153 
01154 typedef struct samr_group_info1
01155 {
01156         UNIHDR hdr_acct_name;
01157 
01158         uint32 group_attr; /* 0x0000 0003 - group attribute */
01159         uint32 num_members; /* 0x0000 0001 - number of group members? */
01160 
01161         UNIHDR hdr_acct_desc;
01162 
01163         UNISTR2 uni_acct_name;
01164         UNISTR2 uni_acct_desc;
01165 
01166 } GROUP_INFO1;
01167 
01168 typedef struct samr_group_info2
01169 {
01170         uint16 level;
01171         UNIHDR hdr_acct_name;
01172         UNISTR2 uni_acct_name;
01173 
01174 } GROUP_INFO2;
01175 
01176 typedef struct samr_group_info3
01177 {
01178         uint32 group_attr; /* 0x0000 0003 - group attribute */
01179 
01180 } GROUP_INFO3;
01181 
01182 typedef struct samr_group_info4
01183 {
01184         uint16 level;
01185         UNIHDR hdr_acct_desc;
01186         UNISTR2 uni_acct_desc;
01187 
01188 } GROUP_INFO4;
01189 
01190 typedef struct samr_group_info5
01191 {
01192         UNIHDR hdr_acct_name;
01193 
01194         uint32 group_attr; /* 0x0000 0003 - group attribute */
01195         uint32 num_members; /* 0x0000 0001 - number of group members? */
01196 
01197         UNIHDR hdr_acct_desc;
01198 
01199         UNISTR2 uni_acct_name;
01200         UNISTR2 uni_acct_desc;
01201 
01202 } GROUP_INFO5;
01203 
01204 
01205 /* GROUP_INFO_CTR */
01206 typedef struct group_info_ctr
01207 {
01208         uint16 switch_value1;
01209 
01210         union
01211         {
01212                 GROUP_INFO1 info1;
01213                 GROUP_INFO2 info2;
01214                 GROUP_INFO3 info3;
01215                 GROUP_INFO4 info4;
01216                 GROUP_INFO5 info5;
01217         } group;
01218 
01219 } GROUP_INFO_CTR;
01220 
01221 /* SAMR_R_QUERY_GROUPINFO - SAM Group Info */
01222 typedef struct r_samr_query_groupinfo_info
01223 {
01224         uint32 ptr;        
01225         GROUP_INFO_CTR *ctr;
01226 
01227         NTSTATUS status;
01228 
01229 } SAMR_R_QUERY_GROUPINFO;
01230 
01231 
01232 /* SAMR_Q_SET_GROUPINFO - SAM Group Info */
01233 typedef struct q_samr_set_group_info
01234 {
01235         POLICY_HND pol;        /* policy handle */
01236         GROUP_INFO_CTR *ctr;
01237 
01238 } SAMR_Q_SET_GROUPINFO;
01239 
01240 /* SAMR_R_SET_GROUPINFO - SAM Group Info */
01241 typedef struct r_samr_set_group_info
01242 {
01243         NTSTATUS status;
01244 
01245 } SAMR_R_SET_GROUPINFO;
01246 
01247 
01248 /* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */
01249 typedef struct q_samr_delete_dom_alias_info
01250 {
01251     POLICY_HND alias_pol;          /* policy handle */
01252 
01253 } SAMR_Q_DELETE_DOM_ALIAS;
01254 
01255 
01256 /* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */
01257 typedef struct r_samr_delete_dom_alias_info
01258 {
01259         POLICY_HND pol;       /* policy handle */
01260         NTSTATUS status;        /* return status */
01261 
01262 } SAMR_R_DELETE_DOM_ALIAS;
01263 
01264 
01265 /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */
01266 typedef struct q_samr_create_dom_alias_info
01267 {
01268         POLICY_HND dom_pol;        /* policy handle */
01269 
01270         UNIHDR hdr_acct_desc;
01271         UNISTR2 uni_acct_desc;
01272 
01273         uint32 access_mask;    /* 0x001f000f */
01274 
01275 } SAMR_Q_CREATE_DOM_ALIAS;
01276 
01277 /* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */
01278 typedef struct r_samr_create_dom_alias_info
01279 {
01280         POLICY_HND alias_pol;        /* policy handle */
01281 
01282         uint32 rid;    
01283         NTSTATUS status;    
01284 
01285 } SAMR_R_CREATE_DOM_ALIAS;
01286 
01287 
01288 /********************************************************/
01289 
01290 typedef struct {
01291         UNISTR4 name;
01292         UNISTR4 description;
01293         uint32 num_member;
01294 } ALIAS_INFO1;
01295 
01296 typedef struct {
01297         UNISTR4 name;
01298 } ALIAS_INFO2;
01299 
01300 typedef struct {
01301         UNISTR4 description;
01302 } ALIAS_INFO3;
01303 
01304 typedef struct {
01305         POLICY_HND pol;        /* policy handle */
01306         uint16 level;    /* 0x0003 seen */
01307 } SAMR_Q_QUERY_ALIASINFO;
01308 
01309 typedef struct {
01310         uint16 level;
01311         union {
01312                 ALIAS_INFO1 info1;
01313                 ALIAS_INFO2 info2;
01314                 ALIAS_INFO3 info3;
01315         } alias;
01316 } ALIAS_INFO_CTR;
01317 
01318 typedef struct {
01319         ALIAS_INFO_CTR *ctr;
01320         NTSTATUS status;
01321 } SAMR_R_QUERY_ALIASINFO;
01322 
01323 
01324 /********************************************************/
01325 
01326 typedef struct {
01327         POLICY_HND alias_pol;        /* policy handle */
01328         ALIAS_INFO_CTR ctr;
01329 } SAMR_Q_SET_ALIASINFO;
01330 
01331 typedef struct {
01332         NTSTATUS status;
01333 } SAMR_R_SET_ALIASINFO;
01334 
01335 
01336 /********************************************************/
01337 
01338 /* SAMR_Q_QUERY_USERGROUPS - */
01339 typedef struct q_samr_query_usergroup_info
01340 {
01341         POLICY_HND pol;          /* policy handle associated with unknown id */
01342 
01343 } SAMR_Q_QUERY_USERGROUPS;
01344 
01345 /* SAMR_R_QUERY_USERGROUPS - probably a get sam info */
01346 typedef struct r_samr_query_usergroup_info
01347 {
01348         uint32 ptr_0;            /* pointer */
01349         uint32 num_entries;      /* number of RID groups */
01350         uint32 ptr_1;            /* pointer */
01351         uint32 num_entries2;     /* number of RID groups */
01352 
01353         DOM_GID *gid; /* group info */
01354 
01355         NTSTATUS status;         /* return status */
01356 
01357 } SAMR_R_QUERY_USERGROUPS;
01358 
01359 /* SAM_USERINFO_CTR - sam user info */
01360 typedef struct sam_userinfo_ctr_info
01361 {
01362         uint16 switch_value;      
01363 
01364         union
01365         {
01366                 SAM_USER_INFO_7  *id7;
01367                 SAM_USER_INFO_9  *id9;
01368                 SAM_USER_INFO_16 *id16;
01369                 SAM_USER_INFO_17 *id17;
01370                 SAM_USER_INFO_18 *id18;
01371                 SAM_USER_INFO_20 *id20;
01372                 SAM_USER_INFO_21 *id21;
01373                 SAM_USER_INFO_23 *id23;
01374                 SAM_USER_INFO_24 *id24;
01375                 SAM_USER_INFO_25 *id25;
01376                 SAM_USER_INFO_26 *id26;
01377                 void* id; /* to make typecasting easy */
01378 
01379         } info;
01380 
01381 } SAM_USERINFO_CTR;
01382 
01383 
01384 /* SAMR_Q_SET_USERINFO2 - set sam info */
01385 typedef struct q_samr_set_user_info2
01386 {
01387         POLICY_HND pol;          /* policy handle associated with user */
01388         uint16 switch_value;      /* 0x0010 */
01389 
01390         SAM_USERINFO_CTR *ctr;
01391 
01392 } SAMR_Q_SET_USERINFO2;
01393 
01394 /* SAMR_R_SET_USERINFO2 - set sam info */
01395 typedef struct r_samr_set_user_info2
01396 {
01397         NTSTATUS status;         /* return status */
01398 
01399 } SAMR_R_SET_USERINFO2;
01400 
01401 /* SAMR_Q_SET_USERINFO - set sam info */
01402 typedef struct q_samr_set_user_info
01403 {
01404         POLICY_HND pol;          /* policy handle associated with user */
01405         uint16 switch_value;
01406         SAM_USERINFO_CTR *ctr;
01407 
01408 } SAMR_Q_SET_USERINFO;
01409 
01410 /* SAMR_R_SET_USERINFO - set sam info */
01411 typedef struct r_samr_set_user_info
01412 {
01413         NTSTATUS status;         /* return status */
01414 
01415 } SAMR_R_SET_USERINFO;
01416 
01417 
01418 /* SAMR_Q_QUERY_USERINFO - probably a get sam info */
01419 typedef struct q_samr_query_user_info
01420 {
01421         POLICY_HND pol;          /* policy handle associated with unknown id */
01422         uint16 switch_value;         /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */
01423 
01424 } SAMR_Q_QUERY_USERINFO;
01425 
01426 /* SAMR_R_QUERY_USERINFO - probably a get sam info */
01427 typedef struct r_samr_query_user_info
01428 {
01429         uint32 ptr;            /* pointer */
01430         SAM_USERINFO_CTR *ctr;
01431 
01432         NTSTATUS status;         /* return status */
01433 
01434 } SAMR_R_QUERY_USERINFO;
01435 
01436 
01437 /****************************************************************************
01438 SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID.
01439 
01440 the policy handle allocated by an "samr open secret" call is associated
01441 with a SID.  this policy handle is what is queried here, *not* the SID
01442 itself.  the response to the lookup rids is relative to this SID.
01443 *****************************************************************************/
01444 /* SAMR_Q_QUERY_USERALIASES */
01445 typedef struct q_samr_query_useraliases_info
01446 {
01447         POLICY_HND pol;       /* policy handle */
01448 
01449         uint32 num_sids1;      /* number of rids being looked up */
01450         uint32 ptr;            /* buffer pointer */
01451         uint32 num_sids2;      /* number of rids being looked up */
01452 
01453         uint32   *ptr_sid; /* pointers to sids to be looked up */
01454         DOM_SID2 *sid    ; /* sids to be looked up. */
01455 
01456 } SAMR_Q_QUERY_USERALIASES;
01457 
01458 
01459 /* SAMR_R_QUERY_USERALIASES */
01460 typedef struct r_samr_query_useraliases_info
01461 {
01462         uint32 num_entries;
01463         uint32 ptr; /* undocumented buffer pointer */
01464 
01465         uint32 num_entries2; 
01466         uint32 *rid; /* domain RIDs being looked up */
01467 
01468         NTSTATUS status; /* return code */
01469 
01470 } SAMR_R_QUERY_USERALIASES;
01471 
01472 
01473 /****************************************************************************
01474 SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types.
01475 *****************************************************************************/
01476 /* SAMR_Q_LOOKUP_NAMES */
01477 typedef struct q_samr_lookup_names_info
01478 {
01479         POLICY_HND pol;       /* policy handle */
01480 
01481         uint32 num_names1;      /* number of names being looked up */
01482         uint32 flags;           /* 0x0000 03e8 - unknown */
01483         uint32 ptr;            /* 0x0000 0000 - 32 bit unknown */
01484         uint32 num_names2;      /* number of names being looked up */
01485 
01486         UNIHDR  *hdr_name; /* unicode account name header */
01487         UNISTR2 *uni_name; /* unicode account name string */
01488 
01489 } SAMR_Q_LOOKUP_NAMES;
01490 
01491 
01492 /* SAMR_R_LOOKUP_NAMES */
01493 typedef struct r_samr_lookup_names_info
01494 {
01495         uint32 num_rids1;      /* number of aliases being looked up */
01496         uint32 ptr_rids;       /* pointer to aliases */
01497         uint32 num_rids2;      /* number of aliases being looked up */
01498 
01499         uint32 *rids; /* rids */
01500 
01501         uint32 num_types1;      /* number of users in aliases being looked up */
01502         uint32 ptr_types;       /* pointer to users in aliases */
01503         uint32 num_types2;      /* number of users in aliases being looked up */
01504 
01505         uint32 *types; /* SID_ENUM type */
01506 
01507         NTSTATUS status; /* return code */
01508 
01509 } SAMR_R_LOOKUP_NAMES;
01510 
01511 
01512 /****************************************************************************
01513 SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something.
01514 
01515 called to resolve domain RID groups.
01516 *****************************************************************************/
01517 /* SAMR_Q_LOOKUP_RIDS */
01518 typedef struct q_samr_lookup_rids_info
01519 {
01520         POLICY_HND pol;       /* policy handle */
01521 
01522         uint32 num_rids1;      /* number of rids being looked up */
01523         uint32 flags;          /* 0x0000 03e8 - unknown */
01524         uint32 ptr;            /* 0x0000 0000 - 32 bit unknown */
01525         uint32 num_rids2;      /* number of rids being looked up */
01526 
01527         uint32 *rid; /* domain RIDs being looked up */
01528 
01529 } SAMR_Q_LOOKUP_RIDS;
01530 
01531 
01532 /****************************************************************************
01533 SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names
01534 
01535 *****************************************************************************/
01536 /* SAMR_R_LOOKUP_RIDS */
01537 typedef struct r_samr_lookup_rids_info
01538 {
01539         uint32 num_names1;      /* number of aliases being looked up */
01540         uint32 ptr_names;       /* pointer to aliases */
01541         uint32 num_names2;      /* number of aliases being looked up */
01542 
01543         UNIHDR  *hdr_name; /* unicode account name header */
01544         UNISTR2 *uni_name; /* unicode account name string */
01545 
01546         uint32 num_types1;      /* number of users in aliases being looked up */
01547         uint32 ptr_types;       /* pointer to users in aliases */
01548         uint32 num_types2;      /* number of users in aliases being looked up */
01549 
01550         uint32 *type; /* SID_ENUM type */
01551 
01552         NTSTATUS status;
01553 
01554 } SAMR_R_LOOKUP_RIDS;
01555 
01556 
01557 /* SAMR_Q_OPEN_USER - probably an open */
01558 typedef struct q_samr_open_user_info
01559 {
01560         POLICY_HND domain_pol;       /* policy handle */
01561         uint32 access_mask;     /* 32 bit unknown - 0x02011b */
01562         uint32 user_rid;      /* user RID */
01563 
01564 } SAMR_Q_OPEN_USER;
01565 
01566 
01567 /* SAMR_R_OPEN_USER - probably an open */
01568 typedef struct r_samr_open_user_info
01569 {
01570         POLICY_HND user_pol;       /* policy handle associated with unknown id */
01571         NTSTATUS status;         /* return status */
01572 
01573 } SAMR_R_OPEN_USER;
01574 
01575 
01576 /* SAMR_Q_CREATE_USER - probably a create */
01577 typedef struct q_samr_create_user_info
01578 {
01579         POLICY_HND domain_pol;       /* policy handle */
01580 
01581         UNIHDR  hdr_name;       /* unicode account name header */
01582         UNISTR2 uni_name;       /* unicode account name */
01583 
01584         uint32 acb_info;      /* account control info */
01585         uint32 acct_flags;     /* 0xe005 00b0 */
01586 
01587 } SAMR_Q_CREATE_USER;
01588 
01589 
01590 /* SAMR_R_CREATE_USER - probably a create */
01591 typedef struct r_samr_create_user_info
01592 {
01593         POLICY_HND user_pol;       /* policy handle associated with user */
01594 
01595         uint32 access_granted;
01596         uint32 user_rid;      /* user RID */
01597         NTSTATUS status;         /* return status */
01598 
01599 } SAMR_R_CREATE_USER;
01600 
01601 
01602 /* SAMR_Q_DELETE_DOM_USER - delete domain user */
01603 typedef struct q_samr_delete_dom_user_info
01604 {
01605     POLICY_HND user_pol;          /* policy handle */
01606 
01607 } SAMR_Q_DELETE_DOM_USER;
01608 
01609 
01610 /* SAMR_R_DELETE_DOM_USER - delete domain user */
01611 typedef struct r_samr_delete_dom_user_info
01612 {
01613         POLICY_HND pol;       /* policy handle */
01614         NTSTATUS status;        /* return status */
01615 
01616 } SAMR_R_DELETE_DOM_USER;
01617 
01618 
01619 /* SAMR_Q_QUERY_GROUPMEM - query group members */
01620 typedef struct q_samr_query_groupmem_info
01621 {
01622         POLICY_HND group_pol;        /* policy handle */
01623 
01624 } SAMR_Q_QUERY_GROUPMEM;
01625 
01626 
01627 /* SAMR_R_QUERY_GROUPMEM - query group members */
01628 typedef struct r_samr_query_groupmem_info
01629 {
01630         uint32 ptr;
01631         uint32 num_entries;
01632 
01633         uint32 ptr_rids;
01634         uint32 ptr_attrs;
01635 
01636         uint32 num_rids;
01637         uint32 *rid;
01638 
01639         uint32 num_attrs;
01640         uint32 *attr;
01641 
01642         NTSTATUS status;
01643 
01644 } SAMR_R_QUERY_GROUPMEM;
01645 
01646 
01647 /* SAMR_Q_DEL_GROUPMEM - probably an del group member */
01648 typedef struct q_samr_del_group_mem_info
01649 {
01650         POLICY_HND pol;       /* policy handle */
01651         uint32 rid;         /* rid */
01652 
01653 } SAMR_Q_DEL_GROUPMEM;
01654 
01655 
01656 /* SAMR_R_DEL_GROUPMEM - probably an del group member */
01657 typedef struct r_samr_del_group_mem_info
01658 {
01659         NTSTATUS status;         /* return status */
01660 
01661 } SAMR_R_DEL_GROUPMEM;
01662 
01663 
01664 /* SAMR_Q_ADD_GROUPMEM - probably an add group member */
01665 typedef struct q_samr_add_group_mem_info
01666 {
01667         POLICY_HND pol;       /* policy handle */
01668 
01669         uint32 rid;         /* rid */
01670         uint32 unknown;     /* 0x0000 0005 */
01671 
01672 } SAMR_Q_ADD_GROUPMEM;
01673 
01674 
01675 /* SAMR_R_ADD_GROUPMEM - probably an add group member */
01676 typedef struct r_samr_add_group_mem_info
01677 {
01678         NTSTATUS status;         /* return status */
01679 
01680 } SAMR_R_ADD_GROUPMEM;
01681 
01682 
01683 /* SAMR_Q_OPEN_GROUP - probably an open */
01684 typedef struct q_samr_open_group_info
01685 {
01686         POLICY_HND domain_pol;       /* policy handle */
01687         uint32 access_mask;         /* 0x0000 0001, 0x0000 0003, 0x0000 001f */
01688         uint32 rid_group;        /* rid */
01689 
01690 } SAMR_Q_OPEN_GROUP;
01691 
01692 
01693 /* SAMR_R_OPEN_GROUP - probably an open */
01694 typedef struct r_samr_open_group_info
01695 {
01696         POLICY_HND pol;       /* policy handle */
01697         NTSTATUS status;         /* return status */
01698 
01699 } SAMR_R_OPEN_GROUP;
01700 
01701 
01702 /* SAMR_Q_QUERY_ALIASMEM - query alias members */
01703 typedef struct q_samr_query_aliasmem_info
01704 {
01705         POLICY_HND alias_pol;        /* policy handle */
01706 
01707 } SAMR_Q_QUERY_ALIASMEM;
01708 
01709 
01710 /* SAMR_R_QUERY_ALIASMEM - query alias members */
01711 typedef struct r_samr_query_aliasmem_info
01712 {
01713         uint32 num_sids;
01714         uint32 ptr;
01715         uint32 num_sids1;
01716 
01717         DOM_SID2 *sid;
01718 
01719         NTSTATUS status;
01720 
01721 } SAMR_R_QUERY_ALIASMEM;
01722 
01723 
01724 /* SAMR_Q_ADD_ALIASMEM - add alias member */
01725 typedef struct q_samr_add_alias_mem_info
01726 {
01727         POLICY_HND alias_pol;       /* policy handle */
01728 
01729         DOM_SID2 sid; /* member sid to be added to the alias */
01730 
01731 } SAMR_Q_ADD_ALIASMEM;
01732 
01733 
01734 /* SAMR_R_ADD_ALIASMEM - add alias member */
01735 typedef struct r_samr_add_alias_mem_info
01736 {
01737         NTSTATUS status;         /* return status */
01738 
01739 } SAMR_R_ADD_ALIASMEM;
01740 
01741 
01742 /* SAMR_Q_DEL_ALIASMEM - add an add alias member */
01743 typedef struct q_samr_del_alias_mem_info
01744 {
01745         POLICY_HND alias_pol;       /* policy handle */
01746 
01747         DOM_SID2 sid; /* member sid to be added to alias */
01748 
01749 } SAMR_Q_DEL_ALIASMEM;
01750 
01751 
01752 /* SAMR_R_DEL_ALIASMEM - delete alias member */
01753 typedef struct r_samr_del_alias_mem_info
01754 {
01755         NTSTATUS status;         /* return status */
01756 
01757 } SAMR_R_DEL_ALIASMEM;
01758 
01759 
01760 
01761 /* SAMR_Q_OPEN_ALIAS - probably an open */
01762 typedef struct q_samr_open_alias_info
01763 {
01764         POLICY_HND dom_pol;
01765 
01766         uint32 access_mask;         
01767         uint32 rid_alias;
01768 
01769 } SAMR_Q_OPEN_ALIAS;
01770 
01771 
01772 /* SAMR_R_OPEN_ALIAS - probably an open */
01773 typedef struct r_samr_open_alias_info
01774 {
01775         POLICY_HND pol;       /* policy handle */
01776         NTSTATUS status;         /* return status */
01777 
01778 } SAMR_R_OPEN_ALIAS;
01779 
01780 
01781 /* SAMR_Q_CONNECT_ANON - probably an open */
01782 typedef struct q_samr_connect_anon_info {
01783         uint32 ptr;                  /* ptr? */
01784         uint16 unknown_0;            /* Only pushed if ptr is non-zero. */
01785         uint32 access_mask;
01786 } SAMR_Q_CONNECT_ANON;
01787 
01788 /* SAMR_R_CONNECT_ANON - probably an open */
01789 typedef struct r_samr_connect_anon_info
01790 {
01791         POLICY_HND connect_pol;       /* policy handle */
01792         NTSTATUS status;         /* return status */
01793 
01794 } SAMR_R_CONNECT_ANON;
01795 
01796 /* SAMR_Q_CONNECT - probably an open */
01797 typedef struct q_samr_connect_info
01798 {
01799         uint32 ptr_srv_name;         /* pointer (to server name?) */
01800         UNISTR2 uni_srv_name;        /* unicode server name starting with '\\' */
01801 
01802         uint32 access_mask;            
01803 
01804 } SAMR_Q_CONNECT;
01805 
01806 
01807 /* SAMR_R_CONNECT - probably an open */
01808 typedef struct r_samr_connect_info
01809 {
01810         POLICY_HND connect_pol;       /* policy handle */
01811         NTSTATUS status;         /* return status */
01812 
01813 } SAMR_R_CONNECT;
01814 
01815 /* SAMR_Q_CONNECT4 */
01816 typedef struct q_samr_connect4_info
01817 {
01818         uint32 ptr_srv_name; /* pointer to server name */
01819         UNISTR2 uni_srv_name;
01820 
01821         uint32 unk_0; /* possible server name type, 1 for IP num, 2 for name */
01822         uint32 access_mask;
01823 } SAMR_Q_CONNECT4;
01824 
01825 /* SAMR_R_CONNECT4 - same format as connect */
01826 typedef struct r_samr_connect_info SAMR_R_CONNECT4;       
01827 
01828 /* SAMR_Q_CONNECT5 */
01829 typedef struct q_samr_connect5_info
01830 {
01831         uint32 ptr_srv_name; /* pointer to server name */
01832         UNISTR2 uni_srv_name;
01833         uint32 access_mask;
01834         uint32 level;
01835         /* These following are acutally a level dependent
01836            value. Fudge it for now. JRA */
01837         uint32 info1_unk1;
01838         uint32 info1_unk2;
01839 } SAMR_Q_CONNECT5;
01840 
01841 /* SAMR_R_CONNECT5 */
01842 typedef struct r_samr_connect_info5
01843 {
01844         uint32 level;
01845         uint32 info1_unk1;
01846         uint32 info1_unk2;
01847         POLICY_HND connect_pol;       /* policy handle */
01848         NTSTATUS status;         /* return status */
01849 
01850 } SAMR_R_CONNECT5;
01851 
01852 
01853 /* SAMR_Q_GET_DOM_PWINFO */
01854 typedef struct q_samr_get_dom_pwinfo
01855 {
01856         uint32 ptr; 
01857         UNIHDR  hdr_srv_name;
01858         UNISTR2 uni_srv_name;
01859 
01860 } SAMR_Q_GET_DOM_PWINFO;
01861 
01862 #define DOMAIN_PASSWORD_COMPLEX         0x00000001
01863 #define DOMAIN_PASSWORD_NO_ANON_CHANGE  0x00000002
01864 #define DOMAIN_PASSWORD_NO_CLEAR_CHANGE 0x00000004
01865 #define DOMAIN_LOCKOUT_ADMINS           0x00000008
01866 #define DOMAIN_PASSWORD_STORE_CLEARTEXT 0x00000010
01867 #define DOMAIN_REFUSE_PASSWORD_CHANGE   0x00000020
01868 
01869 /* SAMR_R_GET_DOM_PWINFO */
01870 typedef struct r_samr_get_dom_pwinfo
01871 {
01872         uint16 min_pwd_length;
01873         uint32 password_properties;
01874         NTSTATUS status;
01875 
01876 } SAMR_R_GET_DOM_PWINFO;
01877 
01878 /* SAMR_ENC_PASSWD */
01879 typedef struct enc_passwd_info
01880 {
01881         uint32 ptr;
01882         uint8 pass[516];
01883 
01884 } SAMR_ENC_PASSWD;
01885 
01886 /* SAMR_ENC_HASH */
01887 typedef struct enc_hash_info
01888 {
01889         uint32 ptr;
01890         uint8 hash[16];
01891 
01892 } SAMR_ENC_HASH;
01893 
01894 /* SAMR_Q_CHGPASSWD_USER */
01895 typedef struct q_samr_chgpasswd_user_info
01896 {
01897         uint32 ptr_0;
01898 
01899         UNIHDR hdr_dest_host; /* server name unicode header */
01900         UNISTR2 uni_dest_host; /* server name unicode string */
01901 
01902         UNIHDR hdr_user_name;    /* username unicode string header */
01903         UNISTR2 uni_user_name;    /* username unicode string */
01904 
01905         SAMR_ENC_PASSWD nt_newpass;
01906         SAMR_ENC_HASH nt_oldhash;
01907 
01908         uint32 unknown; /* 0x0000 0001 */
01909 
01910         SAMR_ENC_PASSWD lm_newpass;
01911         SAMR_ENC_HASH lm_oldhash;
01912 
01913 } SAMR_Q_CHGPASSWD_USER;
01914 
01915 /* SAMR_R_CHGPASSWD_USER */
01916 typedef struct r_samr_chgpasswd_user_info
01917 {
01918         NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
01919 
01920 } SAMR_R_CHGPASSWD_USER;
01921 
01922 /* SAMR_Q_CHGPASSWD3 */
01923 typedef struct q_samr_chgpasswd_user3
01924 {
01925         uint32 ptr_0;
01926 
01927         UNIHDR hdr_dest_host; /* server name unicode header */
01928         UNISTR2 uni_dest_host; /* server name unicode string */
01929 
01930         UNIHDR hdr_user_name;    /* username unicode string header */
01931         UNISTR2 uni_user_name;    /* username unicode string */
01932 
01933         SAMR_ENC_PASSWD nt_newpass;
01934         SAMR_ENC_HASH nt_oldhash;
01935 
01936         uint32 lm_change; /* 0x0000 0001 */
01937 
01938         SAMR_ENC_PASSWD lm_newpass;
01939         SAMR_ENC_HASH lm_oldhash;
01940 
01941         SAMR_ENC_PASSWD password3;
01942 
01943 } SAMR_Q_CHGPASSWD_USER3;
01944 
01945 #define REJECT_REASON_OTHER             0x00000000
01946 #define REJECT_REASON_TOO_SHORT         0x00000001
01947 #define REJECT_REASON_IN_HISTORY        0x00000002
01948 #define REJECT_REASON_NOT_COMPLEX       0x00000005
01949 
01950 /* SAMR_CHANGE_REJECT */
01951 typedef struct samr_change_reject
01952 {
01953         uint32 reject_reason;
01954         uint32 unknown1;
01955         uint32 unknown2;
01956 
01957 } SAMR_CHANGE_REJECT;
01958 
01959 /* SAMR_R_CHGPASSWD3 */
01960 typedef struct r_samr_chgpasswd_user3
01961 {
01962         uint32 ptr_info;
01963         uint32 ptr_reject;
01964         SAM_UNK_INFO_1 *info;
01965         SAMR_CHANGE_REJECT *reject;
01966         NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */
01967 
01968 } SAMR_R_CHGPASSWD_USER3;
01969 
01970 
01971 
01972 /* SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN */
01973 typedef struct q_samr_remove_sid_foreign_domain_info
01974 {
01975         POLICY_HND dom_pol;   /* policy handle */
01976         DOM_SID2 sid;         /* SID */
01977 
01978 } SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN;
01979 
01980 
01981 /* SAMR_R_REMOVE_SID_FOREIGN_DOMAIN */
01982 typedef struct r_samr_remove_sid_foreign_domain_info
01983 {
01984         NTSTATUS status;         /* return status */
01985 
01986 } SAMR_R_REMOVE_SID_FOREIGN_DOMAIN;
01987 
01988 
01989 
01990 /* these are from the old rpc_samr.h - they are needed while the merge
01991    is still going on */
01992 #define MAX_SAM_SIDS 15
01993 
01994 /* DOM_SID3 - security id */
01995 typedef struct sid_info_3
01996 {
01997         uint16 len; /* length, bytes, including length of len :-) */
01998         /* uint8  pad[2]; */
01999         
02000         DOM_SID sid;
02001 
02002 } DOM_SID3;
02003 
02004 /* SAMR_Q_QUERY_DOMAIN_INFO2 */
02005 typedef struct q_samr_query_domain_info2
02006 {
02007         POLICY_HND domain_pol;   /* policy handle */
02008         uint16 switch_value;
02009 
02010 } SAMR_Q_QUERY_DOMAIN_INFO2;
02011 
02012 /* SAMR_R_QUERY_DOMAIN_INFO2 */
02013 typedef struct r_samr_query_domain_info2
02014 {
02015         uint32 ptr_0;
02016         uint16 switch_value;
02017         SAM_UNK_CTR *ctr;
02018         NTSTATUS status;         /* return status */
02019 
02020 } SAMR_R_QUERY_DOMAIN_INFO2;
02021 
02022 /* SAMR_Q_SET_DOMAIN_INFO */
02023 typedef struct q_samr_set_domain_info
02024 {
02025         POLICY_HND domain_pol;   /* policy handle */
02026         uint16 switch_value0;
02027         uint16 switch_value;
02028         SAM_UNK_CTR *ctr;
02029 
02030 } SAMR_Q_SET_DOMAIN_INFO;
02031 
02032 /* SAMR_R_SET_DOMAIN_INFO */
02033 typedef struct r_samr_set_domain_info
02034 {
02035         NTSTATUS status;         /* return status */
02036 
02037 } SAMR_R_SET_DOMAIN_INFO;
02038 
02039 #endif /* _RPC_SAMR_H */

Sambaに対してSat Aug 29 21:22:56 2009に生成されました。  doxygen 1.4.7