home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / detk45he.zip / UPM.H < prev    next >
C/C++ Source or Header  |  1999-04-29  |  18KB  |  502 lines

  1. /**************************************************************************
  2.  
  3.    Module Name    = UPM.H
  4.  
  5.    Descriptive Name = User Profile Management Include file
  6.  
  7.    (C) Copyright IBM Corporation 1988, 1994.  All rights reserved.
  8.    (C) Copyright Microsoft Corporation 1988, 1991.  All rights reserved.
  9.    Licensed Material - Program Property of IBM
  10.  
  11.    Function = Include File defining Api Logon/Logoff
  12.  
  13.    Operating System = OS/2
  14.  
  15. **************************************************************************/
  16.  
  17.  
  18. #ifdef  PURE_32
  19. #include <os2def.h>
  20. #pragma pack(1)
  21. #define LSFAR
  22. #define LSPAS
  23. #define LSPTR
  24. #define LSINT  short
  25. #define FARPASCAL
  26. #define ANY_32_BIT
  27.  
  28. #endif /* PURE_32 */
  29.  
  30. #ifdef  INCL_32
  31. #pragma pack(1)
  32. #define LSFAR
  33. #define LSPAS
  34. #define LSPTR  _Seg16
  35. #define LSINT  short
  36. #define FARPASCAL  _Far16 _Pascal
  37. #define ANY_32_BIT
  38. #endif /* PURE_32 */
  39.  
  40. #ifndef ANY_32_BIT
  41. #define LSFAR  far
  42. #define LSPAS  pascal
  43. #define LSPTR
  44. #define LSINT  int
  45. #define FARPASCAL  far pascal
  46. #endif
  47.  
  48.  
  49. #define upmelgn  UPMELGN
  50. #define upmelgff UPMELGFF
  51. #define upmelocu UPMELOCU
  52. #define upmelocl UPMELOCL
  53. #define upmeulgn UPMEULGN
  54. #define upmeulgf UPMEULGF
  55. #define upmeusrl UPMEUSRL
  56. #define upmesetp UPMESETP
  57. #define upmegetp UPMEGETP
  58. #define upmglgn  UPMGLGN
  59. #define upmgulgn UPMGULGN
  60. #define upmglgff UPMGLGFF
  61. #define upmgulgf UPMGULGF
  62. #define upmglocu UPMGLOCU
  63. #define upmglocl UPMGLOCL
  64. #define upmgusrl UPMGUSRL
  65.  
  66. /*
  67.      String lengths
  68. */
  69. #define UPM_UIDLEN    10
  70.  
  71. /*
  72. The following password length applies to user logon profile entries only.
  73. */
  74. #define UPM_PWDLEN    10
  75. #define UPM_REMLEN    17
  76.  
  77. /************************************************************/
  78. /*                                                          */
  79. /*   Function Prototypes, 16-bit and mixed-model            */
  80. /*                                                          */
  81. /************************************************************/
  82. #ifndef PURE_32
  83.  
  84. /*
  85.      Log (generic) an application process on the the system
  86. */
  87. LSINT FARPASCAL UPMGLGN(
  88.             unsigned short,          /*  userid length     */
  89.             unsigned short,          /*  password length   */
  90.             unsigned short,          /*  remotename length */
  91.             unsigned short,          /*  remotetype        */
  92.             unsigned short,          /*  authcheck         */
  93.             unsigned char LSFAR *,   /*  userid            */
  94.             unsigned char LSFAR *,   /*  password          */
  95.             unsigned char LSFAR *);  /*  remotename        */
  96.  
  97. /*
  98.      Log (generic) a user on to the system
  99. */
  100. LSINT FARPASCAL UPMGULGN(
  101.             unsigned short,          /*  userid length     */
  102.             unsigned short,          /*  password length   */
  103.             unsigned short,          /*  remotename length */
  104.             unsigned short,          /*  remotetype        */
  105.             unsigned short,          /*  flags             */
  106.             unsigned char LSFAR *,   /*  userid            */
  107.             unsigned char LSFAR *,   /*  password          */
  108.             unsigned char LSFAR *);  /*  remotename        */
  109. /*
  110.      Log (generic) an application process off the system
  111. */
  112. LSINT FARPASCAL UPMGLGFF(
  113.             unsigned short,          /*  userid length     */
  114.             unsigned short,          /*  remotename length */
  115.             unsigned short,          /*  remotetype        */
  116.             unsigned char LSFAR *,   /*  userid            */
  117.             unsigned char LSFAR *);  /*  remotename        */
  118.  
  119. /*
  120.      Log (generic) a user off the system
  121. */
  122. LSINT FARPASCAL UPMGULGF(
  123.             unsigned short,          /*  userid length     */
  124.             unsigned short,          /*  remotename length */
  125.             unsigned short,          /*  remotetype        */
  126.             unsigned char LSFAR *,   /*  userid            */
  127.             unsigned char LSFAR *);  /*  remotename        */
  128.  
  129. /*
  130.      Get (generic) locally logged on user ID.
  131. */
  132. LSINT FARPASCAL UPMGLOCU(
  133.             unsigned short *,       /*  userid length     */
  134.             unsigned char LSFAR *,  /*  userid            */
  135.             unsigned short *);      /*  user type         */
  136. /*
  137.      Logon (generic) a local user ID.
  138. */
  139. LSINT FARPASCAL UPMGLOCL(
  140.             unsigned short *,         /*  userid length     */
  141.             unsigned char LSFAR *,    /*  userid            */
  142.             unsigned short *);        /*  user type         */
  143.  
  144. /*
  145.      (generic) logon user list
  146. */
  147. LSINT FARPASCAL UPMGUSRL(
  148.             unsigned short,          /*  remotename length */
  149.             unsigned short,          /*  remotetype        */
  150.             unsigned short,          /*  bufferlen         */
  151.             unsigned short LSFAR *,  /*  entriesread */
  152.             unsigned short LSFAR *,  /*  totalentry  */
  153.             unsigned char LSFAR *,   /*  remotename  */
  154.             unsigned char LSFAR *);  /*  buffer      */
  155.  
  156. /*
  157.      Log an application process on the the system
  158. */
  159. LSINT FARPASCAL UPMELGN(
  160.             unsigned char LSFAR *,   /*  userid      */
  161.             unsigned char LSFAR *,   /*  password     */
  162.             unsigned char LSFAR *,   /*  remotename  */
  163.             unsigned short,          /*  remotetype  */
  164.             unsigned short );        /*  authcheck   */
  165.  
  166. /*
  167.      Log an application process off the system
  168. */
  169. LSINT FARPASCAL UPMELGFF(
  170.             unsigned char LSFAR *,   /*  userid      */
  171.             unsigned char LSFAR *,   /*  remotename  */
  172.             unsigned short );        /*  remotetype  */
  173. /*
  174.      Get the local user ID logged on the system
  175. */
  176. LSINT FARPASCAL UPMELOCU(
  177.             unsigned char LSFAR *,   /*  userid      */
  178.             unsigned short *);       /*  type  */
  179. /*
  180.      Logon a local user ID on the system
  181. */
  182. LSINT FARPASCAL UPMELOCL(
  183.             unsigned char LSFAR *,   /*  userid      */
  184.             unsigned short *);       /*  type  */
  185.  
  186. /*
  187.      Log a user on the system
  188. */
  189. LSINT FARPASCAL UPMEULGN(
  190.             unsigned char LSFAR *,   /*  userid      */
  191.             unsigned char LSFAR *,   /*  password    */
  192.             unsigned char LSFAR *,   /*  remotename  */
  193.             unsigned short,          /*  remotetype  */
  194.             unsigned short );        /*  flags       */
  195.  
  196. /*
  197.      Log a user off the system
  198. */
  199. LSINT FARPASCAL UPMEULGF(
  200.             unsigned char LSFAR *,   /*  userid      */
  201.             unsigned char LSFAR *,   /*  remotename  */
  202.             unsigned short );        /*  remotetype  */
  203. /*
  204.      Logged on user list
  205. */
  206. LSINT FARPASCAL UPMEUSRL(
  207.             unsigned char LSFAR *,     /*  remotename  */
  208.             short,                     /*  remotetype  */
  209.             char LSFAR *,              /*  buffer      */
  210.             unsigned short,            /*  bufferlen   */
  211.             unsigned short LSFAR *,    /*  entriesread */
  212.             unsigned short LSFAR * );  /*  totalentry  */
  213.  
  214. /*
  215.      Set a Users logon profile
  216. */
  217. LSINT FARPASCAL UPMESETP (
  218.             unsigned char LSFAR *,     /*  userid      */
  219.             char LSFAR *,              /*  buffer      */
  220.             unsigned short,            /*  entries     */
  221.             unsigned short );          /*  level       */
  222.  
  223. /*
  224.      Get a Users logon profile
  225. */
  226. LSINT FARPASCAL UPMEGETP (
  227.             unsigned char LSFAR *,     /*  userid      */
  228.             char LSFAR *,              /*  buffer      */
  229.             unsigned short,            /*  bufferlen   */
  230.             unsigned short LSFAR *,    /*  entriesread */
  231.             unsigned short LSFAR *,    /*  totalavail  */
  232.             unsigned short);           /*  level       */
  233.  
  234.  
  235. #endif /* Not PURE_32 */
  236.  
  237.  
  238. /************************************************************/
  239. /*                                                          */
  240. /*   Data structures, 16-bit, mixed-model, and PURE_32      */
  241. /*                                                          */
  242. /************************************************************/
  243.  
  244. /*
  245.      User logon structure for UPMGUSRL
  246. */
  247.  
  248. struct UPM_G_USER_LOGON
  249.        {
  250.          unsigned short useridlen;
  251.          unsigned short remotelen;
  252.          unsigned short remotetype;
  253.          LSINT          sessionid;
  254.          char           userid[UPM_UIDLEN + 1];
  255.          char           remotename[UPM_REMLEN + 1];
  256.        };
  257.  
  258. /*
  259.      User logon structure for upmeusrl
  260. */
  261.  
  262. struct UPM_USER_LOGON
  263.        {
  264.          char    userid[UPM_UIDLEN + 1];
  265.          short   remotetype;
  266.          char    remotename[UPM_REMLEN + 1];
  267.          LSINT   sessionid;
  268.        };
  269.  
  270. /*
  271.      User logon profile structure for upmegetp and upmesetp
  272. */
  273.  
  274. struct UPM_USER_LOGON_PROF_0 {
  275.           unsigned char userid[ UPM_UIDLEN + 1];
  276.           unsigned char password[ UPM_PWDLEN + 1];
  277.           unsigned char remotename[ UPM_REMLEN + 1];
  278.           unsigned short remotetype;
  279.           };
  280.  
  281.  
  282.  
  283. #ifdef PURE_32
  284.  
  285. #define u32elgn  U32ELGN
  286. #define u32elgff U32ELGFF
  287. #define u32elocu U32ELOCU
  288. #define u32elocl U32ELOCL
  289. #define u32eulgn U32EULGN
  290. #define u32eulgf U32EULGF
  291. #define u32eusrl U32EUSRL
  292. #define u32esetp U32ESETP
  293. #define u32egetp U32EGETP
  294.  
  295. /************************************************************/
  296. /*                                                          */
  297. /*   Function Prototypes, PURE_32 only                      */
  298. /*                                                          */
  299. /************************************************************/
  300.  
  301.  
  302. /*
  303.      Log an application process onto the system
  304. */
  305. LSINT APIENTRY U32ELGN(
  306.             unsigned char *,         /*  userid      */
  307.             unsigned char *,         /*  password    */
  308.             unsigned char *,         /*  remotename  */
  309.             unsigned long,           /*  remotetype  */
  310.             unsigned long );         /*  authcheck   */
  311.  
  312. /*
  313.      Log an application process off the system
  314. */
  315. LSINT APIENTRY U32ELGFF(
  316.             unsigned char *,         /*  userid      */
  317.             unsigned char *,         /*  remotename  */
  318.             unsigned long );         /*  remotetype  */
  319. /*
  320.      Get the local user ID logged on the system
  321. */
  322. LSINT APIENTRY U32ELOCU(
  323.             unsigned char *,         /*  userid      */
  324.             unsigned long *);        /*  type  */
  325. /*
  326.      Logon a local user ID on the system
  327. */
  328. LSINT APIENTRY U32ELOCL(
  329.             unsigned char *,         /*  userid      */
  330.             unsigned long *);        /*  type  */
  331.  
  332. /*
  333.      Log a user onto the system
  334. */
  335. LSINT APIENTRY U32EULGN(
  336.             unsigned char *,         /*  userid      */
  337.             unsigned char *,         /*  password    */
  338.             unsigned char *,         /*  remotename  */
  339.             unsigned long,           /*  remotetype  */
  340.             unsigned long );         /*  flags       */
  341.  
  342. /*
  343.      Log a user off the system
  344. */
  345. LSINT APIENTRY U32EULGF(
  346.             unsigned char *,         /*  userid      */
  347.             unsigned char *,         /*  remotename  */
  348.             unsigned long );         /*  remotetype  */
  349. /*
  350.      Logged on user list
  351. */
  352.  
  353. LSINT APIENTRY U32EUSRL(
  354.             unsigned char *,           /*  remotename  */
  355.             unsigned long,             /*  remotetype  */
  356.             unsigned char *,           /*  buffer      */
  357.             unsigned long,             /*  bufferlen   */
  358.             unsigned long *,           /*  entriesread */
  359.             unsigned long * );         /*  totalentry  */
  360.  
  361. /*
  362.      Set a Users logon profile
  363. */
  364.  
  365. LSINT APIENTRY U32ESETP (
  366.             unsigned char *,           /*  userid      */
  367.             unsigned char *,           /*  buffer      */
  368.             unsigned long,             /*  entries     */
  369.             unsigned long );           /*  level       */
  370.  
  371. /*
  372.      Get a Users logon profile
  373. */
  374.  
  375. LSINT APIENTRY U32EGETP (
  376.             unsigned char *,           /*  userid      */
  377.             unsigned char *,           /*  buffer      */
  378.             unsigned long,             /*  bufferlen   */
  379.             unsigned long *,           /*  entriesread */
  380.             unsigned long *,           /*  totalavail  */
  381.             unsigned long);            /*  level       */
  382.  
  383. #endif /* PURE_32 */
  384.  
  385.  
  386. /************************************************************/
  387. /*                                                          */
  388. /*   More manifest constants                                */
  389. /*                                                          */
  390. /************************************************************/
  391.  
  392. /*
  393.      Valid values for the remotetype parameter
  394. */
  395. #define UPM_LOCAL            1
  396. #define UPM_DNODE            2
  397. #define UPM_DOMAIN           3
  398. /*
  399.      Additional remotetype value for upmeulgf
  400. */
  401. #define UPM_DOMAIN_MAX_FORCE 4
  402.  
  403. /*
  404.      Verbose upmeulgn (1.3.x style)
  405. */
  406. #define UPM_DOMAIN_VERBOSE   5
  407.  
  408. /*
  409.      Additional remotetype values for upmeusrl
  410. */
  411. #define UPM_LOCAL_HPFS     21
  412. #define UPM_ALL            22
  413.  
  414. /*
  415.      Lan Server logon flags for UPMEULGN.
  416.      If UPM_FL_LOCVER or UPM_FL_NOVER is specified remotename must null.
  417. */
  418.  
  419. #define UPM_FL_LOCVER               0x01   /* Local verification  */
  420. #define UPM_FL_NOVER                0x02   /* No verification     */
  421. #define UPM_FL_DOMVER               0x03   /* Domain verification */
  422.  
  423. /*
  424.      Valid values for the authcheck parameter
  425. */
  426. #define UPM_CONFIG         1
  427. #define UPM_ADMIN          2
  428. #define UPM_USER           3
  429.  
  430. /*
  431.      Valid user type privilege levels
  432. */
  433. #define UPM_PRIV_USER         1
  434. #define UPM_PRIV_ADMIN        2
  435. #define UPM_PRIV_LOCAL_ADMIN  9
  436. /*
  437.      Return values
  438.  
  439.      Note:  These values are all negative.  Any positive return
  440.            value signifies an unexpected OS/2 system level error
  441.            occurred.  The positive value is the OS/2 return code.
  442. */
  443. #define UPM_OK                 0      /* Successful.                         */
  444. #define UPM_LOG_INPROC         0xFB01 /* Another logon is in process.        */
  445. #define UPM_BAD_TYPE           0xFB02 /* Bad remotetype.                     */
  446. #define UPM_NOMEM              0xFB03 /* Cannot allocate required memory.    */
  447. #define UPM_LOG_FILE_NOT_FOUND 0xFB04 /* An execute file could not be found. */
  448. #define UPM_FAIL_SECURITY      0xFB05 /* User not logged, failed security
  449.                                          clearance.                          */
  450. #define UPM_BAD_PARAMETER      0xFB06 /* A parameter passed was invalid.     */
  451. #define UPM_BAD_AUTHCHECK      0xFB07 /* Authcheck was not valid.            */
  452. #define UPM_LOG_CANCEL         0xFB08 /* User has canceled from the logon
  453.                                          panel.                              */
  454. #define UPM_NOT_LOGGED         0xFB10 /* A logon has not occured for this
  455.                                          userid.                             */
  456. #define UPM_LOGGED             0xFB12 /* A domain logon is currently active. */
  457. #define UPM_SYS_ERROR          0xFB13 /* An unexpected system error.         */
  458. #define UPM_OPEN_SESSIONS      0xFB14 /* The domain logoff failed, The domain
  459.                                          logon has active sessions.          */
  460. #define UPM_ULP_LOADED         0xFB15 /* The local logon failed, a local
  461.                                          logon with a user logon profile is
  462.                                          active.                             */
  463. #define UPM_LOGGED_ELSEWHERE   0xFB16 /* The domain logon failed, the userid
  464.                                          is already logged on the domain.    */
  465. #define UPM_PASSWORD_EXP       0xFB17 /* The users password is expired.      */
  466. #define UPM_UNAVAIL            0xFB18 /* The logon failed, The remote node
  467.                                          or server could not be contacted to
  468.                                          process the logon request.          */
  469. #define UPM_ACTIVE             0xFB19 /* The domain logon or logoff failed,
  470.                                          a domain logon, logoff or net
  471.                                          command is in process.              */
  472. #define UPM_SS_PWDEXPWARNING   0xFB20 /* The local logon succeeded. The users
  473.                                          password is expired.                */
  474. #define UPM_SS_BUSY            0xFB21 /* The local logon failed. The Local
  475.                                          security was busy.                     */
  476. #define UPM_SS_DEAD            0xFB22 /* The local logon failed. Local
  477.                                          security has terminated unexpectedly.  */
  478. #define UPM_ERROR_MORE_DATA    0xFB23 /* More data is available, the buffer
  479.                                          provided is not large enough.       */
  480. #define UPM_MAX_ENT_EXCEEDED   0xFB24 /* Update failed, the input buffer
  481.                                          contains more than 16 entries.      */
  482. #define UPM_DUP_ULP_ENTRY      0xFB25 /* Two or more entries with the same
  483.                                          remote name and user ID were
  484.                                          detected.                           */
  485. #define UPM_MAX_ULP_EXCEEDED   0xFB26 /* Database contains maximum number
  486.                                          entries                             */
  487. #define UPM_NODISK             0xFB27 /* Insufficient disk space was available to
  488.                                          process this request   */
  489. #define UPM_PROF_NOT_FOUND     0xFB28 /* Did not find user logon profile for
  490.                                          user ID. */
  491. #define UPM_ERROR_NONVAL_LOGON 0xFB29 /* Non validated Lan Server logons are not
  492.                                          allowed with server service started  */
  493.  
  494.  
  495.  
  496.  
  497.  
  498. #ifdef  ANY_32_BIT
  499. #pragma pack()
  500. #endif
  501.  
  502.