Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
4.1 KiB

  1. /*
  2. File userdb.h
  3. Definition of the local user database object.
  4. Paul Mayfield, 10/8/97
  5. */
  6. #ifndef __userdb_h
  7. #define __userdb_h
  8. #include <windows.h>
  9. // Creates a user data base object, initializing it from the local user database
  10. // and returning a handle to it.
  11. DWORD usrOpenLocalDatabase (HANDLE * hUserDatabase);
  12. // Frees up the resources held by a user database object flushing all
  13. // changes to the system.
  14. DWORD usrCloseLocalDatabase (HANDLE hUserDatabase);
  15. // Flushes the data written to the database object to the system
  16. DWORD usrFlushLocalDatabase (HANDLE hUserDatabase);
  17. // Rolls back the local user database so that it is in
  18. // the same state it was in when usrOpenLocalDatabase was
  19. // called. The rollback is automatically flushed to the
  20. // system. (i.e. usrFlushLocalDatabase doesn't need to follow)
  21. DWORD usrRollbackLocalDatabase (HANDLE hUserDatabase);
  22. // Reloads the local user database from the system
  23. DWORD usrReloadLocalDatabase (HANDLE hUserDatabase);
  24. // Gets global user data
  25. DWORD usrGetEncryption (HANDLE hUserDatabase, PBOOL pbEncrypted);
  26. // Gets user encryption setting
  27. DWORD usrSetEncryption (HANDLE hUserDatabase, BOOL bEncrypt);
  28. // Returns whether dcc connections are allowed to bypass authentication
  29. DWORD usrGetDccBypass (HANDLE hUserDatabase, PBOOL pbBypass);
  30. // Sets whether dcc connections are allowed to bypass authentication
  31. DWORD usrSetDccBypass (HANDLE hUserDatabase, BOOL bBypass);
  32. // Reports whether the user database is pure. (i.e. nobody has
  33. // gone into MMC and messed with it).
  34. DWORD usrIsDatabasePure (HANDLE hUserdatabase, PBOOL pbPure);
  35. // Marks the user database's purity
  36. DWORD usrSetDatabasePure(HANDLE hUserDatabase, BOOL bPure);
  37. // Gives the count of users stored in the user database object
  38. DWORD usrGetUserCount (HANDLE hUserDatabase, LPDWORD lpdwCount);
  39. // Adds a user to the given database. This user will not be
  40. // added to the system's local user database until this database
  41. // object is flushed (and as long as Rollback is not called on
  42. // this database object)
  43. //
  44. // On success, an optional handle to the user is returned
  45. //
  46. DWORD usrAddUser (HANDLE hUserDatabase, PWCHAR pszName, OPTIONAL HANDLE * phUser);
  47. // Deletes the user at the given index
  48. DWORD usrDeleteUser (HANDLE hUserDatabase, DWORD dwIndex);
  49. // Gives a handle to the user at the given index
  50. DWORD usrGetUserHandle (HANDLE hUserDatabase, DWORD dwIndex, HANDLE * hUser);
  51. // Gets a pointer to the name of the user (do not modify this)
  52. DWORD usrGetName (HANDLE hUser, PWCHAR* pszName);
  53. // Fills the given buffer with the full name of the user
  54. DWORD usrGetFullName (HANDLE hUser, IN PWCHAR pszBuffer, IN OUT LPDWORD lpdwBufSize);
  55. // Commits the full name of a user
  56. DWORD usrSetFullName (HANDLE hUser, PWCHAR pszFullName);
  57. // Commits the password of a user
  58. DWORD usrSetPassword (HANDLE hUser, PWCHAR pszNewPassword);
  59. // Fills the given buffer with a friendly display name (in the form username (fullname))
  60. DWORD usrGetDisplayName (HANDLE hUser, IN PWCHAR pszBuffer, IN OUT LPDWORD lpdwBufSize);
  61. // Determines whether users has callback/dialin priveleges.
  62. DWORD usrGetDialin (HANDLE hUser, BOOL* bEnabled);
  63. // Determines which if any callback priveleges are granted to a given user. Either (or both) of
  64. // bAdminOnly and bCallerSettable can be NULL
  65. DWORD usrGetCallback (HANDLE hUser, BOOL* bAdminOnly, BOOL * bCallerSettable);
  66. // Enable/disable dialin privelege.
  67. DWORD usrEnableDialin (HANDLE hUser, BOOL bEnable);
  68. // The flags are evaluated in the following order with whichever condition
  69. // being satisfied fist defining the behavior of the function.
  70. // bNone == TRUE => Callback is disabled for the user
  71. // bCaller == TRUE => Callback is set to caller-settable
  72. // bAdmin == TRUE => Callback is set to a predefine callback number set in usrSetCallbackNumer
  73. // All 3 are FALSE => No op
  74. DWORD usrEnableCallback (HANDLE hUser, BOOL bNone, BOOL bCaller, BOOL bAdmin);
  75. // Retreives a pointer to the callback number of the given user
  76. DWORD usrGetCallbackNumber(HANDLE hUser, PWCHAR * lpzNumber);
  77. // Sets the callback number of the given user. If lpzNumber is NULL, an empty phone number
  78. // is copied.
  79. DWORD usrSetCallbackNumber(HANDLE hUser, PWCHAR lpzNumber);
  80. #endif