JwaLmAccess.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:92k
源码类别:

Windows编程

开发平台:

Delphi

  1. {******************************************************************************}
  2. {                                                                       }
  3. { Lan Manager Access API interface Unit for Object Pascal                      }
  4. {                                                                       }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
  6. { Corporation. All Rights Reserved.                                            }
  7. {                 }
  8. { The original file is: lmaccess.h, released November 2001. The original Pascal}
  9. { code is: LmAccess.pas, released Februari 2002. The initial developer of the  }
  10. { Pascal code is Marcel van Brakel (brakelm@chello.nl).                        }
  11. {                                                                              }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
  13. { Marcel van Brakel. All Rights Reserved.                                      }
  14. {                 }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  16. {                }
  17. { You may retrieve the latest version of this file at the Project JEDI home    }
  18. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  19. { http://members.chello.nl/m.vanbrakel2                                        }
  20. {                }
  21. { The contents of this file are used with permission, subject to the Mozilla   }
  22. { Public License Version 1.1 (the "License"); you may not use this file except }
  23. { in compliance with the License. You may obtain a copy of the License at      }
  24. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  25. {                                                                              }
  26. { Software distributed under the License is distributed on an "AS IS" basis,   }
  27. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  28. { the specific language governing rights and limitations under the License.    }
  29. {                                                                              }
  30. { Alternatively, the contents of this file may be used under the terms of the  }
  31. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  32. { provisions of the LGPL License are applicable instead of those above.        }
  33. { If you wish to allow use of your version of this file only under the terms   }
  34. { of the LGPL License and not to allow others to use your version of this file }
  35. { under the MPL, indicate your decision by deleting  the provisions above and  }
  36. { replace  them with the notice and other provisions required by the LGPL      }
  37. { License.  If you do not delete the provisions above, a recipient may use     }
  38. { your version of this file under either the MPL or the LGPL License.          }
  39. {                 }
  40. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  41. {                 }
  42. {******************************************************************************}
  43. unit JwaLmAccess;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "lmaccess.h"'}
  47. {$HPPEMIT ''}
  48. {$I WINDEFINES.INC}
  49. interface
  50. uses
  51.   JwaWinNT, JwaWinType, JwaLmCons;
  52. //
  53. // Function Prototypes - User
  54. //
  55. function NetUserAdd(servername: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  56. {$EXTERNALSYM NetUserAdd}
  57. function NetUserEnum(servername: LPCWSTR; level, filter: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries, resume_handle: LPDWORD): NET_API_STATUS; stdcall;
  58. {$EXTERNALSYM NetUserEnum}
  59. function NetUserGetInfo(servername, username: LPCWSTR; level: DWORD; bufptr: LPBYTE): NET_API_STATUS; stdcall;
  60. {$EXTERNALSYM NetUserGetInfo}
  61. function NetUserSetInfo(servername, username: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  62. {$EXTERNALSYM NetUserSetInfo}
  63. function NetUserDel(servername: LPCWSTR; username: LPCWSTR): NET_API_STATUS; stdcall;
  64. {$EXTERNALSYM NetUserDel}
  65. function NetUserGetGroups(servername, username: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries: LPDWORD): NET_API_STATUS; stdcall;
  66. {$EXTERNALSYM NetUserGetGroups}
  67. function NetUserSetGroups(servername, username: LPCWSTR; level: DWORD; buf: LPBYTE; num_entries: DWORD): NET_API_STATUS; stdcall;
  68. {$EXTERNALSYM NetUserSetGroups}
  69. function NetUserGetLocalGroups(servername, username: LPCWSTR; level, flags: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries: LPDWORD): NET_API_STATUS; stdcall;
  70. {$EXTERNALSYM NetUserGetLocalGroups}
  71. function NetUserModalsGet(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  72. {$EXTERNALSYM NetUserModalsGet}
  73. function NetUserModalsSet(servername: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  74. {$EXTERNALSYM NetUserModalsSet}
  75. function NetUserChangePassword(domainname, username, oldpassword, newpassword: LPCWSTR): NET_API_STATUS; stdcall;
  76. {$EXTERNALSYM NetUserChangePassword}
  77. //
  78. //  Data Structures - User
  79. //
  80. type
  81.   LPUSER_INFO_0 = ^USER_INFO_0;
  82.   {$EXTERNALSYM LPUSER_INFO_0}
  83.   PUSER_INFO_0 = ^USER_INFO_0;
  84.   {$EXTERNALSYM PUSER_INFO_0}
  85.   _USER_INFO_0 = record
  86.     usri0_name: LPWSTR;
  87.   end;
  88.   {$EXTERNALSYM _USER_INFO_0}
  89.   USER_INFO_0 = _USER_INFO_0;
  90.   {$EXTERNALSYM USER_INFO_0}
  91.   TUserInfo0 = USER_INFO_0;
  92.   PUserInfo0 = PUSER_INFO_0;
  93.   LPUSER_INFO_1 = ^USER_INFO_1;
  94.   {$EXTERNALSYM LPUSER_INFO_1}
  95.   PUSER_INFO_1 = ^USER_INFO_1;
  96.   {$EXTERNALSYM PUSER_INFO_1}
  97.   _USER_INFO_1 = record
  98.     usri1_name: LPWSTR;
  99.     usri1_password: LPWSTR;
  100.     usri1_password_age: DWORD;
  101.     usri1_priv: DWORD;
  102.     usri1_home_dir: LPWSTR;
  103.     usri1_comment: LPWSTR;
  104.     usri1_flags: DWORD;
  105.     usri1_script_path: LPWSTR;
  106.   end;
  107.   {$EXTERNALSYM _USER_INFO_1}
  108.   USER_INFO_1 = _USER_INFO_1;
  109.   {$EXTERNALSYM USER_INFO_1}
  110.   TUserInfo1 = USER_INFO_1;
  111.   PUserInfo1 = PUSER_INFO_1;
  112.   LPUSER_INFO_2 = ^USER_INFO_2;
  113.   {$EXTERNALSYM LPUSER_INFO_2}
  114.   PUSER_INFO_2 = ^USER_INFO_2;
  115.   {$EXTERNALSYM PUSER_INFO_2}
  116.   _USER_INFO_2 = record
  117.     usri2_name: LPWSTR;
  118.     usri2_password: LPWSTR;
  119.     usri2_password_age: DWORD;
  120.     usri2_priv: DWORD;
  121.     usri2_home_dir: LPWSTR;
  122.     usri2_comment: LPWSTR;
  123.     usri2_flags: DWORD;
  124.     usri2_script_path: LPWSTR;
  125.     usri2_auth_flags: DWORD;
  126.     usri2_full_name: LPWSTR;
  127.     usri2_usr_comment: LPWSTR;
  128.     usri2_parms: LPWSTR;
  129.     usri2_workstations: LPWSTR;
  130.     usri2_last_logon: DWORD;
  131.     usri2_last_logoff: DWORD;
  132.     usri2_acct_expires: DWORD;
  133.     usri2_max_storage: DWORD;
  134.     usri2_units_per_week: DWORD;
  135.     usri2_logon_hours: PBYTE;
  136.     usri2_bad_pw_count: DWORD;
  137.     usri2_num_logons: DWORD;
  138.     usri2_logon_server: LPWSTR;
  139.     usri2_country_code: DWORD;
  140.     usri2_code_page: DWORD;
  141.   end;
  142.   {$EXTERNALSYM _USER_INFO_2}
  143.   USER_INFO_2 = _USER_INFO_2;
  144.   {$EXTERNALSYM USER_INFO_2}
  145.   TUserInfo2 = USER_INFO_2;
  146.   PUserInfo2 = PUSER_INFO_2;
  147.   LPUSER_INFO_3 = ^USER_INFO_3;
  148.   {$EXTERNALSYM LPUSER_INFO_3}
  149.   PUSER_INFO_3 = ^USER_INFO_3;
  150.   {$EXTERNALSYM PUSER_INFO_3}
  151.   _USER_INFO_3 = record
  152.     usri3_name: LPWSTR;
  153.     usri3_password: LPWSTR;
  154.     usri3_password_age: DWORD;
  155.     usri3_priv: DWORD;
  156.     usri3_home_dir: LPWSTR;
  157.     usri3_comment: LPWSTR;
  158.     usri3_flags: DWORD;
  159.     usri3_script_path: LPWSTR;
  160.     usri3_auth_flags: DWORD;
  161.     usri3_full_name: LPWSTR;
  162.     usri3_usr_comment: LPWSTR;
  163.     usri3_parms: LPWSTR;
  164.     usri3_workstations: LPWSTR;
  165.     usri3_last_logon: DWORD;
  166.     usri3_last_logoff: DWORD;
  167.     usri3_acct_expires: DWORD;
  168.     usri3_max_storage: DWORD;
  169.     usri3_units_per_week: DWORD;
  170.     usri3_logon_hours: PBYTE;
  171.     usri3_bad_pw_count: DWORD;
  172.     usri3_num_logons: DWORD;
  173.     usri3_logon_server: LPWSTR;
  174.     usri3_country_code: DWORD;
  175.     usri3_code_page: DWORD;
  176.     usri3_user_id: DWORD;
  177.     usri3_primary_group_id: DWORD;
  178.     usri3_profile: LPWSTR;
  179.     usri3_home_dir_drive: LPWSTR;
  180.     usri3_password_expired: DWORD;
  181.   end;
  182.   {$EXTERNALSYM _USER_INFO_3}
  183.   USER_INFO_3 = _USER_INFO_3;
  184.   {$EXTERNALSYM USER_INFO_3}
  185.   TUserInfo3 = USER_INFO_3;
  186.   PUserInfo3 = PUSER_INFO_3;
  187.   LPUSER_INFO_4 = ^USER_INFO_4;
  188.   {$EXTERNALSYM LPUSER_INFO_4}
  189.   PUSER_INFO_4 = ^USER_INFO_4;
  190.   {$EXTERNALSYM PUSER_INFO_4}
  191.   _USER_INFO_4 = record
  192.     usri4_name: LPWSTR;
  193.     usri4_password: LPWSTR;
  194.     usri4_password_age: DWORD;
  195.     usri4_priv: DWORD;
  196.     usri4_home_dir: LPWSTR;
  197.     usri4_comment: LPWSTR;
  198.     usri4_flags: DWORD;
  199.     usri4_script_path: LPWSTR;
  200.     usri4_auth_flags: DWORD;
  201.     usri4_full_name: LPWSTR;
  202.     usri4_usr_comment: LPWSTR;
  203.     usri4_parms: LPWSTR;
  204.     usri4_workstations: LPWSTR;
  205.     usri4_last_logon: DWORD;
  206.     usri4_last_logoff: DWORD;
  207.     usri4_acct_expires: DWORD;
  208.     usri4_max_storage: DWORD;
  209.     usri4_units_per_week: DWORD;
  210.     usri4_logon_hours: PBYTE;
  211.     usri4_bad_pw_count: DWORD;
  212.     usri4_num_logons: DWORD;
  213.     usri4_logon_server: LPWSTR;
  214.     usri4_country_code: DWORD;
  215.     usri4_code_page: DWORD;
  216.     usri4_user_sid: PSID;
  217.     usri4_primary_group_id: DWORD;
  218.     usri4_profile: LPWSTR;
  219.     usri4_home_dir_drive: LPWSTR;
  220.     usri4_password_expired: DWORD;
  221.   end;
  222.   {$EXTERNALSYM _USER_INFO_4}
  223.   USER_INFO_4 = _USER_INFO_4;
  224.   {$EXTERNALSYM USER_INFO_4}
  225.   TUserInfo4 = USER_INFO_4;
  226.   PUserInfo4 = PUSER_INFO_4;
  227.   LPUSER_INFO_10 = ^USER_INFO_10;
  228.   {$EXTERNALSYM LPUSER_INFO_10}
  229.   PUSER_INFO_10 = ^USER_INFO_10;
  230.   {$EXTERNALSYM PUSER_INFO_10}
  231.   _USER_INFO_10 = record
  232.     usri10_name: LPWSTR;
  233.     usri10_comment: LPWSTR;
  234.     usri10_usr_comment: LPWSTR;
  235.     usri10_full_name: LPWSTR;
  236.   end;
  237.   {$EXTERNALSYM _USER_INFO_10}
  238.   USER_INFO_10 = _USER_INFO_10;
  239.   {$EXTERNALSYM USER_INFO_10}
  240.   TUserInfo10 = USER_INFO_10;
  241.   PUserInfo10 = PUSER_INFO_10;
  242.   LPUSER_INFO_11 = ^USER_INFO_11;
  243.   {$EXTERNALSYM LPUSER_INFO_11}
  244.   PUSER_INFO_11 = ^USER_INFO_11;
  245.   {$EXTERNALSYM PUSER_INFO_11}
  246.   _USER_INFO_11 = record
  247.     usri11_name: LPWSTR;
  248.     usri11_comment: LPWSTR;
  249.     usri11_usr_comment: LPWSTR;
  250.     usri11_full_name: LPWSTR;
  251.     usri11_priv: DWORD;
  252.     usri11_auth_flags: DWORD;
  253.     usri11_password_age: DWORD;
  254.     usri11_home_dir: LPWSTR;
  255.     usri11_parms: LPWSTR;
  256.     usri11_last_logon: DWORD;
  257.     usri11_last_logoff: DWORD;
  258.     usri11_bad_pw_count: DWORD;
  259.     usri11_num_logons: DWORD;
  260.     usri11_logon_server: LPWSTR;
  261.     usri11_country_code: DWORD;
  262.     usri11_workstations: LPWSTR;
  263.     usri11_max_storage: DWORD;
  264.     usri11_units_per_week: DWORD;
  265.     usri11_logon_hours: PBYTE;
  266.     usri11_code_page: DWORD;
  267.   end;
  268.   {$EXTERNALSYM _USER_INFO_11}
  269.   USER_INFO_11 = _USER_INFO_11;
  270.   {$EXTERNALSYM USER_INFO_11}
  271.   TUserInfo11 = USER_INFO_11;
  272.   PUserInfo11 = PUSER_INFO_11;
  273.   LPUSER_INFO_20 = ^USER_INFO_20;
  274.   {$EXTERNALSYM LPUSER_INFO_20}
  275.   PUSER_INFO_20 = ^USER_INFO_20;
  276.   {$EXTERNALSYM PUSER_INFO_20}
  277.   _USER_INFO_20 = record
  278.     usri20_name: LPWSTR;
  279.     usri20_full_name: LPWSTR;
  280.     usri20_comment: LPWSTR;
  281.     usri20_flags: DWORD;
  282.     usri20_user_id: DWORD;
  283.   end;
  284.   {$EXTERNALSYM _USER_INFO_20}
  285.   USER_INFO_20 = _USER_INFO_20;
  286.   {$EXTERNALSYM USER_INFO_20}
  287.   TUserInfo20 = USER_INFO_20;
  288.   PUserInfo20 = PUSER_INFO_20;
  289.   LPUSER_INFO_21 = ^USER_INFO_21;
  290.   {$EXTERNALSYM LPUSER_INFO_21}
  291.   PUSER_INFO_21 = ^USER_INFO_21;
  292.   {$EXTERNALSYM PUSER_INFO_21}
  293.   _USER_INFO_21 = record
  294.     usri21_password: array [0..ENCRYPTED_PWLEN - 1] of BYTE;
  295.   end;
  296.   {$EXTERNALSYM _USER_INFO_21}
  297.   USER_INFO_21 = _USER_INFO_21;
  298.   {$EXTERNALSYM USER_INFO_21}
  299.   TUserInfo21 = USER_INFO_21;
  300.   PUserInfo21 = PUSER_INFO_21;
  301.   LPUSER_INFO_22 = ^USER_INFO_22;
  302.   {$EXTERNALSYM LPUSER_INFO_22}
  303.   PUSER_INFO_22 = ^USER_INFO_22;
  304.   {$EXTERNALSYM PUSER_INFO_22}
  305.   _USER_INFO_22 = record
  306.     usri22_name: LPWSTR;
  307.     usri22_password: array [0..ENCRYPTED_PWLEN - 1] of BYTE;
  308.     usri22_password_age: DWORD;
  309.     usri22_priv: DWORD;
  310.     usri22_home_dir: LPWSTR;
  311.     usri22_comment: LPWSTR;
  312.     usri22_flags: DWORD;
  313.     usri22_script_path: LPWSTR;
  314.     usri22_auth_flags: DWORD;
  315.     usri22_full_name: LPWSTR;
  316.     usri22_usr_comment: LPWSTR;
  317.     usri22_parms: LPWSTR;
  318.     usri22_workstations: LPWSTR;
  319.     usri22_last_logon: DWORD;
  320.     usri22_last_logoff: DWORD;
  321.     usri22_acct_expires: DWORD;
  322.     usri22_max_storage: DWORD;
  323.     usri22_units_per_week: DWORD;
  324.     usri22_logon_hours: PBYTE;
  325.     usri22_bad_pw_count: DWORD;
  326.     usri22_num_logons: DWORD;
  327.     usri22_logon_server: LPWSTR;
  328.     usri22_country_code: DWORD;
  329.     usri22_code_page: DWORD;
  330.   end;
  331.   {$EXTERNALSYM _USER_INFO_22}
  332.   USER_INFO_22 = _USER_INFO_22;
  333.   {$EXTERNALSYM USER_INFO_22}
  334.   TUserInfo22 = USER_INFO_22;
  335.   PUserInfo22 = PUSER_INFO_22;
  336.   LPUSER_INFO_23 = ^USER_INFO_23;
  337.   {$EXTERNALSYM LPUSER_INFO_23}
  338.   PUSER_INFO_23 = ^USER_INFO_23;
  339.   {$EXTERNALSYM PUSER_INFO_23}
  340.   _USER_INFO_23 = record
  341.     usri23_name: LPWSTR;
  342.     usri23_full_name: LPWSTR;
  343.     usri23_comment: LPWSTR;
  344.     usri23_flags: DWORD;
  345.     usri23_user_sid: PSID;
  346.   end;
  347.   {$EXTERNALSYM _USER_INFO_23}
  348.   USER_INFO_23 = _USER_INFO_23;
  349.   {$EXTERNALSYM USER_INFO_23}
  350.   TUserInfo23 = USER_INFO_23;
  351.   PUserInfo23 = PUSER_INFO_23;
  352.   LPUSER_INFO_1003 = ^USER_INFO_1003;
  353.   {$EXTERNALSYM LPUSER_INFO_1003}
  354.   PUSER_INFO_1003 = ^USER_INFO_1003;
  355.   {$EXTERNALSYM PUSER_INFO_1003}
  356.   _USER_INFO_1003 = record
  357.     usri1003_password: LPWSTR;
  358.   end;
  359.   {$EXTERNALSYM _USER_INFO_1003}
  360.   USER_INFO_1003 = _USER_INFO_1003;
  361.   {$EXTERNALSYM USER_INFO_1003}
  362.   TUserInfo1003 = USER_INFO_1003;
  363.   PUserInfo1003 = PUSER_INFO_1003;
  364.   LPUSER_INFO_1005 = ^USER_INFO_1005;
  365.   {$EXTERNALSYM LPUSER_INFO_1005}
  366.   PUSER_INFO_1005 = ^USER_INFO_1005;
  367.   {$EXTERNALSYM PUSER_INFO_1005}
  368.   _USER_INFO_1005 = record
  369.     usri1005_priv: DWORD;
  370.   end;
  371.   {$EXTERNALSYM _USER_INFO_1005}
  372.   USER_INFO_1005 = _USER_INFO_1005;
  373.   {$EXTERNALSYM USER_INFO_1005}
  374.   TUserInfo1005 = USER_INFO_1005;
  375.   PUserInfo1005 = PUSER_INFO_1005;
  376.   LPUSER_INFO_1006 = ^USER_INFO_1006;
  377.   {$EXTERNALSYM LPUSER_INFO_1006}
  378.   PUSER_INFO_1006 = ^USER_INFO_1006;
  379.   {$EXTERNALSYM PUSER_INFO_1006}
  380.   _USER_INFO_1006 = record
  381.     usri1006_home_dir: LPWSTR;
  382.   end;
  383.   {$EXTERNALSYM _USER_INFO_1006}
  384.   USER_INFO_1006 = _USER_INFO_1006;
  385.   {$EXTERNALSYM USER_INFO_1006}
  386.   TUserInfo1006 = USER_INFO_1006;
  387.   PUserInfo1006 = PUSER_INFO_1006;
  388.   LPUSER_INFO_1007 = ^USER_INFO_1007;
  389.   {$EXTERNALSYM LPUSER_INFO_1007}
  390.   PUSER_INFO_1007 = ^USER_INFO_1007;
  391.   {$EXTERNALSYM PUSER_INFO_1007}
  392.   _USER_INFO_1007 = record
  393.     usri1007_comment: LPWSTR;
  394.   end;
  395.   {$EXTERNALSYM _USER_INFO_1007}
  396.   USER_INFO_1007 = _USER_INFO_1007;
  397.   {$EXTERNALSYM USER_INFO_1007}
  398.   TUserInfo1007 = USER_INFO_1007;
  399.   PUserInfo1007 = PUSER_INFO_1007;
  400.   LPUSER_INFO_1008 = ^USER_INFO_1008;
  401.   {$EXTERNALSYM LPUSER_INFO_1008}
  402.   PUSER_INFO_1008 = ^USER_INFO_1008;
  403.   {$EXTERNALSYM PUSER_INFO_1008}
  404.   _USER_INFO_1008 = record
  405.     usri1008_flags: DWORD;
  406.   end;
  407.   {$EXTERNALSYM _USER_INFO_1008}
  408.   USER_INFO_1008 = _USER_INFO_1008;
  409.   {$EXTERNALSYM USER_INFO_1008}
  410.   TUserInfo1008 = USER_INFO_1008;
  411.   PUserInfo1008 = PUSER_INFO_1008;
  412.   LPUSER_INFO_1009 = ^USER_INFO_1009;
  413.   {$EXTERNALSYM LPUSER_INFO_1009}
  414.   PUSER_INFO_1009 = ^USER_INFO_1009;
  415.   {$EXTERNALSYM PUSER_INFO_1009}
  416.   _USER_INFO_1009 = record
  417.     usri1009_script_path: LPWSTR;
  418.   end;
  419.   {$EXTERNALSYM _USER_INFO_1009}
  420.   USER_INFO_1009 = _USER_INFO_1009;
  421.   {$EXTERNALSYM USER_INFO_1009}
  422.   TUserInfo1009 = USER_INFO_1009;
  423.   PUserInfo1009 = PUSER_INFO_1009;
  424.   LPUSER_INFO_1010 = ^USER_INFO_1010;
  425.   {$EXTERNALSYM LPUSER_INFO_1010}
  426.   PUSER_INFO_1010 = ^USER_INFO_1010;
  427.   {$EXTERNALSYM PUSER_INFO_1010}
  428.   _USER_INFO_1010 = record
  429.     usri1010_auth_flags: DWORD;
  430.   end;
  431.   {$EXTERNALSYM _USER_INFO_1010}
  432.   USER_INFO_1010 = _USER_INFO_1010;
  433.   {$EXTERNALSYM USER_INFO_1010}
  434.   TUserInfo1010 = USER_INFO_1010;
  435.   PUserInfo1010 = PUSER_INFO_1010;
  436.   LPUSER_INFO_1011 = ^USER_INFO_1011;
  437.   {$EXTERNALSYM LPUSER_INFO_1011}
  438.   PUSER_INFO_1011 = ^USER_INFO_1011;
  439.   {$EXTERNALSYM PUSER_INFO_1011}
  440.   _USER_INFO_1011 = record
  441.     usri1011_full_name: LPWSTR;
  442.   end;
  443.   {$EXTERNALSYM _USER_INFO_1011}
  444.   USER_INFO_1011 = _USER_INFO_1011;
  445.   {$EXTERNALSYM USER_INFO_1011}
  446.   TUserInfo1011 = USER_INFO_1011;
  447.   PUserInfo1011 = PUSER_INFO_1011;
  448.   LPUSER_INFO_1012 = ^USER_INFO_1012;
  449.   {$EXTERNALSYM LPUSER_INFO_1012}
  450.   PUSER_INFO_1012 = ^USER_INFO_1012;
  451.   {$EXTERNALSYM PUSER_INFO_1012}
  452.   _USER_INFO_1012 = record
  453.     usri1012_usr_comment: LPWSTR;
  454.   end;
  455.   {$EXTERNALSYM _USER_INFO_1012}
  456.   USER_INFO_1012 = _USER_INFO_1012;
  457.   {$EXTERNALSYM USER_INFO_1012}
  458.   TUserInfo1012 = USER_INFO_1012;
  459.   PUserInfo1012 = PUSER_INFO_1012;
  460.   LPUSER_INFO_1013 = ^USER_INFO_1013;
  461.   {$EXTERNALSYM LPUSER_INFO_1013}
  462.   PUSER_INFO_1013 = ^USER_INFO_1013;
  463.   {$EXTERNALSYM PUSER_INFO_1013}
  464.   _USER_INFO_1013 = record
  465.     usri1013_parms: LPWSTR;
  466.   end;
  467.   {$EXTERNALSYM _USER_INFO_1013}
  468.   USER_INFO_1013 = _USER_INFO_1013;
  469.   {$EXTERNALSYM USER_INFO_1013}
  470.   TUserInfo1013 = USER_INFO_1013;
  471.   PUserInfo1013 = PUSER_INFO_1013;
  472.   LPUSER_INFO_1014 = ^USER_INFO_1014;
  473.   {$EXTERNALSYM LPUSER_INFO_1014}
  474.   PUSER_INFO_1014 = ^USER_INFO_1014;
  475.   {$EXTERNALSYM PUSER_INFO_1014}
  476.   _USER_INFO_1014 = record
  477.     usri1014_workstations: LPWSTR;
  478.   end;
  479.   {$EXTERNALSYM _USER_INFO_1014}
  480.   USER_INFO_1014 = _USER_INFO_1014;
  481.   {$EXTERNALSYM USER_INFO_1014}
  482.   TUserInfo1014 = USER_INFO_1014;
  483.   PUserInfo1014 = PUSER_INFO_1014;
  484.   LPUSER_INFO_1017 = ^USER_INFO_1017;
  485.   {$EXTERNALSYM LPUSER_INFO_1017}
  486.   PUSER_INFO_1017 = ^USER_INFO_1017;
  487.   {$EXTERNALSYM PUSER_INFO_1017}
  488.   _USER_INFO_1017 = record
  489.     usri1017_acct_expires: DWORD;
  490.   end;
  491.   {$EXTERNALSYM _USER_INFO_1017}
  492.   USER_INFO_1017 = _USER_INFO_1017;
  493.   {$EXTERNALSYM USER_INFO_1017}
  494.   TUserInfo1017 = USER_INFO_1017;
  495.   PUserInfo1017 = PUSER_INFO_1017;
  496.   LPUSER_INFO_1018 = ^USER_INFO_1018;
  497.   {$EXTERNALSYM LPUSER_INFO_1018}
  498.   PUSER_INFO_1018 = ^USER_INFO_1018;
  499.   {$EXTERNALSYM PUSER_INFO_1018}
  500.   _USER_INFO_1018 = record
  501.     usri1018_max_storage: DWORD;
  502.   end;
  503.   {$EXTERNALSYM _USER_INFO_1018}
  504.   USER_INFO_1018 = _USER_INFO_1018;
  505.   {$EXTERNALSYM USER_INFO_1018}
  506.   TUserInfo1018 = USER_INFO_1018;
  507.   PUserInfo1018 = PUSER_INFO_1018;
  508.   LPUSER_INFO_1020 = ^USER_INFO_1020;
  509.   {$EXTERNALSYM LPUSER_INFO_1020}
  510.   PUSER_INFO_1020 = ^USER_INFO_1020;
  511.   {$EXTERNALSYM PUSER_INFO_1020}
  512.   _USER_INFO_1020 = record
  513.     usri1020_units_per_week: DWORD;
  514.     usri1020_logon_hours: LPBYTE;
  515.   end;
  516.   {$EXTERNALSYM _USER_INFO_1020}
  517.   USER_INFO_1020 = _USER_INFO_1020;
  518.   {$EXTERNALSYM USER_INFO_1020}
  519.   TUserInfo1020 = USER_INFO_1020;
  520.   PUserInfo1020 = PUSER_INFO_1020;
  521.   LPUSER_INFO_1023 = ^USER_INFO_1023;
  522.   {$EXTERNALSYM LPUSER_INFO_1023}
  523.   PUSER_INFO_1023 = ^USER_INFO_1023;
  524.   {$EXTERNALSYM PUSER_INFO_1023}
  525.   _USER_INFO_1023 = record
  526.     usri1023_logon_server: LPWSTR;
  527.   end;
  528.   {$EXTERNALSYM _USER_INFO_1023}
  529.   USER_INFO_1023 = _USER_INFO_1023;
  530.   {$EXTERNALSYM USER_INFO_1023}
  531.   TUserInfo1023 = USER_INFO_1023;
  532.   PUserInfo1023 = PUSER_INFO_1023;
  533.   LPUSER_INFO_1024 = ^USER_INFO_1024;
  534.   {$EXTERNALSYM LPUSER_INFO_1024}
  535.   PUSER_INFO_1024 = ^USER_INFO_1024;
  536.   {$EXTERNALSYM PUSER_INFO_1024}
  537.   _USER_INFO_1024 = record
  538.     usri1024_country_code: DWORD;
  539.   end;
  540.   {$EXTERNALSYM _USER_INFO_1024}
  541.   USER_INFO_1024 = _USER_INFO_1024;
  542.   {$EXTERNALSYM USER_INFO_1024}
  543.   TUserInfo1024 = USER_INFO_1024;
  544.   PUserInfo1024 = PUSER_INFO_1024;
  545.   LPUSER_INFO_1025 = ^USER_INFO_1025;
  546.   {$EXTERNALSYM LPUSER_INFO_1025}
  547.   PUSER_INFO_1025 = ^USER_INFO_1025;
  548.   {$EXTERNALSYM PUSER_INFO_1025}
  549.   _USER_INFO_1025 = record
  550.     usri1025_code_page: DWORD;
  551.   end;
  552.   {$EXTERNALSYM _USER_INFO_1025}
  553.   USER_INFO_1025 = _USER_INFO_1025;
  554.   {$EXTERNALSYM USER_INFO_1025}
  555.   TUserInfo1025 = USER_INFO_1025;
  556.   PUserInfo1025 = PUSER_INFO_1025;
  557.   LPUSER_INFO_1051 = ^USER_INFO_1051;
  558.   {$EXTERNALSYM LPUSER_INFO_1051}
  559.   PUSER_INFO_1051 = ^USER_INFO_1051;
  560.   {$EXTERNALSYM PUSER_INFO_1051}
  561.   _USER_INFO_1051 = record
  562.     usri1051_primary_group_id: DWORD;
  563.   end;
  564.   {$EXTERNALSYM _USER_INFO_1051}
  565.   USER_INFO_1051 = _USER_INFO_1051;
  566.   {$EXTERNALSYM USER_INFO_1051}
  567.   TUserInfo1051 = USER_INFO_1051;
  568.   PUserInfo1051 = PUSER_INFO_1051;
  569.   LPUSER_INFO_1052 = ^USER_INFO_1052;
  570.   {$EXTERNALSYM LPUSER_INFO_1052}
  571.   PUSER_INFO_1052 = ^USER_INFO_1052;
  572.   {$EXTERNALSYM PUSER_INFO_1052}
  573.   _USER_INFO_1052 = record
  574.     usri1052_profile: LPWSTR;
  575.   end;
  576.   {$EXTERNALSYM _USER_INFO_1052}
  577.   USER_INFO_1052 = _USER_INFO_1052;
  578.   {$EXTERNALSYM USER_INFO_1052}
  579.   TUserInfo1052 = USER_INFO_1052;
  580.   PUserInfo1052 = PUSER_INFO_1052;
  581.   LPUSER_INFO_1053 = ^USER_INFO_1053;
  582.   {$EXTERNALSYM LPUSER_INFO_1053}
  583.   PUSER_INFO_1053 = ^USER_INFO_1053;
  584.   {$EXTERNALSYM PUSER_INFO_1053}
  585.   _USER_INFO_1053 = record
  586.     usri1053_home_dir_drive: LPWSTR;
  587.   end;
  588.   {$EXTERNALSYM _USER_INFO_1053}
  589.   USER_INFO_1053 = _USER_INFO_1053;
  590.   {$EXTERNALSYM USER_INFO_1053}
  591.   TUserInfo1053 = USER_INFO_1053;
  592.   PUserInfo1053 = PUSER_INFO_1053;
  593. //
  594. //  Data Structures - User Modals
  595. //
  596.   LPUSER_MODALS_INFO_0 = ^USER_MODALS_INFO_0;
  597.   {$EXTERNALSYM LPUSER_MODALS_INFO_0}
  598.   PUSER_MODALS_INFO_0 = ^USER_MODALS_INFO_0;
  599.   {$EXTERNALSYM PUSER_MODALS_INFO_0}
  600.   _USER_MODALS_INFO_0 = record
  601.     usrmod0_min_passwd_len: DWORD;
  602.     usrmod0_max_passwd_age: DWORD;
  603.     usrmod0_min_passwd_age: DWORD;
  604.     usrmod0_force_logoff: DWORD;
  605.     usrmod0_password_hist_len: DWORD;
  606.   end;
  607.   {$EXTERNALSYM _USER_MODALS_INFO_0}
  608.   USER_MODALS_INFO_0 = _USER_MODALS_INFO_0;
  609.   {$EXTERNALSYM USER_MODALS_INFO_0}
  610.   TUserModalsInfo0 = USER_MODALS_INFO_0;
  611.   PUserModalsInfo0 = PUSER_MODALS_INFO_0;
  612.   LPUSER_MODALS_INFO_1 = ^USER_MODALS_INFO_1;
  613.   {$EXTERNALSYM LPUSER_MODALS_INFO_1}
  614.   PUSER_MODALS_INFO_1 = ^USER_MODALS_INFO_1;
  615.   {$EXTERNALSYM PUSER_MODALS_INFO_1}
  616.   _USER_MODALS_INFO_1 = record
  617.     usrmod1_role: DWORD;
  618.     usrmod1_primary: LPWSTR;
  619.   end;
  620.   {$EXTERNALSYM _USER_MODALS_INFO_1}
  621.   USER_MODALS_INFO_1 = _USER_MODALS_INFO_1;
  622.   {$EXTERNALSYM USER_MODALS_INFO_1}
  623.   TUserModalsInfo1 = USER_MODALS_INFO_1;
  624.   PUserModalsInfo1 = PUSER_MODALS_INFO_1;
  625.   LPUSER_MODALS_INFO_2 = ^USER_MODALS_INFO_2;
  626.   {$EXTERNALSYM LPUSER_MODALS_INFO_2}
  627.   PUSER_MODALS_INFO_2 = ^USER_MODALS_INFO_2;
  628.   {$EXTERNALSYM PUSER_MODALS_INFO_2}
  629.   _USER_MODALS_INFO_2 = record
  630.     usrmod2_domain_name: LPWSTR;
  631.     usrmod2_domain_id: PSID;
  632.   end;
  633.   {$EXTERNALSYM _USER_MODALS_INFO_2}
  634.   USER_MODALS_INFO_2 = _USER_MODALS_INFO_2;
  635.   {$EXTERNALSYM USER_MODALS_INFO_2}
  636.   TUserModalsInfo2 = USER_MODALS_INFO_2;
  637.   PUserModalsInfo2 = PUSER_MODALS_INFO_2;
  638.   LPUSER_MODALS_INFO_3 = ^USER_MODALS_INFO_3;
  639.   {$EXTERNALSYM LPUSER_MODALS_INFO_3}
  640.   PUSER_MODALS_INFO_3 = ^USER_MODALS_INFO_3;
  641.   {$EXTERNALSYM PUSER_MODALS_INFO_3}
  642.   _USER_MODALS_INFO_3 = record
  643.     usrmod3_lockout_duration: DWORD;
  644.     usrmod3_lockout_observation_window: DWORD;
  645.     usrmod3_lockout_threshold: DWORD;
  646.   end;
  647.   {$EXTERNALSYM _USER_MODALS_INFO_3}
  648.   USER_MODALS_INFO_3 = _USER_MODALS_INFO_3;
  649.   {$EXTERNALSYM USER_MODALS_INFO_3}
  650.   TUserModalsInfo3 = USER_MODALS_INFO_3;
  651.   PUserModalsInfo3 = PUSER_MODALS_INFO_3;
  652.   LPUSER_MODALS_INFO_1001 = ^USER_MODALS_INFO_1001;
  653.   {$EXTERNALSYM LPUSER_MODALS_INFO_1001}
  654.   PUSER_MODALS_INFO_1001 = ^USER_MODALS_INFO_1001;
  655.   {$EXTERNALSYM PUSER_MODALS_INFO_1001}
  656.   _USER_MODALS_INFO_1001 = record
  657.     usrmod1001_min_passwd_len: DWORD;
  658.   end;
  659.   {$EXTERNALSYM _USER_MODALS_INFO_1001}
  660.   USER_MODALS_INFO_1001 = _USER_MODALS_INFO_1001;
  661.   {$EXTERNALSYM USER_MODALS_INFO_1001}
  662.   TUserModalsInfo1001 = USER_MODALS_INFO_1001;
  663.   PUserModalsInfo1001 = PUSER_MODALS_INFO_1001;
  664.   LPUSER_MODALS_INFO_1002 = ^USER_MODALS_INFO_1002;
  665.   {$EXTERNALSYM LPUSER_MODALS_INFO_1002}
  666.   PUSER_MODALS_INFO_1002 = ^USER_MODALS_INFO_1002;
  667.   {$EXTERNALSYM PUSER_MODALS_INFO_1002}
  668.   _USER_MODALS_INFO_1002 = record
  669.     usrmod1002_max_passwd_age: DWORD;
  670.   end;
  671.   {$EXTERNALSYM _USER_MODALS_INFO_1002}
  672.   USER_MODALS_INFO_1002 = _USER_MODALS_INFO_1002;
  673.   {$EXTERNALSYM USER_MODALS_INFO_1002}
  674.   TUserModalsInfo1002 = USER_MODALS_INFO_1002;
  675.   PUserModalsInfo1002 = PUSER_MODALS_INFO_1002;
  676.   LPUSER_MODALS_INFO_1003 = ^USER_MODALS_INFO_1003;
  677.   {$EXTERNALSYM LPUSER_MODALS_INFO_1003}
  678.   PUSER_MODALS_INFO_1003 = ^USER_MODALS_INFO_1003;
  679.   {$EXTERNALSYM PUSER_MODALS_INFO_1003}
  680.   _USER_MODALS_INFO_1003 = record
  681.     usrmod1003_min_passwd_age: DWORD;
  682.   end;
  683.   {$EXTERNALSYM _USER_MODALS_INFO_1003}
  684.   USER_MODALS_INFO_1003 = _USER_MODALS_INFO_1003;
  685.   {$EXTERNALSYM USER_MODALS_INFO_1003}
  686.   TUserModalsInfo1003 = USER_MODALS_INFO_1003;
  687.   PUserModalsInfo1003 = PUSER_MODALS_INFO_1003;
  688.   LPUSER_MODALS_INFO_1004 = ^USER_MODALS_INFO_1004;
  689.   {$EXTERNALSYM LPUSER_MODALS_INFO_1004}
  690.   PUSER_MODALS_INFO_1004 = ^USER_MODALS_INFO_1004;
  691.   {$EXTERNALSYM PUSER_MODALS_INFO_1004}
  692.   _USER_MODALS_INFO_1004 = record
  693.     usrmod1004_force_logoff: DWORD;
  694.   end;
  695.   {$EXTERNALSYM _USER_MODALS_INFO_1004}
  696.   USER_MODALS_INFO_1004 = _USER_MODALS_INFO_1004;
  697.   {$EXTERNALSYM USER_MODALS_INFO_1004}
  698.   TUserModalsInfo1004 = USER_MODALS_INFO_1004;
  699.   PUserModalsInfo1004 = PUSER_MODALS_INFO_1004;
  700.   LPUSER_MODALS_INFO_1005 = ^USER_MODALS_INFO_1005;
  701.   {$EXTERNALSYM LPUSER_MODALS_INFO_1005}
  702.   PUSER_MODALS_INFO_1005 = ^USER_MODALS_INFO_1005;
  703.   {$EXTERNALSYM PUSER_MODALS_INFO_1005}
  704.   _USER_MODALS_INFO_1005 = record
  705.     usrmod1005_password_hist_len: DWORD;
  706.   end;
  707.   {$EXTERNALSYM _USER_MODALS_INFO_1005}
  708.   USER_MODALS_INFO_1005 = _USER_MODALS_INFO_1005;
  709.   {$EXTERNALSYM USER_MODALS_INFO_1005}
  710.   TUserModalsInfo1005 = USER_MODALS_INFO_1005;
  711.   PUserModalsInfo1005 = PUSER_MODALS_INFO_1005;
  712.   LPUSER_MODALS_INFO_1006 = ^USER_MODALS_INFO_1006;
  713.   {$EXTERNALSYM LPUSER_MODALS_INFO_1006}
  714.   PUSER_MODALS_INFO_1006 = ^USER_MODALS_INFO_1006;
  715.   {$EXTERNALSYM PUSER_MODALS_INFO_1006}
  716.   _USER_MODALS_INFO_1006 = record
  717.     usrmod1006_role: DWORD;
  718.   end;
  719.   {$EXTERNALSYM _USER_MODALS_INFO_1006}
  720.   USER_MODALS_INFO_1006 = _USER_MODALS_INFO_1006;
  721.   {$EXTERNALSYM USER_MODALS_INFO_1006}
  722.   TUserModalsInfo1006 = USER_MODALS_INFO_1006;
  723.   PUserModalsInfo1006 = PUSER_MODALS_INFO_1006;
  724.   LPUSER_MODALS_INFO_1007 = ^USER_MODALS_INFO_1007;
  725.   {$EXTERNALSYM LPUSER_MODALS_INFO_1007}
  726.   PUSER_MODALS_INFO_1007 = ^USER_MODALS_INFO_1007;
  727.   {$EXTERNALSYM PUSER_MODALS_INFO_1007}
  728.   _USER_MODALS_INFO_1007 = record
  729.     usrmod1007_primary: LPWSTR;
  730.   end;
  731.   {$EXTERNALSYM _USER_MODALS_INFO_1007}
  732.   USER_MODALS_INFO_1007 = _USER_MODALS_INFO_1007;
  733.   {$EXTERNALSYM USER_MODALS_INFO_1007}
  734.   TUserModalsInfo1007 = USER_MODALS_INFO_1007;
  735.   PUserModalsInfo1007 = PUSER_MODALS_INFO_1007;
  736. //
  737. // Special Values and Constants - User
  738. //
  739. //
  740. //  Bit masks for field usriX_flags of USER_INFO_X (X = 0/1).
  741. //
  742. const
  743.   UF_SCRIPT                          = $0001;
  744.   {$EXTERNALSYM UF_SCRIPT}
  745.   UF_ACCOUNTDISABLE                  = $0002;
  746.   {$EXTERNALSYM UF_ACCOUNTDISABLE}
  747.   UF_HOMEDIR_REQUIRED                = $0008;
  748.   {$EXTERNALSYM UF_HOMEDIR_REQUIRED}
  749.   UF_LOCKOUT                         = $0010;
  750.   {$EXTERNALSYM UF_LOCKOUT}
  751.   UF_PASSWD_NOTREQD                  = $0020;
  752.   {$EXTERNALSYM UF_PASSWD_NOTREQD}
  753.   UF_PASSWD_CANT_CHANGE              = $0040;
  754.   {$EXTERNALSYM UF_PASSWD_CANT_CHANGE}
  755.   UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED = $0080;
  756.   {$EXTERNALSYM UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED}
  757. //
  758. // Account type bits as part of usri_flags.
  759. //
  760.   UF_TEMP_DUPLICATE_ACCOUNT    = $0100;
  761.   {$EXTERNALSYM UF_TEMP_DUPLICATE_ACCOUNT}
  762.   UF_NORMAL_ACCOUNT            = $0200;
  763.   {$EXTERNALSYM UF_NORMAL_ACCOUNT}
  764.   UF_INTERDOMAIN_TRUST_ACCOUNT = $0800;
  765.   {$EXTERNALSYM UF_INTERDOMAIN_TRUST_ACCOUNT}
  766.   UF_WORKSTATION_TRUST_ACCOUNT = $1000;
  767.   {$EXTERNALSYM UF_WORKSTATION_TRUST_ACCOUNT}
  768.   UF_SERVER_TRUST_ACCOUNT      = $2000;
  769.   {$EXTERNALSYM UF_SERVER_TRUST_ACCOUNT}
  770.   UF_MACHINE_ACCOUNT_MASK = (UF_INTERDOMAIN_TRUST_ACCOUNT or UF_WORKSTATION_TRUST_ACCOUNT or UF_SERVER_TRUST_ACCOUNT);
  771.   {$EXTERNALSYM UF_MACHINE_ACCOUNT_MASK}
  772.   UF_ACCOUNT_TYPE_MASK = UF_TEMP_DUPLICATE_ACCOUNT or UF_NORMAL_ACCOUNT or UF_INTERDOMAIN_TRUST_ACCOUNT or UF_WORKSTATION_TRUST_ACCOUNT or UF_SERVER_TRUST_ACCOUNT;
  773.   {$EXTERNALSYM UF_ACCOUNT_TYPE_MASK}
  774.   UF_DONT_EXPIRE_PASSWD                     = $10000;
  775.   {$EXTERNALSYM UF_DONT_EXPIRE_PASSWD}
  776.   UF_MNS_LOGON_ACCOUNT                      = $20000;
  777.   {$EXTERNALSYM UF_MNS_LOGON_ACCOUNT}
  778.   UF_SMARTCARD_REQUIRED                     = $40000;
  779.   {$EXTERNALSYM UF_SMARTCARD_REQUIRED}
  780.   UF_TRUSTED_FOR_DELEGATION                 = $80000;
  781.   {$EXTERNALSYM UF_TRUSTED_FOR_DELEGATION}
  782.   UF_NOT_DELEGATED                          = $100000;
  783.   {$EXTERNALSYM UF_NOT_DELEGATED}
  784.   UF_USE_DES_KEY_ONLY                       = $200000;
  785.   {$EXTERNALSYM UF_USE_DES_KEY_ONLY}
  786.   UF_DONT_REQUIRE_PREAUTH                   = $400000;
  787.   {$EXTERNALSYM UF_DONT_REQUIRE_PREAUTH}
  788.   UF_PASSWORD_EXPIRED                       = DWORD($800000);
  789.   {$EXTERNALSYM UF_PASSWORD_EXPIRED}
  790.   UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = $1000000;
  791.   {$EXTERNALSYM UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION}
  792.   UF_SETTABLE_BITS =
  793.                     UF_SCRIPT or
  794.                     UF_ACCOUNTDISABLE or
  795.                     UF_LOCKOUT or
  796.                     UF_HOMEDIR_REQUIRED or
  797.                     UF_PASSWD_NOTREQD or
  798.                     UF_PASSWD_CANT_CHANGE or
  799.                     UF_ACCOUNT_TYPE_MASK or
  800.                     UF_DONT_EXPIRE_PASSWD or
  801.                     UF_MNS_LOGON_ACCOUNT or
  802.                     UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED or
  803.                     UF_SMARTCARD_REQUIRED or
  804.                     UF_TRUSTED_FOR_DELEGATION or
  805.                     UF_NOT_DELEGATED or
  806.                     UF_USE_DES_KEY_ONLY or
  807.                     UF_DONT_REQUIRE_PREAUTH or
  808.                     UF_PASSWORD_EXPIRED or
  809.                     UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION;
  810.   {$EXTERNALSYM UF_SETTABLE_BITS}
  811. //
  812. // bit masks for the NetUserEnum filter parameter.
  813. //
  814.   FILTER_TEMP_DUPLICATE_ACCOUNT = ($0001);
  815.   {$EXTERNALSYM FILTER_TEMP_DUPLICATE_ACCOUNT}
  816.   FILTER_NORMAL_ACCOUNT         = ($0002);
  817.   {$EXTERNALSYM FILTER_NORMAL_ACCOUNT}
  818. // #define FILTER_PROXY_ACCOUNT                (0x0004)
  819.   FILTER_INTERDOMAIN_TRUST_ACCOUNT = ($0008);
  820.   {$EXTERNALSYM FILTER_INTERDOMAIN_TRUST_ACCOUNT}
  821.   FILTER_WORKSTATION_TRUST_ACCOUNT = ($0010);
  822.   {$EXTERNALSYM FILTER_WORKSTATION_TRUST_ACCOUNT}
  823.   FILTER_SERVER_TRUST_ACCOUNT      = ($0020);
  824.   {$EXTERNALSYM FILTER_SERVER_TRUST_ACCOUNT}
  825. //
  826. // bit masks for the NetUserGetLocalGroups flags
  827. //
  828.   LG_INCLUDE_INDIRECT = ($0001);
  829.   {$EXTERNALSYM LG_INCLUDE_INDIRECT}
  830. //
  831. //  Bit masks for field usri2_auth_flags of USER_INFO_2.
  832. //
  833.   AF_OP_PRINT      = $1;
  834.   {$EXTERNALSYM AF_OP_PRINT}
  835.   AF_OP_COMM       = $2;
  836.   {$EXTERNALSYM AF_OP_COMM}
  837.   AF_OP_SERVER     = $4;
  838.   {$EXTERNALSYM AF_OP_SERVER}
  839.   AF_OP_ACCOUNTS   = $8;
  840.   {$EXTERNALSYM AF_OP_ACCOUNTS}
  841.   AF_SETTABLE_BITS = (AF_OP_PRINT or AF_OP_COMM or AF_OP_SERVER or AF_OP_ACCOUNTS);
  842.   {$EXTERNALSYM AF_SETTABLE_BITS}
  843. //
  844. //  UAS role manifests under NETLOGON
  845. //
  846.   UAS_ROLE_STANDALONE = 0;
  847.   {$EXTERNALSYM UAS_ROLE_STANDALONE}
  848.   UAS_ROLE_MEMBER     = 1;
  849.   {$EXTERNALSYM UAS_ROLE_MEMBER}
  850.   UAS_ROLE_BACKUP     = 2;
  851.   {$EXTERNALSYM UAS_ROLE_BACKUP}
  852.   UAS_ROLE_PRIMARY    = 3;
  853.   {$EXTERNALSYM UAS_ROLE_PRIMARY}
  854. //
  855. //  Values for ParmError for NetUserSetInfo.
  856. //
  857.   USER_NAME_PARMNUM           = 1;
  858.   {$EXTERNALSYM USER_NAME_PARMNUM}
  859.   USER_PASSWORD_PARMNUM       = 3;
  860.   {$EXTERNALSYM USER_PASSWORD_PARMNUM}
  861.   USER_PASSWORD_AGE_PARMNUM   = 4;
  862.   {$EXTERNALSYM USER_PASSWORD_AGE_PARMNUM}
  863.   USER_PRIV_PARMNUM           = 5;
  864.   {$EXTERNALSYM USER_PRIV_PARMNUM}
  865.   USER_HOME_DIR_PARMNUM       = 6;
  866.   {$EXTERNALSYM USER_HOME_DIR_PARMNUM}
  867.   USER_COMMENT_PARMNUM        = 7;
  868.   {$EXTERNALSYM USER_COMMENT_PARMNUM}
  869.   USER_FLAGS_PARMNUM          = 8;
  870.   {$EXTERNALSYM USER_FLAGS_PARMNUM}
  871.   USER_SCRIPT_PATH_PARMNUM    = 9;
  872.   {$EXTERNALSYM USER_SCRIPT_PATH_PARMNUM}
  873.   USER_AUTH_FLAGS_PARMNUM     = 10;
  874.   {$EXTERNALSYM USER_AUTH_FLAGS_PARMNUM}
  875.   USER_FULL_NAME_PARMNUM      = 11;
  876.   {$EXTERNALSYM USER_FULL_NAME_PARMNUM}
  877.   USER_USR_COMMENT_PARMNUM    = 12;
  878.   {$EXTERNALSYM USER_USR_COMMENT_PARMNUM}
  879.   USER_PARMS_PARMNUM          = 13;
  880.   {$EXTERNALSYM USER_PARMS_PARMNUM}
  881.   USER_WORKSTATIONS_PARMNUM   = 14;
  882.   {$EXTERNALSYM USER_WORKSTATIONS_PARMNUM}
  883.   USER_LAST_LOGON_PARMNUM     = 15;
  884.   {$EXTERNALSYM USER_LAST_LOGON_PARMNUM}
  885.   USER_LAST_LOGOFF_PARMNUM    = 16;
  886.   {$EXTERNALSYM USER_LAST_LOGOFF_PARMNUM}
  887.   USER_ACCT_EXPIRES_PARMNUM   = 17;
  888.   {$EXTERNALSYM USER_ACCT_EXPIRES_PARMNUM}
  889.   USER_MAX_STORAGE_PARMNUM    = 18;
  890.   {$EXTERNALSYM USER_MAX_STORAGE_PARMNUM}
  891.   USER_UNITS_PER_WEEK_PARMNUM = 19;
  892.   {$EXTERNALSYM USER_UNITS_PER_WEEK_PARMNUM}
  893.   USER_LOGON_HOURS_PARMNUM    = 20;
  894.   {$EXTERNALSYM USER_LOGON_HOURS_PARMNUM}
  895.   USER_PAD_PW_COUNT_PARMNUM   = 21;
  896.   {$EXTERNALSYM USER_PAD_PW_COUNT_PARMNUM}
  897.   USER_NUM_LOGONS_PARMNUM     = 22;
  898.   {$EXTERNALSYM USER_NUM_LOGONS_PARMNUM}
  899.   USER_LOGON_SERVER_PARMNUM   = 23;
  900.   {$EXTERNALSYM USER_LOGON_SERVER_PARMNUM}
  901.   USER_COUNTRY_CODE_PARMNUM   = 24;
  902.   {$EXTERNALSYM USER_COUNTRY_CODE_PARMNUM}
  903.   USER_CODE_PAGE_PARMNUM      = 25;
  904.   {$EXTERNALSYM USER_CODE_PAGE_PARMNUM}
  905.   USER_PRIMARY_GROUP_PARMNUM  = 51;
  906.   {$EXTERNALSYM USER_PRIMARY_GROUP_PARMNUM}
  907.   USER_PROFILE                = 52; // ?? Delete when convenient
  908.   {$EXTERNALSYM USER_PROFILE}
  909.   USER_PROFILE_PARMNUM        = 52;
  910.   {$EXTERNALSYM USER_PROFILE_PARMNUM}
  911.   USER_HOME_DIR_DRIVE_PARMNUM = 53;
  912.   {$EXTERNALSYM USER_HOME_DIR_DRIVE_PARMNUM}
  913. //
  914. // the new infolevel counterparts of the old info level + parmnum
  915. //
  916.   USER_NAME_INFOLEVEL           = (PARMNUM_BASE_INFOLEVEL + USER_NAME_PARMNUM);
  917.   {$EXTERNALSYM USER_NAME_INFOLEVEL}
  918.   USER_PASSWORD_INFOLEVEL       = (PARMNUM_BASE_INFOLEVEL + USER_PASSWORD_PARMNUM);
  919.   {$EXTERNALSYM USER_PASSWORD_INFOLEVEL}
  920.   USER_PASSWORD_AGE_INFOLEVEL   = (PARMNUM_BASE_INFOLEVEL + USER_PASSWORD_AGE_PARMNUM);
  921.   {$EXTERNALSYM USER_PASSWORD_AGE_INFOLEVEL}
  922.   USER_PRIV_INFOLEVEL           = (PARMNUM_BASE_INFOLEVEL + USER_PRIV_PARMNUM);
  923.   {$EXTERNALSYM USER_PRIV_INFOLEVEL}
  924.   USER_HOME_DIR_INFOLEVEL       = (PARMNUM_BASE_INFOLEVEL + USER_HOME_DIR_PARMNUM);
  925.   {$EXTERNALSYM USER_HOME_DIR_INFOLEVEL}
  926.   USER_COMMENT_INFOLEVEL        = (PARMNUM_BASE_INFOLEVEL + USER_COMMENT_PARMNUM);
  927.   {$EXTERNALSYM USER_COMMENT_INFOLEVEL}
  928.   USER_FLAGS_INFOLEVEL          = (PARMNUM_BASE_INFOLEVEL + USER_FLAGS_PARMNUM);
  929.   {$EXTERNALSYM USER_FLAGS_INFOLEVEL}
  930.   USER_SCRIPT_PATH_INFOLEVEL    = (PARMNUM_BASE_INFOLEVEL + USER_SCRIPT_PATH_PARMNUM);
  931.   {$EXTERNALSYM USER_SCRIPT_PATH_INFOLEVEL}
  932.   USER_AUTH_FLAGS_INFOLEVEL     = (PARMNUM_BASE_INFOLEVEL + USER_AUTH_FLAGS_PARMNUM);
  933.   {$EXTERNALSYM USER_AUTH_FLAGS_INFOLEVEL}
  934.   USER_FULL_NAME_INFOLEVEL      = (PARMNUM_BASE_INFOLEVEL + USER_FULL_NAME_PARMNUM);
  935.   {$EXTERNALSYM USER_FULL_NAME_INFOLEVEL}
  936.   USER_USR_COMMENT_INFOLEVEL    = (PARMNUM_BASE_INFOLEVEL + USER_USR_COMMENT_PARMNUM);
  937.   {$EXTERNALSYM USER_USR_COMMENT_INFOLEVEL}
  938.   USER_PARMS_INFOLEVEL          = (PARMNUM_BASE_INFOLEVEL + USER_PARMS_PARMNUM);
  939.   {$EXTERNALSYM USER_PARMS_INFOLEVEL}
  940.   USER_WORKSTATIONS_INFOLEVEL   = (PARMNUM_BASE_INFOLEVEL + USER_WORKSTATIONS_PARMNUM);
  941.   {$EXTERNALSYM USER_WORKSTATIONS_INFOLEVEL}
  942.   USER_LAST_LOGON_INFOLEVEL     = (PARMNUM_BASE_INFOLEVEL + USER_LAST_LOGON_PARMNUM);
  943.   {$EXTERNALSYM USER_LAST_LOGON_INFOLEVEL}
  944.   USER_LAST_LOGOFF_INFOLEVEL    = (PARMNUM_BASE_INFOLEVEL + USER_LAST_LOGOFF_PARMNUM);
  945.   {$EXTERNALSYM USER_LAST_LOGOFF_INFOLEVEL}
  946.   USER_ACCT_EXPIRES_INFOLEVEL   = (PARMNUM_BASE_INFOLEVEL + USER_ACCT_EXPIRES_PARMNUM);
  947.   {$EXTERNALSYM USER_ACCT_EXPIRES_INFOLEVEL}
  948.   USER_MAX_STORAGE_INFOLEVEL    = (PARMNUM_BASE_INFOLEVEL + USER_MAX_STORAGE_PARMNUM);
  949.   {$EXTERNALSYM USER_MAX_STORAGE_INFOLEVEL}
  950.   USER_UNITS_PER_WEEK_INFOLEVEL = (PARMNUM_BASE_INFOLEVEL + USER_UNITS_PER_WEEK_PARMNUM);
  951.   {$EXTERNALSYM USER_UNITS_PER_WEEK_INFOLEVEL}
  952.   USER_LOGON_HOURS_INFOLEVEL    = (PARMNUM_BASE_INFOLEVEL + USER_LOGON_HOURS_PARMNUM);
  953.   {$EXTERNALSYM USER_LOGON_HOURS_INFOLEVEL}
  954.   USER_PAD_PW_COUNT_INFOLEVEL   = (PARMNUM_BASE_INFOLEVEL + USER_PAD_PW_COUNT_PARMNUM);
  955.   {$EXTERNALSYM USER_PAD_PW_COUNT_INFOLEVEL}
  956.   USER_NUM_LOGONS_INFOLEVEL     = (PARMNUM_BASE_INFOLEVEL + USER_NUM_LOGONS_PARMNUM);
  957.   {$EXTERNALSYM USER_NUM_LOGONS_INFOLEVEL}
  958.   USER_LOGON_SERVER_INFOLEVEL   = (PARMNUM_BASE_INFOLEVEL + USER_LOGON_SERVER_PARMNUM);
  959.   {$EXTERNALSYM USER_LOGON_SERVER_INFOLEVEL}
  960.   USER_COUNTRY_CODE_INFOLEVEL   = (PARMNUM_BASE_INFOLEVEL + USER_COUNTRY_CODE_PARMNUM);
  961.   {$EXTERNALSYM USER_COUNTRY_CODE_INFOLEVEL}
  962.   USER_CODE_PAGE_INFOLEVEL      = (PARMNUM_BASE_INFOLEVEL + USER_CODE_PAGE_PARMNUM);
  963.   {$EXTERNALSYM USER_CODE_PAGE_INFOLEVEL}
  964.   USER_PRIMARY_GROUP_INFOLEVEL  = (PARMNUM_BASE_INFOLEVEL + USER_PRIMARY_GROUP_PARMNUM);
  965.   {$EXTERNALSYM USER_PRIMARY_GROUP_INFOLEVEL}
  966. //  todo USER_POSIX_ID_PARMNUM where is it defined?
  967. //  USER_POSIX_ID_INFOLEVEL       = (PARMNUM_BASE_INFOLEVEL + USER_POSIX_ID_PARMNUM);
  968. //  {$EXTERNALSYM USER_POSIX_ID_INFOLEVEL}
  969.   USER_HOME_DIR_DRIVE_INFOLEVEL = (PARMNUM_BASE_INFOLEVEL + USER_HOME_DIR_DRIVE_PARMNUM);
  970.   {$EXTERNALSYM USER_HOME_DIR_DRIVE_INFOLEVEL}
  971. //
  972. //  For SetInfo call (parmnum 0) when password change not required
  973. //
  974.   NULL_USERSETINFO_PASSWD = '              ';
  975.   {$EXTERNALSYM NULL_USERSETINFO_PASSWD}
  976.   TIMEQ_FOREVER             = ULONG(-1);
  977.   {$EXTERNALSYM TIMEQ_FOREVER}
  978.   USER_MAXSTORAGE_UNLIMITED = ULONG(-1);
  979.   {$EXTERNALSYM USER_MAXSTORAGE_UNLIMITED}
  980.   USER_NO_LOGOFF            = ULONG(-1);
  981.   {$EXTERNALSYM USER_NO_LOGOFF}
  982.   UNITS_PER_DAY             = 24;
  983.   {$EXTERNALSYM UNITS_PER_DAY}
  984.   UNITS_PER_WEEK            = UNITS_PER_DAY * 7;
  985.   {$EXTERNALSYM UNITS_PER_WEEK}
  986. //
  987. // Privilege levels (USER_INFO_X field usriX_priv (X = 0/1)).
  988. //
  989.   USER_PRIV_MASK  = $3;
  990.   {$EXTERNALSYM USER_PRIV_MASK}
  991.   USER_PRIV_GUEST = 0;
  992.   {$EXTERNALSYM USER_PRIV_GUEST}
  993.   USER_PRIV_USER  = 1;
  994.   {$EXTERNALSYM USER_PRIV_USER}
  995.   USER_PRIV_ADMIN = 2;
  996.   {$EXTERNALSYM USER_PRIV_ADMIN}
  997. //
  998. // user modals related defaults
  999. //
  1000.   MAX_PASSWD_LEN   = PWLEN;
  1001.   {$EXTERNALSYM MAX_PASSWD_LEN}
  1002.   DEF_MIN_PWLEN    = 6;
  1003.   {$EXTERNALSYM DEF_MIN_PWLEN}
  1004.   DEF_PWUNIQUENESS = 5;
  1005.   {$EXTERNALSYM DEF_PWUNIQUENESS}
  1006.   DEF_MAX_PWHIST   = 8;
  1007.   {$EXTERNALSYM DEF_MAX_PWHIST}
  1008.   DEF_MAX_PWAGE    = TIMEQ_FOREVER; // forever
  1009.   {$EXTERNALSYM DEF_MAX_PWAGE}
  1010.   DEF_MIN_PWAGE    = 0; // 0 days
  1011.   {$EXTERNALSYM DEF_MIN_PWAGE}
  1012.   DEF_FORCE_LOGOFF = ULONG($ffffffff); // never
  1013.   {$EXTERNALSYM DEF_FORCE_LOGOFF}
  1014.   DEF_MAX_BADPW    = 0; // no limit
  1015.   {$EXTERNALSYM DEF_MAX_BADPW}
  1016.   ONE_DAY          = ULONG(01*24*3600); // 01 day
  1017.   {$EXTERNALSYM ONE_DAY}
  1018. //
  1019. // User Logon Validation (codes returned)
  1020. //
  1021.   VALIDATED_LOGON     = 0;
  1022.   {$EXTERNALSYM VALIDATED_LOGON}
  1023.   PASSWORD_EXPIRED    = 2;
  1024.   {$EXTERNALSYM PASSWORD_EXPIRED}
  1025.   NON_VALIDATED_LOGON = 3;
  1026.   {$EXTERNALSYM NON_VALIDATED_LOGON}
  1027.   VALID_LOGOFF = 1;
  1028.   {$EXTERNALSYM VALID_LOGOFF}
  1029. //
  1030. // parmnum manifests for user modals
  1031. //
  1032.   MODALS_MIN_PASSWD_LEN_PARMNUM             = 1;
  1033.   {$EXTERNALSYM MODALS_MIN_PASSWD_LEN_PARMNUM}
  1034.   MODALS_MAX_PASSWD_AGE_PARMNUM             = 2;
  1035.   {$EXTERNALSYM MODALS_MAX_PASSWD_AGE_PARMNUM}
  1036.   MODALS_MIN_PASSWD_AGE_PARMNUM             = 3;
  1037.   {$EXTERNALSYM MODALS_MIN_PASSWD_AGE_PARMNUM}
  1038.   MODALS_FORCE_LOGOFF_PARMNUM               = 4;
  1039.   {$EXTERNALSYM MODALS_FORCE_LOGOFF_PARMNUM}
  1040.   MODALS_PASSWD_HIST_LEN_PARMNUM            = 5;
  1041.   {$EXTERNALSYM MODALS_PASSWD_HIST_LEN_PARMNUM}
  1042.   MODALS_ROLE_PARMNUM                       = 6;
  1043.   {$EXTERNALSYM MODALS_ROLE_PARMNUM}
  1044.   MODALS_PRIMARY_PARMNUM                    = 7;
  1045.   {$EXTERNALSYM MODALS_PRIMARY_PARMNUM}
  1046.   MODALS_DOMAIN_NAME_PARMNUM                = 8;
  1047.   {$EXTERNALSYM MODALS_DOMAIN_NAME_PARMNUM}
  1048.   MODALS_DOMAIN_ID_PARMNUM                  = 9;
  1049.   {$EXTERNALSYM MODALS_DOMAIN_ID_PARMNUM}
  1050.   MODALS_LOCKOUT_DURATION_PARMNUM           = 10;
  1051.   {$EXTERNALSYM MODALS_LOCKOUT_DURATION_PARMNUM}
  1052.   MODALS_LOCKOUT_OBSERVATION_WINDOW_PARMNUM = 11;
  1053.   {$EXTERNALSYM MODALS_LOCKOUT_OBSERVATION_WINDOW_PARMNUM}
  1054.   MODALS_LOCKOUT_THRESHOLD_PARMNUM          = 12;
  1055.   {$EXTERNALSYM MODALS_LOCKOUT_THRESHOLD_PARMNUM}
  1056. //
  1057. // the new infolevel counterparts of the old info level + parmnum
  1058. //
  1059.   MODALS_MIN_PASSWD_LEN_INFOLEVEL  = (PARMNUM_BASE_INFOLEVEL + MODALS_MIN_PASSWD_LEN_PARMNUM);
  1060.   {$EXTERNALSYM MODALS_MIN_PASSWD_LEN_INFOLEVEL}
  1061.   MODALS_MAX_PASSWD_AGE_INFOLEVEL  = (PARMNUM_BASE_INFOLEVEL + MODALS_MAX_PASSWD_AGE_PARMNUM);
  1062.   {$EXTERNALSYM MODALS_MAX_PASSWD_AGE_INFOLEVEL}
  1063.   MODALS_MIN_PASSWD_AGE_INFOLEVEL  = (PARMNUM_BASE_INFOLEVEL + MODALS_MIN_PASSWD_AGE_PARMNUM);
  1064.   {$EXTERNALSYM MODALS_MIN_PASSWD_AGE_INFOLEVEL}
  1065.   MODALS_FORCE_LOGOFF_INFOLEVEL    = (PARMNUM_BASE_INFOLEVEL + MODALS_FORCE_LOGOFF_PARMNUM);
  1066.   {$EXTERNALSYM MODALS_FORCE_LOGOFF_INFOLEVEL}
  1067.   MODALS_PASSWD_HIST_LEN_INFOLEVEL = (PARMNUM_BASE_INFOLEVEL + MODALS_PASSWD_HIST_LEN_PARMNUM);
  1068.   {$EXTERNALSYM MODALS_PASSWD_HIST_LEN_INFOLEVEL}
  1069.   MODALS_ROLE_INFOLEVEL            = (PARMNUM_BASE_INFOLEVEL + MODALS_ROLE_PARMNUM);
  1070.   {$EXTERNALSYM MODALS_ROLE_INFOLEVEL}
  1071.   MODALS_PRIMARY_INFOLEVEL         = (PARMNUM_BASE_INFOLEVEL + MODALS_PRIMARY_PARMNUM);
  1072.   {$EXTERNALSYM MODALS_PRIMARY_INFOLEVEL}
  1073.   MODALS_DOMAIN_NAME_INFOLEVEL     = (PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_NAME_PARMNUM);
  1074.   {$EXTERNALSYM MODALS_DOMAIN_NAME_INFOLEVEL}
  1075.   MODALS_DOMAIN_ID_INFOLEVEL       = (PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_ID_PARMNUM);
  1076.   {$EXTERNALSYM MODALS_DOMAIN_ID_INFOLEVEL}
  1077. //
  1078. // Group Class
  1079. //
  1080. //
  1081. // Function Prototypes
  1082. //
  1083. function NetGroupAdd(servername: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  1084. {$EXTERNALSYM NetGroupAdd}
  1085. function NetGroupAddUser(servername, GroupName, username: LPCWSTR): NET_API_STATUS; stdcall;
  1086. {$EXTERNALSYM NetGroupAddUser}
  1087. function NetGroupEnum(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries: LPDWORD; resume_handle: PDWORD_PTR): NET_API_STATUS; stdcall;
  1088. {$EXTERNALSYM NetGroupEnum}
  1089. function NetGroupGetInfo(servername, groupname: LPCWSTR; level: DWORD; bufptr: LPBYTE): NET_API_STATUS; stdcall;
  1090. {$EXTERNALSYM NetGroupGetInfo}
  1091. function NetGroupSetInfo(servername, groupname: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  1092. {$EXTERNALSYM NetGroupSetInfo}
  1093. function NetGroupDel(servername: LPCWSTR; groupname: LPCWSTR): NET_API_STATUS; stdcall;
  1094. {$EXTERNALSYM NetGroupDel}
  1095. function NetGroupDelUser(servername: LPCWSTR; GroupName: LPCWSTR; Username: LPCWSTR): NET_API_STATUS; stdcall;
  1096. {$EXTERNALSYM NetGroupDelUser}
  1097. function NetGroupGetUsers(servername, groupname: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries: LPDWORD; ResumeHandle: PDWORD_PTR): NET_API_STATUS; stdcall;
  1098. {$EXTERNALSYM NetGroupGetUsers}
  1099. function NetGroupSetUsers(servername, groupname: LPCWSTR; level: DWORD; buf: LPBYTE; totalentries: DWORD): NET_API_STATUS; stdcall;
  1100. {$EXTERNALSYM NetGroupSetUsers}
  1101. //
  1102. //  Data Structures - Group
  1103. //
  1104. type
  1105.   LPGROUP_INFO_0 = ^GROUP_INFO_0;
  1106.   {$EXTERNALSYM LPGROUP_INFO_0}
  1107.   PGROUP_INFO_0 = ^GROUP_INFO_0;
  1108.   {$EXTERNALSYM PGROUP_INFO_0}
  1109.   _GROUP_INFO_0 = record
  1110.     grpi0_name: LPWSTR;
  1111.   end;
  1112.   {$EXTERNALSYM _GROUP_INFO_0}
  1113.   GROUP_INFO_0 = _GROUP_INFO_0;
  1114.   {$EXTERNALSYM GROUP_INFO_0}
  1115.   TGroupInfo0 = GROUP_INFO_0;
  1116.   PGroupInfo0 = PGROUP_INFO_0;
  1117.   LPGROUP_INFO_1 = ^GROUP_INFO_1;
  1118.   {$EXTERNALSYM LPGROUP_INFO_1}
  1119.   PGROUP_INFO_1 = ^GROUP_INFO_1;
  1120.   {$EXTERNALSYM PGROUP_INFO_1}
  1121.   _GROUP_INFO_1 = record
  1122.     grpi1_name: LPWSTR;
  1123.     grpi1_comment: LPWSTR;
  1124.   end;
  1125.   {$EXTERNALSYM _GROUP_INFO_1}
  1126.   GROUP_INFO_1 = _GROUP_INFO_1;
  1127.   {$EXTERNALSYM GROUP_INFO_1}
  1128.   TGroupInfo1 = GROUP_INFO_1;
  1129.   PGroupInfo1 = PGROUP_INFO_1;
  1130.   LPGROUP_INFO_2 = ^GROUP_INFO_2;
  1131.   {$EXTERNALSYM LPGROUP_INFO_2}
  1132.   PGROUP_INFO_2 = ^GROUP_INFO_2;
  1133.   {$EXTERNALSYM PGROUP_INFO_2}
  1134.   _GROUP_INFO_2 = record
  1135.     grpi2_name: LPWSTR;
  1136.     grpi2_comment: LPWSTR;
  1137.     grpi2_group_id: DWORD;
  1138.     grpi2_attributes: DWORD;
  1139.   end;
  1140.   {$EXTERNALSYM _GROUP_INFO_2}
  1141.   GROUP_INFO_2 = _GROUP_INFO_2;
  1142.   {$EXTERNALSYM GROUP_INFO_2}
  1143.   TGroupInfo2 = GROUP_INFO_2;
  1144.   PGroupInfo2 = PGROUP_INFO_2;
  1145.   LPGROUP_INFO_3 = ^GROUP_INFO_3;
  1146.   {$EXTERNALSYM LPGROUP_INFO_3}
  1147.   PGROUP_INFO_3 = ^GROUP_INFO_3;
  1148.   {$EXTERNALSYM PGROUP_INFO_3}
  1149.   _GROUP_INFO_3 = record
  1150.     grpi3_name: LPWSTR;
  1151.     grpi3_comment: LPWSTR;
  1152.     grpi3_group_sid: PSID;
  1153.     grpi3_attributes: DWORD;
  1154.   end;
  1155.   {$EXTERNALSYM _GROUP_INFO_3}
  1156.   GROUP_INFO_3 = _GROUP_INFO_3;
  1157.   {$EXTERNALSYM GROUP_INFO_3}
  1158.   TGroupInfo3 = GROUP_INFO_3;
  1159.   PGroupInfo3 = PGROUP_INFO_3;
  1160.   LPGROUP_INFO_1002 = ^GROUP_INFO_1002;
  1161.   {$EXTERNALSYM LPGROUP_INFO_1002}
  1162.   PGROUP_INFO_1002 = ^GROUP_INFO_1002;
  1163.   {$EXTERNALSYM PGROUP_INFO_1002}
  1164.   _GROUP_INFO_1002 = record
  1165.     grpi1002_comment: LPWSTR;
  1166.   end;
  1167.   {$EXTERNALSYM _GROUP_INFO_1002}
  1168.   GROUP_INFO_1002 = _GROUP_INFO_1002;
  1169.   {$EXTERNALSYM GROUP_INFO_1002}
  1170.   TGroupInfo1002 = GROUP_INFO_1002;
  1171.   PGroupInfo1002 = PGROUP_INFO_1002;
  1172.   LPGROUP_INFO_1005 = ^GROUP_INFO_1005;
  1173.   {$EXTERNALSYM LPGROUP_INFO_1005}
  1174.   PGROUP_INFO_1005 = ^GROUP_INFO_1005;
  1175.   {$EXTERNALSYM PGROUP_INFO_1005}
  1176.   _GROUP_INFO_1005 = record
  1177.     grpi1005_attributes: DWORD;
  1178.   end;
  1179.   {$EXTERNALSYM _GROUP_INFO_1005}
  1180.   GROUP_INFO_1005 = _GROUP_INFO_1005;
  1181.   {$EXTERNALSYM GROUP_INFO_1005}
  1182.   TGroupInfo1005 = GROUP_INFO_1005;
  1183.   PGroupInfo1005 = PGROUP_INFO_1005;
  1184.   LPGROUP_USERS_INFO_0 = ^GROUP_USERS_INFO_0;
  1185.   {$EXTERNALSYM LPGROUP_USERS_INFO_0}
  1186.   PGROUP_USERS_INFO_0 = ^GROUP_USERS_INFO_0;
  1187.   {$EXTERNALSYM PGROUP_USERS_INFO_0}
  1188.   _GROUP_USERS_INFO_0 = record
  1189.     grui0_name: LPWSTR;
  1190.   end;
  1191.   {$EXTERNALSYM _GROUP_USERS_INFO_0}
  1192.   GROUP_USERS_INFO_0 = _GROUP_USERS_INFO_0;
  1193.   {$EXTERNALSYM GROUP_USERS_INFO_0}
  1194.   TGroupUsersInfo0 = GROUP_USERS_INFO_0;
  1195.   PGroupUsersInfo0 = PGROUP_USERS_INFO_0;
  1196.   LPGROUP_USERS_INFO_1 = ^GROUP_USERS_INFO_1;
  1197.   {$EXTERNALSYM LPGROUP_USERS_INFO_1}
  1198.   PGROUP_USERS_INFO_1 = ^GROUP_USERS_INFO_1;
  1199.   {$EXTERNALSYM PGROUP_USERS_INFO_1}
  1200.   _GROUP_USERS_INFO_1 = record
  1201.     grui1_name: LPWSTR;
  1202.     grui1_attributes: DWORD;
  1203.   end;
  1204.   {$EXTERNALSYM _GROUP_USERS_INFO_1}
  1205.   GROUP_USERS_INFO_1 = _GROUP_USERS_INFO_1;
  1206.   {$EXTERNALSYM GROUP_USERS_INFO_1}
  1207.   TGroupUsersInfo1 = GROUP_USERS_INFO_1;
  1208.   PGroupUsersInfo1 = PGROUP_USERS_INFO_1;
  1209. //
  1210. // Special Values and Constants - Group
  1211. //
  1212. const
  1213.   GROUPIDMASK = $8000; // MSB set if uid refers to a group
  1214.   {$EXTERNALSYM GROUPIDMASK}
  1215. //
  1216. // Predefined group for all normal users, administrators and guests
  1217. // LOCAL is a special group for pinball local security.
  1218. //
  1219.   GROUP_SPECIALGRP_USERS  = WideString('USERS');
  1220.   {$EXTERNALSYM GROUP_SPECIALGRP_USERS}
  1221.   GROUP_SPECIALGRP_ADMINS = WideString('ADMINS');
  1222.   {$EXTERNALSYM GROUP_SPECIALGRP_ADMINS}
  1223.   GROUP_SPECIALGRP_GUESTS = WideString('GUESTS');
  1224.   {$EXTERNALSYM GROUP_SPECIALGRP_GUESTS}
  1225.   GROUP_SPECIALGRP_LOCAL  = WideString('LOCAL');
  1226.   {$EXTERNALSYM GROUP_SPECIALGRP_LOCAL}
  1227. //
  1228. // parmnum manifests for SetInfo calls (only comment is settable)
  1229. //
  1230.   GROUP_ALL_PARMNUM        = 0;
  1231.   {$EXTERNALSYM GROUP_ALL_PARMNUM}
  1232.   GROUP_NAME_PARMNUM       = 1;
  1233.   {$EXTERNALSYM GROUP_NAME_PARMNUM}
  1234.   GROUP_COMMENT_PARMNUM    = 2;
  1235.   {$EXTERNALSYM GROUP_COMMENT_PARMNUM}
  1236.   GROUP_ATTRIBUTES_PARMNUM = 3;
  1237.   {$EXTERNALSYM GROUP_ATTRIBUTES_PARMNUM}
  1238. //
  1239. // the new infolevel counterparts of the old info level + parmnum
  1240. //
  1241.   GROUP_ALL_INFOLEVEL        = (PARMNUM_BASE_INFOLEVEL + GROUP_ALL_PARMNUM);
  1242.   {$EXTERNALSYM GROUP_ALL_INFOLEVEL}
  1243.   GROUP_NAME_INFOLEVEL       = (PARMNUM_BASE_INFOLEVEL + GROUP_NAME_PARMNUM);
  1244.   {$EXTERNALSYM GROUP_NAME_INFOLEVEL}
  1245.   GROUP_COMMENT_INFOLEVEL    = (PARMNUM_BASE_INFOLEVEL + GROUP_COMMENT_PARMNUM);
  1246.   {$EXTERNALSYM GROUP_COMMENT_INFOLEVEL}
  1247.   GROUP_ATTRIBUTES_INFOLEVEL = (PARMNUM_BASE_INFOLEVEL + GROUP_ATTRIBUTES_PARMNUM);
  1248.   {$EXTERNALSYM GROUP_ATTRIBUTES_INFOLEVEL}
  1249. //  todo see GROUP_POSIX_ID_PARMNUM
  1250. //  GROUP_POSIX_ID_INFOLEVEL   = (PARMNUM_BASE_INFOLEVEL + GROUP_POSIX_ID_PARMNUM);
  1251. //  {$EXTERNALSYM GROUP_POSIX_ID_INFOLEVEL}
  1252. //
  1253. // LocalGroup Class
  1254. //
  1255. //
  1256. // Function Prototypes
  1257. //
  1258. function NetLocalGroupAdd(servername: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  1259. {$EXTERNALSYM NetLocalGroupAdd}
  1260. function NetLocalGroupAddMember(servername, groupname: LPCWSTR; membersid: PSID): NET_API_STATUS; stdcall;
  1261. {$EXTERNALSYM NetLocalGroupAddMember}
  1262. function NetLocalGroupEnum(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries: LPDWORD; resumehandle: PDWORD_PTR): NET_API_STATUS; stdcall;
  1263. {$EXTERNALSYM NetLocalGroupEnum}
  1264. function NetLocalGroupGetInfo(servername, groupname: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  1265. {$EXTERNALSYM NetLocalGroupGetInfo}
  1266. function NetLocalGroupSetInfo(servername, groupname: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  1267. {$EXTERNALSYM NetLocalGroupSetInfo}
  1268. function NetLocalGroupDel(servername: LPCWSTR; groupname: LPCWSTR): NET_API_STATUS; stdcall;
  1269. {$EXTERNALSYM NetLocalGroupDel}
  1270. function NetLocalGroupDelMember(servername: LPCWSTR; groupname: LPCWSTR; membersid: PSID): NET_API_STATUS; stdcall;
  1271. {$EXTERNALSYM NetLocalGroupDelMember}
  1272. function NetLocalGroupGetMembers(servername, localgroupname: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries: LPDWORD; resumehandle: PDWORD_PTR): NET_API_STATUS; stdcall;
  1273. {$EXTERNALSYM NetLocalGroupGetMembers}
  1274. function NetLocalGroupSetMembers(servername, groupname: LPCWSTR; level: DWORD; buf: LPBYTE; totalentries: DWORD): NET_API_STATUS; stdcall;
  1275. {$EXTERNALSYM NetLocalGroupSetMembers}
  1276. function NetLocalGroupAddMembers(servername, groupname: LPCWSTR; level: DWORD; buf: LPBYTE; totalentries: DWORD): NET_API_STATUS; stdcall;
  1277. {$EXTERNALSYM NetLocalGroupAddMembers}
  1278. function NetLocalGroupDelMembers(servername, groupname: LPCWSTR; level: DWORD; buf: LPBYTE; totalentries: DWORD): NET_API_STATUS; stdcall;
  1279. {$EXTERNALSYM NetLocalGroupDelMembers}
  1280. //
  1281. //  Data Structures - LocalGroup
  1282. //
  1283. type
  1284.   LPLOCALGROUP_INFO_0 = ^LOCALGROUP_INFO_0;
  1285.   {$EXTERNALSYM LPLOCALGROUP_INFO_0}
  1286.   PLOCALGROUP_INFO_0 = ^LOCALGROUP_INFO_0;
  1287.   {$EXTERNALSYM PLOCALGROUP_INFO_0}
  1288.   _LOCALGROUP_INFO_0 = record
  1289.     lgrpi0_name: LPWSTR;
  1290.   end;
  1291.   {$EXTERNALSYM _LOCALGROUP_INFO_0}
  1292.   LOCALGROUP_INFO_0 = _LOCALGROUP_INFO_0;
  1293.   {$EXTERNALSYM LOCALGROUP_INFO_0}
  1294.   TLocalGroupInfo0 = LOCALGROUP_INFO_0;
  1295.   PLocalGroupInfo0 = PLOCALGROUP_INFO_0;
  1296.   LPLOCALGROUP_INFO_1 = ^LOCALGROUP_INFO_1;
  1297.   {$EXTERNALSYM LPLOCALGROUP_INFO_1}
  1298.   PLOCALGROUP_INFO_1 = ^LOCALGROUP_INFO_1;
  1299.   {$EXTERNALSYM PLOCALGROUP_INFO_1}
  1300.   _LOCALGROUP_INFO_1 = record
  1301.     lgrpi1_name: LPWSTR;
  1302.     lgrpi1_comment: LPWSTR;
  1303.   end;
  1304.   {$EXTERNALSYM _LOCALGROUP_INFO_1}
  1305.   LOCALGROUP_INFO_1 = _LOCALGROUP_INFO_1;
  1306.   {$EXTERNALSYM LOCALGROUP_INFO_1}
  1307.   TLocalGroupInfo1 = LOCALGROUP_INFO_1;
  1308.   PLocalGroupInfo1 = PLOCALGROUP_INFO_1;
  1309.   LPLOCALGROUP_INFO_1002 = ^LOCALGROUP_INFO_1002;
  1310.   {$EXTERNALSYM LPLOCALGROUP_INFO_1002}
  1311.   PLOCALGROUP_INFO_1002 = ^LOCALGROUP_INFO_1002;
  1312.   {$EXTERNALSYM PLOCALGROUP_INFO_1002}
  1313.   _LOCALGROUP_INFO_1002 = record
  1314.     lgrpi1002_comment: LPWSTR;
  1315.   end;
  1316.   {$EXTERNALSYM _LOCALGROUP_INFO_1002}
  1317.   LOCALGROUP_INFO_1002 = _LOCALGROUP_INFO_1002;
  1318.   {$EXTERNALSYM LOCALGROUP_INFO_1002}
  1319.   TLocalGroupInfo1002 = LOCALGROUP_INFO_1002;
  1320.   PLocalGroupInfo1002 = PLOCALGROUP_INFO_1002;
  1321.   LPLOCALGROUP_MEMBERS_INFO_0 = ^LOCALGROUP_MEMBERS_INFO_0;
  1322.   {$EXTERNALSYM LPLOCALGROUP_MEMBERS_INFO_0}
  1323.   PLOCALGROUP_MEMBERS_INFO_0 = ^LOCALGROUP_MEMBERS_INFO_0;
  1324.   {$EXTERNALSYM PLOCALGROUP_MEMBERS_INFO_0}
  1325.   _LOCALGROUP_MEMBERS_INFO_0 = record
  1326.     lgrmi0_sid: PSID;
  1327.   end;
  1328.   {$EXTERNALSYM _LOCALGROUP_MEMBERS_INFO_0}
  1329.   LOCALGROUP_MEMBERS_INFO_0 = _LOCALGROUP_MEMBERS_INFO_0;
  1330.   {$EXTERNALSYM LOCALGROUP_MEMBERS_INFO_0}
  1331.   TLocalGroupMembersInfo0 = LOCALGROUP_MEMBERS_INFO_0;
  1332.   PLocalGroupMembersInfo0 = PLOCALGROUP_MEMBERS_INFO_0;
  1333.   LPLOCALGROUP_MEMBERS_INFO_1 = ^LOCALGROUP_MEMBERS_INFO_1;
  1334.   {$EXTERNALSYM LPLOCALGROUP_MEMBERS_INFO_1}
  1335.   PLOCALGROUP_MEMBERS_INFO_1 = ^LOCALGROUP_MEMBERS_INFO_1;
  1336.   {$EXTERNALSYM PLOCALGROUP_MEMBERS_INFO_1}
  1337.   _LOCALGROUP_MEMBERS_INFO_1 = record
  1338.     lgrmi1_sid: PSID;
  1339.     lgrmi1_sidusage: SID_NAME_USE;
  1340.     lgrmi1_name: LPWSTR;
  1341.   end;
  1342.   {$EXTERNALSYM _LOCALGROUP_MEMBERS_INFO_1}
  1343.   LOCALGROUP_MEMBERS_INFO_1 = _LOCALGROUP_MEMBERS_INFO_1;
  1344.   {$EXTERNALSYM LOCALGROUP_MEMBERS_INFO_1}
  1345.   TLocalGroupMembersInfo1 = LOCALGROUP_MEMBERS_INFO_1;
  1346.   PLocalGroupMembersInfo1 = PLOCALGROUP_MEMBERS_INFO_1;
  1347.   LPLOCALGROUP_MEMBERS_INFO_2 = ^LOCALGROUP_MEMBERS_INFO_2;
  1348.   {$EXTERNALSYM LPLOCALGROUP_MEMBERS_INFO_2}
  1349.   PLOCALGROUP_MEMBERS_INFO_2 = ^LOCALGROUP_MEMBERS_INFO_2;
  1350.   {$EXTERNALSYM PLOCALGROUP_MEMBERS_INFO_2}
  1351.   _LOCALGROUP_MEMBERS_INFO_2 = record
  1352.     lgrmi2_sid: PSID;
  1353.     lgrmi2_sidusage: SID_NAME_USE;
  1354.     lgrmi2_domainandname: LPWSTR;
  1355.   end;
  1356.   {$EXTERNALSYM _LOCALGROUP_MEMBERS_INFO_2}
  1357.   LOCALGROUP_MEMBERS_INFO_2 = _LOCALGROUP_MEMBERS_INFO_2;
  1358.   {$EXTERNALSYM LOCALGROUP_MEMBERS_INFO_2}
  1359.   TLocalGroupMembersInfo2 = LOCALGROUP_MEMBERS_INFO_2;
  1360.   PLocalGroupMembersInfo2 = PLOCALGROUP_MEMBERS_INFO_2;
  1361.   LPLOCALGROUP_MEMBERS_INFO_3 = ^LOCALGROUP_MEMBERS_INFO_3;
  1362.   {$EXTERNALSYM LPLOCALGROUP_MEMBERS_INFO_3}
  1363.   PLOCALGROUP_MEMBERS_INFO_3 = ^LOCALGROUP_MEMBERS_INFO_3;
  1364.   {$EXTERNALSYM PLOCALGROUP_MEMBERS_INFO_3}
  1365.   _LOCALGROUP_MEMBERS_INFO_3 = record
  1366.     lgrmi3_domainandname: LPWSTR;
  1367.   end;
  1368.   {$EXTERNALSYM _LOCALGROUP_MEMBERS_INFO_3}
  1369.   LOCALGROUP_MEMBERS_INFO_3 = _LOCALGROUP_MEMBERS_INFO_3;
  1370.   {$EXTERNALSYM LOCALGROUP_MEMBERS_INFO_3}
  1371.   TLocalGroupMembersInfo3 = LOCALGROUP_MEMBERS_INFO_3;
  1372.   PLocalGroupMembersInfo3 = PLOCALGROUP_MEMBERS_INFO_3;
  1373.   LPLOCALGROUP_USERS_INFO_0 = ^LOCALGROUP_USERS_INFO_0;
  1374.   {$EXTERNALSYM LPLOCALGROUP_USERS_INFO_0}
  1375.   PLOCALGROUP_USERS_INFO_0 = ^LOCALGROUP_USERS_INFO_0;
  1376.   {$EXTERNALSYM PLOCALGROUP_USERS_INFO_0}
  1377.   _LOCALGROUP_USERS_INFO_0 = record
  1378.     lgrui0_name: LPWSTR;
  1379.   end;
  1380.   {$EXTERNALSYM _LOCALGROUP_USERS_INFO_0}
  1381.   LOCALGROUP_USERS_INFO_0 = _LOCALGROUP_USERS_INFO_0;
  1382.   {$EXTERNALSYM LOCALGROUP_USERS_INFO_0}
  1383.   TLocalGroupUsersInfo0 = LOCALGROUP_USERS_INFO_0;
  1384.   PLocalGroupUsersInfo0 = PLOCALGROUP_USERS_INFO_0;
  1385. const
  1386.   LOCALGROUP_NAME_PARMNUM    = 1;
  1387.   {$EXTERNALSYM LOCALGROUP_NAME_PARMNUM}
  1388.   LOCALGROUP_COMMENT_PARMNUM = 2;
  1389.   {$EXTERNALSYM LOCALGROUP_COMMENT_PARMNUM}
  1390. //
  1391. // Display Information APIs
  1392. //
  1393. function NetQueryDisplayInformation(ServerName: LPCWSTR; Level, Index, EntriesRequested, PreferredMaximumLength: DWORD; ReturnedEntryCount: LPDWORD; var SortedBuffer: PVOID): NET_API_STATUS; stdcall;
  1394. {$EXTERNALSYM NetQueryDisplayInformation}
  1395. function NetGetDisplayInformationIndex(ServerName: LPCWSTR; Level: DWORD; Prefix: LPCWSTR; Index: LPDWORD): NET_API_STATUS; stdcall;
  1396. {$EXTERNALSYM NetGetDisplayInformationIndex}
  1397. //
  1398. // QueryDisplayInformation levels
  1399. type
  1400.   PNET_DISPLAY_USER = ^NET_DISPLAY_USER;
  1401.   {$EXTERNALSYM PNET_DISPLAY_USER}
  1402.   _NET_DISPLAY_USER = record
  1403.     usri1_name: LPWSTR;
  1404.     usri1_comment: LPWSTR;
  1405.     usri1_flags: DWORD;
  1406.     usri1_full_name: LPWSTR;
  1407.     usri1_user_id: DWORD;
  1408.     usri1_next_index: DWORD;
  1409.   end;
  1410.   {$EXTERNALSYM _NET_DISPLAY_USER}
  1411.   NET_DISPLAY_USER = _NET_DISPLAY_USER;
  1412.   {$EXTERNALSYM NET_DISPLAY_USER}
  1413.   TNetDisplayUser = NET_DISPLAY_USER;
  1414.   PNetDisplayUser = PNET_DISPLAY_USER;
  1415.   PNET_DISPLAY_MACHINE = ^NET_DISPLAY_MACHINE;
  1416.   {$EXTERNALSYM PNET_DISPLAY_MACHINE}
  1417.   _NET_DISPLAY_MACHINE = record
  1418.     usri2_name: LPWSTR;
  1419.     usri2_comment: LPWSTR;
  1420.     usri2_flags: DWORD;
  1421.     usri2_user_id: DWORD;
  1422.     usri2_next_index: DWORD;
  1423.   end;
  1424.   {$EXTERNALSYM _NET_DISPLAY_MACHINE}
  1425.   NET_DISPLAY_MACHINE = _NET_DISPLAY_MACHINE;
  1426.   {$EXTERNALSYM NET_DISPLAY_MACHINE}
  1427.   TNetDisplayMachine = NET_DISPLAY_MACHINE;
  1428.   PNetDisplayMachine = PNET_DISPLAY_MACHINE;
  1429.   PNET_DISPLAY_GROUP = ^NET_DISPLAY_GROUP;
  1430.   {$EXTERNALSYM PNET_DISPLAY_GROUP}
  1431.   _NET_DISPLAY_GROUP = record
  1432.     grpi3_name: LPWSTR;
  1433.     grpi3_comment: LPWSTR;
  1434.     grpi3_group_id: DWORD;
  1435.     grpi3_attributes: DWORD;
  1436.     grpi3_next_index: DWORD;
  1437.   end;
  1438.   {$EXTERNALSYM _NET_DISPLAY_GROUP}
  1439.   NET_DISPLAY_GROUP = _NET_DISPLAY_GROUP;
  1440.   {$EXTERNALSYM NET_DISPLAY_GROUP}
  1441.   TNetDisplayGroup = NET_DISPLAY_GROUP;
  1442.   PNetDisplayGroup = PNET_DISPLAY_GROUP;
  1443. //
  1444. // Access Class
  1445. //
  1446. //
  1447. // Function Prototypes - Access
  1448. //
  1449. //
  1450. // The NetAccess APIs are only available to downlevel
  1451. //
  1452. //#define NetAccessAdd RxNetAccessAdd
  1453. function NetAccessAdd(servername: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  1454. {$EXTERNALSYM NetAccessAdd}
  1455. //#define NetAccessEnum RxNetAccessEnum
  1456. function NetAccessEnum(servername, BasePath: LPCWSTR; Recursive, level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries, resume_handle: LPDWORD): NET_API_STATUS; stdcall;
  1457. {$EXTERNALSYM NetAccessEnum}
  1458. //#define NetAccessGetInfo RxNetAccessGetInfo
  1459. function NetAccessGetInfo(servername, resource: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  1460. {$EXTERNALSYM NetAccessGetInfo}
  1461. //#define NetAccessSetInfo RxNetAccessSetInfo
  1462. function NetAccessSetInfo(servername, resource: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  1463. {$EXTERNALSYM NetAccessSetInfo}
  1464. //#define NetAccessDel RxNetAccessDel
  1465. function NetAccessDel(servername: LPCWSTR; resource: LPCWSTR): NET_API_STATUS; stdcall;
  1466. {$EXTERNALSYM NetAccessDel}
  1467. //#define NetAccessGetUserPerms RxNetAccessGetUserPerms
  1468. function NetAccessGetUserPerms(servername, UGname, resource: LPCWSTR; Perms: LPDWORD): NET_API_STATUS; stdcall;
  1469. {$EXTERNALSYM NetAccessGetUserPerms}
  1470. //
  1471. // Data Structures - Access
  1472. //
  1473. type
  1474.   LPACCESS_INFO_0 = ^ACCESS_INFO_0;
  1475.   {$EXTERNALSYM LPACCESS_INFO_0}
  1476.   PACCESS_INFO_0 = ^ACCESS_INFO_0;
  1477.   {$EXTERNALSYM PACCESS_INFO_0}
  1478.   _ACCESS_INFO_0 = record
  1479.     acc0_resource_name: LPWSTR;
  1480.   end;
  1481.   {$EXTERNALSYM _ACCESS_INFO_0}
  1482.   ACCESS_INFO_0 = _ACCESS_INFO_0;
  1483.   {$EXTERNALSYM ACCESS_INFO_0}
  1484.   TAccessInfo0 = ACCESS_INFO_0;
  1485.   PAccessInfo0 = PACCESS_INFO_0;
  1486.   LPACCESS_INFO_1 = ^ACCESS_INFO_1;
  1487.   {$EXTERNALSYM LPACCESS_INFO_1}
  1488.   PACCESS_INFO_1 = ^ACCESS_INFO_1;
  1489.   {$EXTERNALSYM PACCESS_INFO_1}
  1490.   _ACCESS_INFO_1 = record
  1491.     acc1_resource_name: LPWSTR;
  1492.     acc1_attr: DWORD;
  1493.     acc1_count: DWORD;
  1494.   end;
  1495.   {$EXTERNALSYM _ACCESS_INFO_1}
  1496.   ACCESS_INFO_1 = _ACCESS_INFO_1;
  1497.   {$EXTERNALSYM ACCESS_INFO_1}
  1498.   TAccessInfo1 = ACCESS_INFO_1;
  1499.   PAccessInfo1 = PACCESS_INFO_1;
  1500.   LPACCESS_INFO_1002 = ^ACCESS_INFO_1002;
  1501.   {$EXTERNALSYM LPACCESS_INFO_1002}
  1502.   PACCESS_INFO_1002 = ^ACCESS_INFO_1002;
  1503.   {$EXTERNALSYM PACCESS_INFO_1002}
  1504.   _ACCESS_INFO_1002 = record
  1505.     acc1002_attr: DWORD;
  1506.   end;
  1507.   {$EXTERNALSYM _ACCESS_INFO_1002}
  1508.   ACCESS_INFO_1002 = _ACCESS_INFO_1002;
  1509.   {$EXTERNALSYM ACCESS_INFO_1002}
  1510.   TAccessInfo1002 = ACCESS_INFO_1002;
  1511.   PAccessInfo1002 = PACCESS_INFO_1002;
  1512.   LPACCESS_LIST = ^ACCESS_LIST;
  1513.   {$EXTERNALSYM LPACCESS_LIST}
  1514.   PACCESS_LIST = ^ACCESS_LIST;
  1515.   {$EXTERNALSYM PACCESS_LIST}
  1516.   _ACCESS_LIST = record
  1517.     acl_ugname: LPWSTR;
  1518.     acl_access: DWORD;
  1519.   end;
  1520.   {$EXTERNALSYM _ACCESS_LIST}
  1521.   ACCESS_LIST = _ACCESS_LIST;
  1522.   {$EXTERNALSYM ACCESS_LIST}
  1523.   TAccessList = ACCESS_LIST;
  1524.   PAccessList = PACCESS_LIST;
  1525. //
  1526. // Special Values and Constants - Access
  1527. //
  1528. //
  1529. // Maximum number of permission entries for each resource.
  1530. //
  1531. const
  1532.   MAXPERMENTRIES = 64;
  1533.   {$EXTERNALSYM MAXPERMENTRIES}
  1534. //
  1535. //  Bit values for the access permissions.  ACCESS_ALL is a handy
  1536. //  way to specify maximum permissions.  These are used in
  1537. //  acl_access field of access_list structures.
  1538. //
  1539.   ACCESS_READ   = $01;
  1540.   {$EXTERNALSYM ACCESS_READ}
  1541.   ACCESS_WRITE  = $02;
  1542.   {$EXTERNALSYM ACCESS_WRITE}
  1543.   ACCESS_CREATE = $04;
  1544.   {$EXTERNALSYM ACCESS_CREATE}
  1545.   ACCESS_EXEC   = $08;
  1546.   {$EXTERNALSYM ACCESS_EXEC}
  1547.   ACCESS_DELETE = $10;
  1548.   {$EXTERNALSYM ACCESS_DELETE}
  1549.   ACCESS_ATRIB  = $20;
  1550.   {$EXTERNALSYM ACCESS_ATRIB}
  1551.   ACCESS_PERM   = $40;
  1552.   {$EXTERNALSYM ACCESS_PERM}
  1553.   ACCESS_GROUP = $8000;
  1554.   {$EXTERNALSYM ACCESS_GROUP}
  1555.   ACCESS_NONE = 0;
  1556.   {$EXTERNALSYM ACCESS_NONE}
  1557.   ACCESS_ALL  = (ACCESS_READ or ACCESS_WRITE or ACCESS_CREATE or ACCESS_EXEC or ACCESS_DELETE or ACCESS_ATRIB or ACCESS_PERM);
  1558.   {$EXTERNALSYM ACCESS_ALL}
  1559.   
  1560. //
  1561. // Bit values for the acc1_attr field of the ACCESS_INFO_1 structure.
  1562. //
  1563.   ACCESS_AUDIT = $1;
  1564.   {$EXTERNALSYM ACCESS_AUDIT}
  1565.   ACCESS_SUCCESS_OPEN   = $10;
  1566.   {$EXTERNALSYM ACCESS_SUCCESS_OPEN}
  1567.   ACCESS_SUCCESS_WRITE  = $20;
  1568.   {$EXTERNALSYM ACCESS_SUCCESS_WRITE}
  1569.   ACCESS_SUCCESS_DELETE = $40;
  1570.   {$EXTERNALSYM ACCESS_SUCCESS_DELETE}
  1571.   ACCESS_SUCCESS_ACL    = $80;
  1572.   {$EXTERNALSYM ACCESS_SUCCESS_ACL}
  1573.   ACCESS_SUCCESS_MASK   = $F0;
  1574.   {$EXTERNALSYM ACCESS_SUCCESS_MASK}
  1575.   ACCESS_FAIL_OPEN   = $100;
  1576.   {$EXTERNALSYM ACCESS_FAIL_OPEN}
  1577.   ACCESS_FAIL_WRITE  = $200;
  1578.   {$EXTERNALSYM ACCESS_FAIL_WRITE}
  1579.   ACCESS_FAIL_DELETE = $400;
  1580.   {$EXTERNALSYM ACCESS_FAIL_DELETE}
  1581.   ACCESS_FAIL_ACL    = $800;
  1582.   {$EXTERNALSYM ACCESS_FAIL_ACL}
  1583.   ACCESS_FAIL_MASK   = $F00;
  1584.   {$EXTERNALSYM ACCESS_FAIL_MASK}
  1585.   ACCESS_FAIL_SHIFT = 4;
  1586.   {$EXTERNALSYM ACCESS_FAIL_SHIFT}
  1587. //
  1588. // Parmnum value for NetAccessSetInfo.
  1589. //
  1590.   ACCESS_RESOURCE_NAME_PARMNUM = 1;
  1591.   {$EXTERNALSYM ACCESS_RESOURCE_NAME_PARMNUM}
  1592.   ACCESS_ATTR_PARMNUM          = 2;
  1593.   {$EXTERNALSYM ACCESS_ATTR_PARMNUM}
  1594.   ACCESS_COUNT_PARMNUM         = 3;
  1595.   {$EXTERNALSYM ACCESS_COUNT_PARMNUM}
  1596.   ACCESS_ACCESS_LIST_PARMNUM   = 4;
  1597.   {$EXTERNALSYM ACCESS_ACCESS_LIST_PARMNUM}
  1598. //
  1599. // the new infolevel counterparts of the old info level + parmnum
  1600. //
  1601.   ACCESS_RESOURCE_NAME_INFOLEVEL = (PARMNUM_BASE_INFOLEVEL + ACCESS_RESOURCE_NAME_PARMNUM);
  1602.   {$EXTERNALSYM ACCESS_RESOURCE_NAME_INFOLEVEL}
  1603.   ACCESS_ATTR_INFOLEVEL          = (PARMNUM_BASE_INFOLEVEL + ACCESS_ATTR_PARMNUM);
  1604.   {$EXTERNALSYM ACCESS_ATTR_INFOLEVEL}
  1605.   ACCESS_COUNT_INFOLEVEL         = (PARMNUM_BASE_INFOLEVEL + ACCESS_COUNT_PARMNUM);
  1606.   {$EXTERNALSYM ACCESS_COUNT_INFOLEVEL}
  1607.   ACCESS_ACCESS_LIST_INFOLEVEL   = (PARMNUM_BASE_INFOLEVEL + ACCESS_ACCESS_LIST_PARMNUM);
  1608.   {$EXTERNALSYM ACCESS_ACCESS_LIST_INFOLEVEL}
  1609. //
  1610. // ACCESS_LETTERS defines a letter for each bit position in
  1611. // the acl_access field of struct access_list.  Note that some
  1612. // bits have a corresponding letter of ' ' (space).
  1613. //
  1614.   ACCESS_LETTERS = 'RWCXDAP         ';
  1615.   {$EXTERNALSYM ACCESS_LETTERS}
  1616. //    ********************************
  1617. //
  1618. //    Password Checking API structures
  1619. //
  1620. //    ********************************
  1621. //
  1622. //    What kind of password checking is to be performed?
  1623. //        NetValidateAuthentication : Check if the authentication can be done
  1624. //        NetValidatePasswordChange: Check if the password can be changed
  1625. //        NetValidatePasswordReset: Reset the password to the given value
  1626. //
  1627. type
  1628.   _NET_VALIDATE_PASSWORD_TYPE = (
  1629.     NetValidateFiller0,
  1630.     NetValidateAuthentication,
  1631.     NetValidatePasswordChange,
  1632.     NetValidatePasswordReset);
  1633.   {$EXTERNALSYM _NET_VALIDATE_PASSWORD_TYPE}
  1634.   NET_VALIDATE_PASSWORD_TYPE = _NET_VALIDATE_PASSWORD_TYPE;
  1635.   {$EXTERNALSYM NET_VALIDATE_PASSWORD_TYPE}
  1636.   PNET_VALIDATE_PASSWORD_TYPE = ^NET_VALIDATE_PASSWORD_TYPE;
  1637.   {$EXTERNALSYM PNET_VALIDATE_PASSWORD_TYPE}
  1638.   TNetValidatePasswordType = NET_VALIDATE_PASSWORD_TYPE;
  1639.   PNetValidatePasswordType = PNET_VALIDATE_PASSWORD_TYPE;
  1640. //
  1641. //    Structure to keep the password hash
  1642. //
  1643.   _NET_VALIDATE_PASSWORD_HASH = record
  1644.     Length: ULONG;
  1645.     Hash: LPBYTE;
  1646.   end;
  1647.   {$EXTERNALSYM _NET_VALIDATE_PASSWORD_HASH}
  1648.   NET_VALIDATE_PASSWORD_HASH = _NET_VALIDATE_PASSWORD_HASH;
  1649.   {$EXTERNALSYM NET_VALIDATE_PASSWORD_HASH}
  1650.   PNET_VALIDATE_PASSWORD_HASH = ^NET_VALIDATE_PASSWORD_HASH;
  1651.   {$EXTERNALSYM PNET_VALIDATE_PASSWORD_HASH}
  1652.   TNetValidatePasswordHash = NET_VALIDATE_PASSWORD_HASH;
  1653.   PNetValidatePasswordHash = PNET_VALIDATE_PASSWORD_HASH;
  1654. // To be used with PresentFields member of NET_VALIDATE_PERSISTED_FIELDS
  1655. const
  1656.   NET_VALIDATE_PASSWORD_LAST_SET         = $00000001;
  1657.   {$EXTERNALSYM NET_VALIDATE_PASSWORD_LAST_SET}
  1658.   NET_VALIDATE_BAD_PASSWORD_TIME         = $00000002;
  1659.   {$EXTERNALSYM NET_VALIDATE_BAD_PASSWORD_TIME}
  1660.   NET_VALIDATE_LOCKOUT_TIME              = $00000004;
  1661.   {$EXTERNALSYM NET_VALIDATE_LOCKOUT_TIME}
  1662.   NET_VALIDATE_BAD_PASSWORD_COUNT        = $00000008;
  1663.   {$EXTERNALSYM NET_VALIDATE_BAD_PASSWORD_COUNT}
  1664.   NET_VALIDATE_PASSWORD_HISTORY_LENGTH   = $00000010;
  1665.   {$EXTERNALSYM NET_VALIDATE_PASSWORD_HISTORY_LENGTH}
  1666.   NET_VALIDATE_PASSWORD_HISTORY          = $00000020;
  1667.   {$EXTERNALSYM NET_VALIDATE_PASSWORD_HISTORY}
  1668. //#if !defined(_WINBASE_) && !defined(_FILETIME_)
  1669. //#define _FILETIME_
  1670. //typedef struct _FILETIME
  1671. //{/
  1672. //    DWORD dwLowDateTime;
  1673. //    DWORD dwHighDateTime;
  1674. //} FILETIME, FAR * LPFILETIME, *PFILETIME;
  1675. //#endif
  1676. //
  1677. //    Structure to keep information about the password and related things.
  1678. //        Present Fields: (used only in output args) which fields are changed.
  1679. //            See the constants above.
  1680. //        PasswordLastSet: When the password is last set.
  1681. //        BadPasswordTime: When the password was incorrect for the last time.
  1682. //        LockoutTime: When the account is locked out. If the account is not locked out
  1683. //            it is 0.
  1684. //        BadPasswordCount: How many times the password has given incorrectly in the
  1685. //            Observation Window.
  1686. //        PasswordHistoryLength: How many passwords are kept in the history
  1687. //        PasswordHistory: Password hashes that are in the history
  1688. //
  1689. type
  1690.   _NET_VALIDATE_PERSISTED_FIELDS = record
  1691.     PresentFields: ULONG;
  1692.     PasswordLastSet: FILETIME;
  1693.     BadPasswordTime: FILETIME;
  1694.     LockoutTime: FILETIME;
  1695.     BadPasswordCount: ULONG;
  1696.     PasswordHistoryLength: ULONG;
  1697.     PasswordHistory: PNET_VALIDATE_PASSWORD_HASH;
  1698.   end;
  1699.   {$EXTERNALSYM _NET_VALIDATE_PERSISTED_FIELDS}
  1700.   NET_VALIDATE_PERSISTED_FIELDS = _NET_VALIDATE_PERSISTED_FIELDS;
  1701.   {$EXTERNALSYM NET_VALIDATE_PERSISTED_FIELDS}
  1702.   PNET_VALIDATE_PERSISTED_FIELDS = ^NET_VALIDATE_PERSISTED_FIELDS;
  1703.   {$EXTERNALSYM PNET_VALIDATE_PERSISTED_FIELDS}
  1704.   TNetValidatePersistedFields = NET_VALIDATE_PERSISTED_FIELDS;
  1705.   PNetValidatePersistedFields = PNET_VALIDATE_PERSISTED_FIELDS;
  1706. //
  1707. //    Output Arg
  1708. //        ChangedPersistedFields: Any changes to the password related info
  1709. //        ValidationStatus: Shows the result of the request
  1710. //
  1711.   _NET_VALIDATE_OUTPUT_ARG = record
  1712.     ChangedPersistedFields: NET_VALIDATE_PERSISTED_FIELDS;
  1713.     ValidationStatus: NET_API_STATUS;
  1714.   end;
  1715.   {$EXTERNALSYM _NET_VALIDATE_OUTPUT_ARG}
  1716.   NET_VALIDATE_OUTPUT_ARG = _NET_VALIDATE_OUTPUT_ARG;
  1717.   {$EXTERNALSYM NET_VALIDATE_OUTPUT_ARG}
  1718.   PNET_VALIDATE_OUTPUT_ARG = ^NET_VALIDATE_OUTPUT_ARG;
  1719.   {$EXTERNALSYM PNET_VALIDATE_OUTPUT_ARG}
  1720.   TNetValidateOutputArg = NET_VALIDATE_OUTPUT_ARG;
  1721.   PNetValidateOutputArg = PNET_VALIDATE_OUTPUT_ARG;  
  1722. //
  1723. //    If authentication type of password check is to be made,
  1724. //        this kind of input must be used
  1725. //        
  1726. //    InputPersistedFields: Information about the account to be logged into
  1727. //    PasswordMatched: Indicates the result of the application's authentication of the supplied password 
  1728. //
  1729.   _NET_VALIDATE_AUTHENTICATION_INPUT_ARG = record
  1730.     InputPersistedFields: NET_VALIDATE_PERSISTED_FIELDS;
  1731.     PasswordMatched: BOOLEAN;
  1732.   end;
  1733.   {$EXTERNALSYM _NET_VALIDATE_AUTHENTICATION_INPUT_ARG}
  1734.   NET_VALIDATE_AUTHENTICATION_INPUT_ARG = _NET_VALIDATE_AUTHENTICATION_INPUT_ARG;
  1735.   {$EXTERNALSYM NET_VALIDATE_AUTHENTICATION_INPUT_ARG}
  1736.   PNET_VALIDATE_AUTHENTICATION_INPUT_ARG = ^NET_VALIDATE_AUTHENTICATION_INPUT_ARG;
  1737.   {$EXTERNALSYM PNET_VALIDATE_AUTHENTICATION_INPUT_ARG}
  1738.   TNetValidateAuthenticationInputArg = NET_VALIDATE_AUTHENTICATION_INPUT_ARG;
  1739.   PNetValidateAuthenticationInputArg = PNET_VALIDATE_AUTHENTICATION_INPUT_ARG;
  1740. //
  1741. //    If password change type of check is to be made,
  1742. //        this kind of input must be used
  1743. //
  1744. //    InputPersistedFields: Information about the account to be logged into
  1745. //    ClearPassword: The string which password is going to be
  1746. //    UserAccountName: Name of the user account
  1747. //    HashedPassword: Hash of the string that the password is going to be
  1748. //    PasswordMatch: denotes if the old password supplied by user matched or not
  1749. //
  1750.   _NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG = record
  1751.     InputPersistedFields: NET_VALIDATE_PERSISTED_FIELDS;
  1752.     ClearPassword: LPWSTR;
  1753.     UserAccountName: LPWSTR;
  1754.     HashedPassword: NET_VALIDATE_PASSWORD_HASH;
  1755.     PasswordMatch: BOOLEAN;
  1756.   end;
  1757.   {$EXTERNALSYM _NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG}
  1758.   NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG = _NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG;
  1759.   {$EXTERNALSYM NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG}
  1760.   PNET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG = ^NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG;
  1761.   {$EXTERNALSYM PNET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG}
  1762.   TNetValidatePasswordChangeInputArg = NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG;
  1763.   PNetValidatePasswordChangeInputArg = PNET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG;
  1764. //
  1765. //    If password reset type of check is to be made,
  1766. //        this kind of input must be used
  1767. //
  1768. //    InputPersistedFields: Information about the account to be logged into
  1769. //    ClearPassword: The string which password is going to be
  1770. //    UserAccountName: Name of the user account
  1771. //    HashedPassword: Hash of the string that the password is going to be
  1772. //    PasswordMustChangeAtNextLogon: Password must change for the user to be logged in
  1773. //    ClearLockout: If the account was locked out, this field can be used to clear lockout
  1774. //
  1775.   _NET_VALIDATE_PASSWORD_RESET_INPUT_ARG = record
  1776.     InputPersistedFields: NET_VALIDATE_PERSISTED_FIELDS;
  1777.     ClearPassword: LPWSTR;
  1778.     UserAccountName: LPWSTR;
  1779.     HashedPassword: NET_VALIDATE_PASSWORD_HASH;
  1780.     PasswordMustChangeAtNextLogon: BOOLEAN;
  1781.     ClearLockout: BOOLEAN;
  1782.   end;
  1783.   {$EXTERNALSYM _NET_VALIDATE_PASSWORD_RESET_INPUT_ARG}
  1784.   NET_VALIDATE_PASSWORD_RESET_INPUT_ARG = _NET_VALIDATE_PASSWORD_RESET_INPUT_ARG;
  1785.   {$EXTERNALSYM NET_VALIDATE_PASSWORD_RESET_INPUT_ARG}
  1786.   PNET_VALIDATE_PASSWORD_RESET_INPUT_ARG = ^NET_VALIDATE_PASSWORD_RESET_INPUT_ARG;
  1787.   {$EXTERNALSYM PNET_VALIDATE_PASSWORD_RESET_INPUT_ARG}
  1788.   TNetValidatePasswordResetInputArg = NET_VALIDATE_PASSWORD_RESET_INPUT_ARG;
  1789.   PNetValidatePasswordResetInputArg = PNET_VALIDATE_PASSWORD_RESET_INPUT_ARG;  
  1790. //
  1791. //    Password Checking API structures end here
  1792. //
  1793. function NetValidatePasswordPolicy(ServerName: LPWSTR; Qualifier: LPVOID; ValidationType: NET_VALIDATE_PASSWORD_TYPE;
  1794.   InputArg: LPVOID; var OutputArg: LPVOID): NET_API_STATUS; stdcall;
  1795. {$EXTERNALSYM NetValidatePasswordPolicy}
  1796. //
  1797. // Domain Class
  1798. //
  1799. //
  1800. // Function Prototypes - Domain
  1801. //
  1802. function NetGetDCName(servername, domainname: LPCWSTR; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  1803. {$EXTERNALSYM NetGetDCName}
  1804. function NetGetAnyDCName(servername, domainname: LPCWSTR; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  1805. {$EXTERNALSYM NetGetAnyDCName}
  1806. function I_NetLogonControl(ServerName: LPCWSTR; FunctionCode, QueryLevel: DWORD; var Buffer: LPBYTE): NET_API_STATUS; stdcall;
  1807. {$EXTERNALSYM I_NetLogonControl}
  1808. function I_NetLogonControl2(ServerName: LPCWSTR; FunctionCode, QueryLevel: DWORD; Data: LPBYTE; var Buffer: LPBYTE): NET_API_STATUS; stdcall;
  1809. {$EXTERNALSYM I_NetLogonControl2}
  1810. function NetEnumerateTrustedDomains(ServerName: LPWSTR; var DomainNames: LPWSTR): NTSTATUS; stdcall;
  1811. {$EXTERNALSYM NetEnumerateTrustedDomains}
  1812. //
  1813. // Special Values and Constants - Domain
  1814. //
  1815. //
  1816. // FunctionCode values for I_NetLogonControl.
  1817. //
  1818. // NOTE : if you change the following NETLOGON_CONTROL_* values,
  1819. // change them in netsvcdllslogonsrvlogon.idl file also.
  1820. //
  1821. const
  1822.   NETLOGON_CONTROL_QUERY            = 1; // No-op: just query
  1823.   {$EXTERNALSYM NETLOGON_CONTROL_QUERY}
  1824.   NETLOGON_CONTROL_REPLICATE        = 2; // Force replicate on BDC
  1825.   {$EXTERNALSYM NETLOGON_CONTROL_REPLICATE}
  1826.   NETLOGON_CONTROL_SYNCHRONIZE      = 3; // Force synchronize on BDC
  1827.   {$EXTERNALSYM NETLOGON_CONTROL_SYNCHRONIZE}
  1828.   NETLOGON_CONTROL_PDC_REPLICATE    = 4; // Force PDC to broadcast change
  1829.   {$EXTERNALSYM NETLOGON_CONTROL_PDC_REPLICATE}
  1830.   NETLOGON_CONTROL_REDISCOVER       = 5; // Force to re-discover trusted domain DCs
  1831.   {$EXTERNALSYM NETLOGON_CONTROL_REDISCOVER}
  1832.   NETLOGON_CONTROL_TC_QUERY         = 6; // Query status of specified trusted channel status
  1833.   {$EXTERNALSYM NETLOGON_CONTROL_TC_QUERY}
  1834.   NETLOGON_CONTROL_TRANSPORT_NOTIFY = 7; // Notify netlogon that a new transport has come online
  1835.   {$EXTERNALSYM NETLOGON_CONTROL_TRANSPORT_NOTIFY}
  1836.   NETLOGON_CONTROL_FIND_USER        = 8; // Find named user in a trusted domain
  1837.   {$EXTERNALSYM NETLOGON_CONTROL_FIND_USER}
  1838.   NETLOGON_CONTROL_CHANGE_PASSWORD  = 9; // Change machine password on a secure channel to a trusted domain
  1839.   {$EXTERNALSYM NETLOGON_CONTROL_CHANGE_PASSWORD}
  1840.   NETLOGON_CONTROL_TC_VERIFY        = 10; // Verify status of specified trusted channel
  1841.   {$EXTERNALSYM NETLOGON_CONTROL_TC_VERIFY}
  1842.   NETLOGON_CONTROL_FORCE_DNS_REG    = 11; // Force DNS re-registration of all registered records
  1843.   {$EXTERNALSYM NETLOGON_CONTROL_FORCE_DNS_REG}
  1844.   NETLOGON_CONTROL_QUERY_DNS_REG    = 12; // Query the status of DNS updates
  1845.   {$EXTERNALSYM NETLOGON_CONTROL_QUERY_DNS_REG}
  1846. // Debug function codes
  1847.   NETLOGON_CONTROL_UNLOAD_NETLOGON_DLL = $FFFB;
  1848.   {$EXTERNALSYM NETLOGON_CONTROL_UNLOAD_NETLOGON_DLL}
  1849.   NETLOGON_CONTROL_BACKUP_CHANGE_LOG   = $FFFC;
  1850.   {$EXTERNALSYM NETLOGON_CONTROL_BACKUP_CHANGE_LOG}
  1851.   NETLOGON_CONTROL_TRUNCATE_LOG        = $FFFD;
  1852.   {$EXTERNALSYM NETLOGON_CONTROL_TRUNCATE_LOG}
  1853.   NETLOGON_CONTROL_SET_DBFLAG          = $FFFE;
  1854.   {$EXTERNALSYM NETLOGON_CONTROL_SET_DBFLAG}
  1855.   NETLOGON_CONTROL_BREAKPOINT          = $FFFF;
  1856.   {$EXTERNALSYM NETLOGON_CONTROL_BREAKPOINT}
  1857. //
  1858. // Query level 1 for I_NetLogonControl
  1859. //
  1860. type
  1861.   PNETLOGON_INFO_1 = ^NETLOGON_INFO_1;
  1862.   {$EXTERNALSYM PNETLOGON_INFO_1}
  1863.   _NETLOGON_INFO_1 = record
  1864.     netlog1_flags: DWORD;
  1865.     netlog1_pdc_connection_status: NET_API_STATUS;
  1866.   end;
  1867.   {$EXTERNALSYM _NETLOGON_INFO_1}
  1868.   NETLOGON_INFO_1 = _NETLOGON_INFO_1;
  1869.   {$EXTERNALSYM NETLOGON_INFO_1}
  1870.   TNetLogonInfo1 = NETLOGON_INFO_1;
  1871.   PNetLogonInfo1 = PNETLOGON_INFO_1;
  1872.   PNETLOGON_INFO_2 = ^NETLOGON_INFO_2;
  1873.   {$EXTERNALSYM PNETLOGON_INFO_2}
  1874.   _NETLOGON_INFO_2 = record
  1875.     netlog2_flags: DWORD;
  1876.     //
  1877.     // If NETLOGON_VERIFY_STATUS_RETURNED bit is set in
  1878.     //  netlog2_flags, the following field will return
  1879.     //  the status of trust verification. Otherwise,
  1880.     //  the field will return the status of the secure
  1881.     //  channel to the primary domain of the machine
  1882.     //  (useful for BDCs only).
  1883.     //
  1884.     netlog2_pdc_connection_status: NET_API_STATUS;
  1885.     netlog2_trusted_dc_name: LPWSTR;
  1886.     netlog2_tc_connection_status: NET_API_STATUS;
  1887.   end;
  1888.   {$EXTERNALSYM _NETLOGON_INFO_2}
  1889.   NETLOGON_INFO_2 = _NETLOGON_INFO_2;
  1890.   {$EXTERNALSYM NETLOGON_INFO_2}
  1891.   TNetLogonInfo2 = NETLOGON_INFO_2;
  1892.   PNetLogonInfo2 = PNETLOGON_INFO_2;
  1893.   PNETLOGON_INFO_3 = ^NETLOGON_INFO_3;
  1894.   {$EXTERNALSYM PNETLOGON_INFO_3}
  1895.   _NETLOGON_INFO_3 = record
  1896.     netlog3_flags: DWORD;
  1897.     netlog3_logon_attempts: DWORD;
  1898.     netlog3_reserved1: DWORD;
  1899.     netlog3_reserved2: DWORD;
  1900.     netlog3_reserved3: DWORD;
  1901.     netlog3_reserved4: DWORD;
  1902.     netlog3_reserved5: DWORD;
  1903.   end;
  1904.   {$EXTERNALSYM _NETLOGON_INFO_3}
  1905.   NETLOGON_INFO_3 = _NETLOGON_INFO_3;
  1906.   {$EXTERNALSYM NETLOGON_INFO_3}
  1907.   TNetLogonInfo3 = NETLOGON_INFO_3;
  1908.   PNetLogonInfo3 = PNETLOGON_INFO_3;
  1909.   PNETLOGON_INFO_4 = ^NETLOGON_INFO_4;
  1910.   {$EXTERNALSYM PNETLOGON_INFO_4}
  1911.   _NETLOGON_INFO_4 = record
  1912.     netlog4_trusted_dc_name: LPWSTR;
  1913.     netlog4_trusted_domain_name: LPWSTR;
  1914.   end;
  1915.   {$EXTERNALSYM _NETLOGON_INFO_4}
  1916.   NETLOGON_INFO_4 = _NETLOGON_INFO_4;
  1917.   {$EXTERNALSYM NETLOGON_INFO_4}
  1918.   TNetLogonInfo4 = NETLOGON_INFO_4;
  1919.   PNetLogonInfo4 = PNETLOGON_INFO_4;
  1920. //
  1921. // Values of netlog1_flags
  1922. //
  1923. const
  1924.   NETLOGON_REPLICATION_NEEDED      = $01; // Database is out of date
  1925.   {$EXTERNALSYM NETLOGON_REPLICATION_NEEDED}
  1926.   NETLOGON_REPLICATION_IN_PROGRESS = $02; // Replication is happening now
  1927.   {$EXTERNALSYM NETLOGON_REPLICATION_IN_PROGRESS}
  1928.   NETLOGON_FULL_SYNC_REPLICATION   = $04; // full sync replication required/progress
  1929.   {$EXTERNALSYM NETLOGON_FULL_SYNC_REPLICATION}
  1930.   NETLOGON_REDO_NEEDED             = $08; // Redo of previous replication needed
  1931.   {$EXTERNALSYM NETLOGON_REDO_NEEDED}
  1932.   NETLOGON_HAS_IP                  = $10; // The trusted domain DC has an IP address
  1933.   {$EXTERNALSYM NETLOGON_HAS_IP}
  1934.   NETLOGON_HAS_TIMESERV            = $20; // The trusted domain DC runs the Windows Time Service
  1935.   {$EXTERNALSYM NETLOGON_HAS_TIMESERV}
  1936.   NETLOGON_DNS_UPDATE_FAILURE      = $40; // There was a failure in the last update for one of the DNS records
  1937.   {$EXTERNALSYM NETLOGON_DNS_UPDATE_FAILURE}
  1938.   NETLOGON_VERIFY_STATUS_RETURNED  = $80; // Trust verification status returned in netlog2_pdc_connection_status
  1939.   {$EXTERNALSYM NETLOGON_VERIFY_STATUS_RETURNED}
  1940. implementation
  1941. {$IFDEF DYNAMIC_LINK}
  1942. var
  1943.   _NetUserAdd: Pointer;
  1944. function NetUserAdd;
  1945. begin
  1946.   GetProcedureAddress(_NetUserAdd, netapi32, 'NetUserAdd');
  1947.   asm
  1948.     mov esp, ebp
  1949.     pop ebp
  1950.     jmp [_NetUserAdd]
  1951.   end;
  1952. end;
  1953. {$ELSE}
  1954. function NetUserAdd; external netapi32 name 'NetUserAdd';
  1955. {$ENDIF DYNAMIC_LINK}
  1956. {$IFDEF DYNAMIC_LINK}
  1957. var
  1958.   _NetUserEnum: Pointer;
  1959. function NetUserEnum;
  1960. begin
  1961.   GetProcedureAddress(_NetUserEnum, netapi32, 'NetUserEnum');
  1962.   asm
  1963.     mov esp, ebp
  1964.     pop ebp
  1965.     jmp [_NetUserEnum]
  1966.   end;
  1967. end;
  1968. {$ELSE}
  1969. function NetUserEnum; external netapi32 name 'NetUserEnum';
  1970. {$ENDIF DYNAMIC_LINK}
  1971. {$IFDEF DYNAMIC_LINK}
  1972. var
  1973.   _NetUserGetInfo: Pointer;
  1974. function NetUserGetInfo;
  1975. begin
  1976.   GetProcedureAddress(_NetUserGetInfo, netapi32, 'NetUserGetInfo');
  1977.   asm
  1978.     mov esp, ebp
  1979.     pop ebp
  1980.     jmp [_NetUserGetInfo]
  1981.   end;
  1982. end;
  1983. {$ELSE}
  1984. function NetUserGetInfo; external netapi32 name 'NetUserGetInfo';
  1985. {$ENDIF DYNAMIC_LINK}
  1986. {$IFDEF DYNAMIC_LINK}
  1987. var
  1988.   _NetUserSetInfo: Pointer;
  1989. function NetUserSetInfo;
  1990. begin
  1991.   GetProcedureAddress(_NetUserSetInfo, netapi32, 'NetUserSetInfo');
  1992.   asm
  1993.     mov esp, ebp
  1994.     pop ebp
  1995.     jmp [_NetUserSetInfo]
  1996.   end;
  1997. end;
  1998. {$ELSE}
  1999. function NetUserSetInfo; external netapi32 name 'NetUserSetInfo';
  2000. {$ENDIF DYNAMIC_LINK}
  2001. {$IFDEF DYNAMIC_LINK}
  2002. var
  2003.   _NetUserDel: Pointer;
  2004. function NetUserDel;
  2005. begin
  2006.   GetProcedureAddress(_NetUserDel, netapi32, 'NetUserDel');
  2007.   asm
  2008.     mov esp, ebp
  2009.     pop ebp
  2010.     jmp [_NetUserDel]
  2011.   end;
  2012. end;
  2013. {$ELSE}
  2014. function NetUserDel; external netapi32 name 'NetUserDel';
  2015. {$ENDIF DYNAMIC_LINK}
  2016. {$IFDEF DYNAMIC_LINK}
  2017. var
  2018.   _NetUserGetGroups: Pointer;
  2019. function NetUserGetGroups;
  2020. begin
  2021.   GetProcedureAddress(_NetUserGetGroups, netapi32, 'NetUserGetGroups');
  2022.   asm
  2023.     mov esp, ebp
  2024.     pop ebp
  2025.     jmp [_NetUserGetGroups]
  2026.   end;
  2027. end;
  2028. {$ELSE}
  2029. function NetUserGetGroups; external netapi32 name 'NetUserGetGroups';
  2030. {$ENDIF DYNAMIC_LINK}
  2031. {$IFDEF DYNAMIC_LINK}
  2032. var
  2033.   _NetUserSetGroups: Pointer;
  2034. function NetUserSetGroups;
  2035. begin
  2036.   GetProcedureAddress(_NetUserSetGroups, netapi32, 'NetUserSetGroups');
  2037.   asm
  2038.     mov esp, ebp
  2039.     pop ebp
  2040.     jmp [_NetUserSetGroups]
  2041.   end;
  2042. end;
  2043. {$ELSE}
  2044. function NetUserSetGroups; external netapi32 name 'NetUserSetGroups';
  2045. {$ENDIF DYNAMIC_LINK}
  2046. {$IFDEF DYNAMIC_LINK}
  2047. var
  2048.   _NetUserGetLocalGroups: Pointer;
  2049. function NetUserGetLocalGroups;
  2050. begin
  2051.   GetProcedureAddress(_NetUserGetLocalGroups, netapi32, 'NetUserGetLocalGroups');
  2052.   asm
  2053.     mov esp, ebp
  2054.     pop ebp
  2055.     jmp [_NetUserGetLocalGroups]
  2056.   end;
  2057. end;
  2058. {$ELSE}
  2059. function NetUserGetLocalGroups; external netapi32 name 'NetUserGetLocalGroups';
  2060. {$ENDIF DYNAMIC_LINK}
  2061. {$IFDEF DYNAMIC_LINK}
  2062. var
  2063.   _NetUserModalsGet: Pointer;
  2064. function NetUserModalsGet;
  2065. begin
  2066.   GetProcedureAddress(_NetUserModalsGet, netapi32, 'NetUserModalsGet');
  2067.   asm
  2068.     mov esp, ebp
  2069.     pop ebp
  2070.     jmp [_NetUserModalsGet]
  2071.   end;
  2072. end;
  2073. {$ELSE}
  2074. function NetUserModalsGet; external netapi32 name 'NetUserModalsGet';
  2075. {$ENDIF DYNAMIC_LINK}
  2076. {$IFDEF DYNAMIC_LINK}
  2077. var
  2078.   _NetUserModalsSet: Pointer;
  2079. function NetUserModalsSet;
  2080. begin
  2081.   GetProcedureAddress(_NetUserModalsSet, netapi32, 'NetUserModalsSet');
  2082.   asm
  2083.     mov esp, ebp
  2084.     pop ebp
  2085.     jmp [_NetUserModalsSet]
  2086.   end;
  2087. end;
  2088. {$ELSE}
  2089. function NetUserModalsSet; external netapi32 name 'NetUserModalsSet';
  2090. {$ENDIF DYNAMIC_LINK}
  2091. {$IFDEF DYNAMIC_LINK}
  2092. var
  2093.   _NetUserChangePassword: Pointer;
  2094. function NetUserChangePassword;
  2095. begin
  2096.   GetProcedureAddress(_NetUserChangePassword, netapi32, 'NetUserChangePassword');
  2097.   asm
  2098.     mov esp, ebp
  2099.     pop ebp
  2100.     jmp [_NetUserChangePassword]
  2101.   end;
  2102. end;
  2103. {$ELSE}
  2104. function NetUserChangePassword; external netapi32 name 'NetUserChangePassword';
  2105. {$ENDIF DYNAMIC_LINK}
  2106. {$IFDEF DYNAMIC_LINK}
  2107. var
  2108.   _NetGroupAdd: Pointer;
  2109. function NetGroupAdd;
  2110. begin
  2111.   GetProcedureAddress(_NetGroupAdd, netapi32, 'NetGroupAdd');
  2112.   asm
  2113.     mov esp, ebp
  2114.     pop ebp
  2115.     jmp [_NetGroupAdd]
  2116.   end;
  2117. end;
  2118. {$ELSE}
  2119. function NetGroupAdd; external netapi32 name 'NetGroupAdd';
  2120. {$ENDIF DYNAMIC_LINK}
  2121. {$IFDEF DYNAMIC_LINK}
  2122. var
  2123.   _NetGroupAddUser: Pointer;
  2124. function NetGroupAddUser;
  2125. begin
  2126.   GetProcedureAddress(_NetGroupAddUser, netapi32, 'NetGroupAddUser');
  2127.   asm
  2128.     mov esp, ebp
  2129.     pop ebp
  2130.     jmp [_NetGroupAddUser]
  2131.   end;
  2132. end;
  2133. {$ELSE}
  2134. function NetGroupAddUser; external netapi32 name 'NetGroupAddUser';
  2135. {$ENDIF DYNAMIC_LINK}
  2136. {$IFDEF DYNAMIC_LINK}
  2137. var
  2138.   _NetGroupEnum: Pointer;
  2139. function NetGroupEnum;
  2140. begin
  2141.   GetProcedureAddress(_NetGroupEnum, netapi32, 'NetGroupEnum;');
  2142.   asm
  2143.     mov esp, ebp
  2144.     pop ebp
  2145.     jmp [_NetGroupEnum]
  2146.   end;
  2147. end;
  2148. {$ELSE}
  2149. function NetGroupEnum; external netapi32 name 'NetGroupEnum;';
  2150. {$ENDIF DYNAMIC_LINK}
  2151. {$IFDEF DYNAMIC_LINK}
  2152. var
  2153.   _NetGroupGetInfo: Pointer;
  2154. function NetGroupGetInfo;
  2155. begin
  2156.   GetProcedureAddress(_NetGroupGetInfo, netapi32, 'NetGroupGetInfo');
  2157.   asm
  2158.     mov esp, ebp
  2159.     pop ebp
  2160.     jmp [_NetGroupGetInfo]
  2161.   end;
  2162. end;
  2163. {$ELSE}
  2164. function NetGroupGetInfo; external netapi32 name 'NetGroupGetInfo';
  2165. {$ENDIF DYNAMIC_LINK}
  2166. {$IFDEF DYNAMIC_LINK}
  2167. var
  2168.   _NetGroupSetInfo: Pointer;
  2169. function NetGroupSetInfo;
  2170. begin
  2171.   GetProcedureAddress(_NetGroupSetInfo, netapi32, 'NetGroupSetInfo');
  2172.   asm
  2173.     mov esp, ebp
  2174.     pop ebp
  2175.     jmp [_NetGroupSetInfo]
  2176.   end;
  2177. end;
  2178. {$ELSE}
  2179. function NetGroupSetInfo; external netapi32 name 'NetGroupSetInfo';
  2180. {$ENDIF DYNAMIC_LINK}
  2181. {$IFDEF DYNAMIC_LINK}
  2182. var
  2183.   _NetGroupDel: Pointer;
  2184. function NetGroupDel;
  2185. begin
  2186.   GetProcedureAddress(_NetGroupDel, netapi32, 'NetGroupDel');
  2187.   asm
  2188.     mov esp, ebp
  2189.     pop ebp
  2190.     jmp [_NetGroupDel]
  2191.   end;
  2192. end;
  2193. {$ELSE}
  2194. function NetGroupDel; external netapi32 name 'NetGroupDel';
  2195. {$ENDIF DYNAMIC_LINK}
  2196. {$IFDEF DYNAMIC_LINK}
  2197. var
  2198.   _NetGroupDelUser: Pointer;
  2199. function NetGroupDelUser;
  2200. begin
  2201.   GetProcedureAddress(_NetGroupDelUser, netapi32, 'NetGroupDelUser');
  2202.   asm
  2203.     mov esp, ebp
  2204.     pop ebp
  2205.     jmp [_NetGroupDelUser]
  2206.   end;
  2207. end;
  2208. {$ELSE}
  2209. function NetGroupDelUser; external netapi32 name 'NetGroupDelUser';
  2210. {$ENDIF DYNAMIC_LINK}
  2211. {$IFDEF DYNAMIC_LINK}
  2212. var
  2213.   _NetGroupGetUsers: Pointer;
  2214. function NetGroupGetUsers;
  2215. begin
  2216.   GetProcedureAddress(_NetGroupGetUsers, netapi32, 'NetGroupGetUsers');
  2217.   asm
  2218.     mov esp, ebp
  2219.     pop ebp
  2220.     jmp [_NetGroupGetUsers]
  2221.   end;
  2222. end;
  2223. {$ELSE}
  2224. function NetGroupGetUsers; external netapi32 name 'NetGroupGetUsers';
  2225. {$ENDIF DYNAMIC_LINK}
  2226. {$IFDEF DYNAMIC_LINK}
  2227. var
  2228.   _NetGroupSetUsers: Pointer;
  2229. function NetGroupSetUsers;
  2230. begin
  2231.   GetProcedureAddress(_NetGroupSetUsers, netapi32, 'NetGroupSetUsers');
  2232.   asm
  2233.     mov esp, ebp
  2234.     pop ebp
  2235.     jmp [_NetGroupSetUsers]
  2236.   end;
  2237. end;
  2238. {$ELSE}
  2239. function NetGroupSetUsers; external netapi32 name 'NetGroupSetUsers';
  2240. {$ENDIF DYNAMIC_LINK}
  2241. {$IFDEF DYNAMIC_LINK}
  2242. var
  2243.   _NetLocalGroupAdd: Pointer;
  2244. function NetLocalGroupAdd;
  2245. begin
  2246.   GetProcedureAddress(_NetLocalGroupAdd, netapi32, 'NetLocalGroupAdd');
  2247.   asm
  2248.     mov esp, ebp
  2249.     pop ebp
  2250.     jmp [_NetLocalGroupAdd]
  2251.   end;
  2252. end;
  2253. {$ELSE}
  2254. function NetLocalGroupAdd; external netapi32 name 'NetLocalGroupAdd';
  2255. {$ENDIF DYNAMIC_LINK}
  2256. {$IFDEF DYNAMIC_LINK}
  2257. var
  2258.   _NetLocalGroupAddMember: Pointer;
  2259. function NetLocalGroupAddMember;
  2260. begin
  2261.   GetProcedureAddress(_NetLocalGroupAddMember, netapi32, 'NetLocalGroupAddMember');
  2262.   asm
  2263.     mov esp, ebp
  2264.     pop ebp
  2265.     jmp [_NetLocalGroupAddMember]
  2266.   end;
  2267. end;
  2268. {$ELSE}
  2269. function NetLocalGroupAddMember; external netapi32 name 'NetLocalGroupAddMember';
  2270. {$ENDIF DYNAMIC_LINK}
  2271. {$IFDEF DYNAMIC_LINK}
  2272. var
  2273.   _NetLocalGroupEnum: Pointer;
  2274. function NetLocalGroupEnum;
  2275. begin
  2276.   GetProcedureAddress(_NetLocalGroupEnum, netapi32, 'NetLocalGroupEnum');
  2277.   asm
  2278.     mov esp, ebp
  2279.     pop ebp
  2280.     jmp [_NetLocalGroupEnum]
  2281.   end;
  2282. end;
  2283. {$ELSE}
  2284. function NetLocalGroupEnum; external netapi32 name 'NetLocalGroupEnum';
  2285. {$ENDIF DYNAMIC_LINK}
  2286. {$IFDEF DYNAMIC_LINK}
  2287. var
  2288.   _NetLocalGroupGetInfo: Pointer;
  2289. function NetLocalGroupGetInfo;
  2290. begin
  2291.   GetProcedureAddress(_NetLocalGroupGetInfo, netapi32, 'NetLocalGroupGetInfo');
  2292.   asm
  2293.     mov esp, ebp
  2294.     pop ebp
  2295.     jmp [_NetLocalGroupGetInfo]
  2296.   end;
  2297. end;
  2298. {$ELSE}
  2299. function NetLocalGroupGetInfo; external netapi32 name 'NetLocalGroupGetInfo';
  2300. {$ENDIF DYNAMIC_LINK}
  2301. {$IFDEF DYNAMIC_LINK}
  2302. var
  2303.   _NetLocalGroupSetInfo: Pointer;
  2304. function NetLocalGroupSetInfo;
  2305. begin
  2306.   GetProcedureAddress(_NetLocalGroupSetInfo, netapi32, 'NetLocalGroupSetInfo');
  2307.   asm
  2308.     mov esp, ebp
  2309.     pop ebp
  2310.     jmp [_NetLocalGroupSetInfo]
  2311.   end;
  2312. end;
  2313. {$ELSE}
  2314. function NetLocalGroupSetInfo; external netapi32 name 'NetLocalGroupSetInfo';
  2315. {$ENDIF DYNAMIC_LINK}
  2316. {$IFDEF DYNAMIC_LINK}
  2317. var
  2318.   _NetLocalGroupDel: Pointer;
  2319. function NetLocalGroupDel;
  2320. begin
  2321.   GetProcedureAddress(_NetLocalGroupDel, netapi32, 'NetLocalGroupDel');
  2322.   asm
  2323.     mov esp, ebp
  2324.     pop ebp
  2325.     jmp [_NetLocalGroupDel]
  2326.   end;
  2327. end;
  2328. {$ELSE}
  2329. function NetLocalGroupDel; external netapi32 name 'NetLocalGroupDel';
  2330. {$ENDIF DYNAMIC_LINK}
  2331. {$IFDEF DYNAMIC_LINK}
  2332. var
  2333.   _NetLocalGroupDelMember: Pointer;
  2334. function NetLocalGroupDelMember;
  2335. begin
  2336.   GetProcedureAddress(_NetLocalGroupDelMember, netapi32, 'NetLocalGroupDelMember');
  2337.   asm
  2338.     mov esp, ebp
  2339.     pop ebp
  2340.     jmp [_NetLocalGroupDelMember]
  2341.   end;
  2342. end;
  2343. {$ELSE}
  2344. function NetLocalGroupDelMember; external netapi32 name 'NetLocalGroupDelMember';
  2345. {$ENDIF DYNAMIC_LINK}
  2346. {$IFDEF DYNAMIC_LINK}
  2347. var
  2348.   _NetLocalGroupGetMembers: Pointer;
  2349. function NetLocalGroupGetMembers;
  2350. begin
  2351.   GetProcedureAddress(_NetLocalGroupGetMembers, netapi32, 'NetLocalGroupGetMembers');
  2352.   asm
  2353.     mov esp, ebp
  2354.     pop ebp
  2355.     jmp [_NetLocalGroupGetMembers]
  2356.   end;
  2357. end;
  2358. {$ELSE}
  2359. function NetLocalGroupGetMembers; external netapi32 name 'NetLocalGroupGetMembers';
  2360. {$ENDIF DYNAMIC_LINK}
  2361. {$IFDEF DYNAMIC_LINK}
  2362. var
  2363.   _NetLocalGroupSetMembers: Pointer;
  2364. function NetLocalGroupSetMembers;
  2365. begin
  2366.   GetProcedureAddress(_NetLocalGroupSetMembers, netapi32, 'NetLocalGroupSetMembers');
  2367.   asm
  2368.     mov esp, ebp
  2369.     pop ebp
  2370.     jmp [_NetLocalGroupSetMembers]
  2371.   end;
  2372. end;
  2373. {$ELSE}
  2374. function NetLocalGroupSetMembers; external netapi32 name 'NetLocalGroupSetMembers';
  2375. {$ENDIF DYNAMIC_LINK}
  2376. {$IFDEF DYNAMIC_LINK}
  2377. var
  2378.   _NetLocalGroupAddMembers: Pointer;
  2379. function NetLocalGroupAddMembers;
  2380. begin
  2381.   GetProcedureAddress(_NetLocalGroupAddMembers, netapi32, 'NetLocalGroupAddMembers');
  2382.   asm
  2383.     mov esp, ebp
  2384.     pop ebp
  2385.     jmp [_NetLocalGroupAddMembers]
  2386.   end;
  2387. end;
  2388. {$ELSE}
  2389. function NetLocalGroupAddMembers; external netapi32 name 'NetLocalGroupAddMembers';
  2390. {$ENDIF DYNAMIC_LINK}
  2391. {$IFDEF DYNAMIC_LINK}
  2392. var
  2393.   _NetLocalGroupDelMembers: Pointer;
  2394. function NetLocalGroupDelMembers;
  2395. begin
  2396.   GetProcedureAddress(_NetLocalGroupDelMembers, netapi32, 'NetLocalGroupDelMembers');
  2397.   asm
  2398.     mov esp, ebp
  2399.     pop ebp
  2400.     jmp [_NetLocalGroupDelMembers]
  2401.   end;
  2402. end;
  2403. {$ELSE}
  2404. function NetLocalGroupDelMembers; external netapi32 name 'NetLocalGroupDelMembers';
  2405. {$ENDIF DYNAMIC_LINK}
  2406. {$IFDEF DYNAMIC_LINK}
  2407. var
  2408.   _NetQueryDisplayInformation: Pointer;
  2409. function NetQueryDisplayInformation;
  2410. begin
  2411.   GetProcedureAddress(_NetQueryDisplayInformation, netapi32, 'NetQueryDisplayInformation');
  2412.   asm
  2413.     mov esp, ebp
  2414.     pop ebp
  2415.     jmp [_NetQueryDisplayInformation]
  2416.   end;
  2417. end;
  2418. {$ELSE}
  2419. function NetQueryDisplayInformation; external netapi32 name 'NetQueryDisplayInformation';
  2420. {$ENDIF DYNAMIC_LINK}
  2421. {$IFDEF DYNAMIC_LINK}
  2422. var
  2423.   _NetGetDisplayInformationIndex: Pointer;
  2424. function NetGetDisplayInformationIndex;
  2425. begin
  2426.   GetProcedureAddress(_NetGetDisplayInformationIndex, netapi32, 'NetGetDisplayInformationIndex');
  2427.   asm
  2428.     mov esp, ebp
  2429.     pop ebp
  2430.     jmp [_NetGetDisplayInformationIndex]
  2431.   end;
  2432. end;
  2433. {$ELSE}
  2434. function NetGetDisplayInformationIndex; external netapi32 name 'NetGetDisplayInformationIndex';
  2435. {$ENDIF DYNAMIC_LINK}
  2436. {$IFDEF DYNAMIC_LINK}
  2437. var
  2438.   _NetAccessAdd: Pointer;
  2439. function NetAccessAdd;
  2440. begin
  2441.   GetProcedureAddress(_NetAccessAdd, netapi32, 'NetAccessAdd');
  2442.   asm
  2443.     mov esp, ebp
  2444.     pop ebp
  2445.     jmp [_NetAccessAdd]
  2446.   end;
  2447. end;
  2448. {$ELSE}
  2449. function NetAccessAdd; external netapi32 name 'NetAccessAdd';
  2450. {$ENDIF DYNAMIC_LINK}
  2451. {$IFDEF DYNAMIC_LINK}
  2452. var
  2453.   _NetAccessEnum: Pointer;
  2454. function NetAccessEnum;
  2455. begin
  2456.   GetProcedureAddress(_NetAccessEnum, netapi32, 'NetAccessEnum');
  2457.   asm
  2458.     mov esp, ebp
  2459.     pop ebp
  2460.     jmp [_NetAccessEnum]
  2461.   end;
  2462. end;
  2463. {$ELSE}
  2464. function NetAccessEnum; external netapi32 name 'NetAccessEnum';
  2465. {$ENDIF DYNAMIC_LINK}
  2466. {$IFDEF DYNAMIC_LINK}
  2467. var
  2468.   _NetAccessGetInfo: Pointer;
  2469. function NetAccessGetInfo;
  2470. begin
  2471.   GetProcedureAddress(_NetAccessGetInfo, netapi32, 'NetAccessGetInfo');
  2472.   asm
  2473.     mov esp, ebp
  2474.     pop ebp
  2475.     jmp [_NetAccessGetInfo]
  2476.   end;
  2477. end;
  2478. {$ELSE}
  2479. function NetAccessGetInfo; external netapi32 name 'NetAccessGetInfo';
  2480. {$ENDIF DYNAMIC_LINK}
  2481. {$IFDEF DYNAMIC_LINK}
  2482. var
  2483.   _NetAccessSetInfo: Pointer;
  2484. function NetAccessSetInfo;
  2485. begin
  2486.   GetProcedureAddress(_NetAccessSetInfo, netapi32, 'NetAccessSetInfo');
  2487.   asm
  2488.     mov esp, ebp
  2489.     pop ebp
  2490.     jmp [_NetAccessSetInfo]
  2491.   end;
  2492. end;
  2493. {$ELSE}
  2494. function NetAccessSetInfo; external netapi32 name 'NetAccessSetInfo';
  2495. {$ENDIF DYNAMIC_LINK}
  2496. {$IFDEF DYNAMIC_LINK}
  2497. var
  2498.   _NetAccessDel: Pointer;
  2499. function NetAccessDel;
  2500. begin
  2501.   GetProcedureAddress(_NetAccessDel, netapi32, 'NetAccessDel');
  2502.   asm
  2503.     mov esp, ebp
  2504.     pop ebp
  2505.     jmp [_NetAccessDel]
  2506.   end;
  2507. end;
  2508. {$ELSE}
  2509. function NetAccessDel; external netapi32 name 'NetAccessDel';
  2510. {$ENDIF DYNAMIC_LINK}
  2511. {$IFDEF DYNAMIC_LINK}
  2512. var
  2513.   _NetAccessGetUserPerms: Pointer;
  2514. function NetAccessGetUserPerms;
  2515. begin
  2516.   GetProcedureAddress(_NetAccessGetUserPerms, netapi32, 'NetAccessGetUserPerms');
  2517.   asm
  2518.     mov esp, ebp
  2519.     pop ebp
  2520.     jmp [_NetAccessGetUserPerms]
  2521.   end;
  2522. end;
  2523. {$ELSE}
  2524. function NetAccessGetUserPerms; external netapi32 name 'NetAccessGetUserPerms';
  2525. {$ENDIF DYNAMIC_LINK}
  2526. {$IFDEF DYNAMIC_LINK}
  2527. var
  2528.   _NetValidatePasswordPolicy: Pointer;
  2529. function NetValidatePasswordPolicy;
  2530. begin
  2531.   GetProcedureAddress(_NetValidatePasswordPolicy, netapi32, 'NetValidatePasswordPolicy');
  2532.   asm
  2533.     mov esp, ebp
  2534.     pop ebp
  2535.     jmp [_NetValidatePasswordPolicy]
  2536.   end;
  2537. end;
  2538. {$ELSE}
  2539. function NetValidatePasswordPolicy; external netapi32 name 'NetValidatePasswordPolicy';
  2540. {$ENDIF DYNAMIC_LINK}
  2541. {$IFDEF DYNAMIC_LINK}
  2542. var
  2543.   _NetGetDCName: Pointer;
  2544. function NetGetDCName;
  2545. begin
  2546.   GetProcedureAddress(_NetGetDCName, netapi32, 'NetGetDCName');
  2547.   asm
  2548.     mov esp, ebp
  2549.     pop ebp
  2550.     jmp [_NetGetDCName]
  2551.   end;
  2552. end;
  2553. {$ELSE}
  2554. function NetGetDCName; external netapi32 name 'NetGetDCName';
  2555. {$ENDIF DYNAMIC_LINK}
  2556. {$IFDEF DYNAMIC_LINK}
  2557. var
  2558.   _NetGetAnyDCName: Pointer;
  2559. function NetGetAnyDCName;
  2560. begin
  2561.   GetProcedureAddress(_NetGetAnyDCName, netapi32, 'NetGetAnyDCName');
  2562.   asm
  2563.     mov esp, ebp
  2564.     pop ebp
  2565.     jmp [_NetGetAnyDCName]
  2566.   end;
  2567. end;
  2568. {$ELSE}
  2569. function NetGetAnyDCName; external netapi32 name 'NetGetAnyDCName';
  2570. {$ENDIF DYNAMIC_LINK}
  2571. {$IFDEF DYNAMIC_LINK}
  2572. var
  2573.   _I_NetLogonControl: Pointer;
  2574. function I_NetLogonControl;
  2575. begin
  2576.   GetProcedureAddress(_I_NetLogonControl, netapi32, 'I_NetLogonControl');
  2577.   asm
  2578.     mov esp, ebp
  2579.     pop ebp
  2580.     jmp [_I_NetLogonControl]
  2581.   end;
  2582. end;
  2583. {$ELSE}
  2584. function I_NetLogonControl; external netapi32 name 'I_NetLogonControl';
  2585. {$ENDIF DYNAMIC_LINK}
  2586. {$IFDEF DYNAMIC_LINK}
  2587. var
  2588.   _I_NetLogonControl2: Pointer;
  2589. function I_NetLogonControl2;
  2590. begin
  2591.   GetProcedureAddress(_I_NetLogonControl2, netapi32, 'I_NetLogonControl2');
  2592.   asm
  2593.     mov esp, ebp
  2594.     pop ebp
  2595.     jmp [_I_NetLogonControl2]
  2596.   end;
  2597. end;
  2598. {$ELSE}
  2599. function I_NetLogonControl2; external netapi32 name 'I_NetLogonControl2';
  2600. {$ENDIF DYNAMIC_LINK}
  2601. {$IFDEF DYNAMIC_LINK}
  2602. var
  2603.   _NetEnumerateTrustedDomains: Pointer;
  2604. function NetEnumerateTrustedDomains;
  2605. begin
  2606.   GetProcedureAddress(_NetEnumerateTrustedDomains, netapi32, 'NetEnumerateTrustedDomains');
  2607.   asm
  2608.     mov esp, ebp
  2609.     pop ebp
  2610.     jmp [_NetEnumerateTrustedDomains]
  2611.   end;
  2612. end;
  2613. {$ELSE}
  2614. function NetEnumerateTrustedDomains; external netapi32 name 'NetEnumerateTrustedDomains';
  2615. {$ENDIF DYNAMIC_LINK}
  2616. end.