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

  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*              IBM OS/2(tm) Local Area Network (LAN) Server              */
  4. /*                            Version 5.03                                */
  5. /*                   (C) Copyright IBM Corp. 1988, 1998                   */
  6. /*                  Licensed Materials - Property of IBM                  */
  7. /*                                                                        */
  8. /**************************************************************************/
  9.  
  10. /********************************************************************
  11.  *                                                                  *
  12.  *  About this file ...  AppParm.h                                  *
  13.  *                                                                  *
  14.  *  This file contains information about the Net32AppParmXXX an     *
  15.  *  UniNet32AppParmXXX APIs                                         *
  16.  *                                                                  *
  17.  *      Function prototypes.                                        *
  18.  *                                                                  *
  19.  *      Data structure templates.                                   *
  20.  *                                                                  *
  21.  *      Definition of special values.                               *
  22.  *                                                                  *
  23.  *  NOTE:  You must include NETCONS.H before this file, since this  *
  24.  *         file depends on values defined in NETCONS.H.             *
  25.  *                                                                  *
  26.  *******************************************************************/
  27.  
  28. /*******************************************************************************
  29.  *                                                                             *
  30.  *              Function prototypes - Net32AppParmXXX                          *
  31.  *                                                                             *
  32.  ******************************************************************************/
  33.  
  34. #include <unidef.h>
  35.  
  36. extern ULONG APIENTRY
  37.  UniNet32AppParmAdd  (const UCHAR *, /* points to servername string */
  38.                   ULONG *,           /* points to RC modifier       */
  39.                   UniChar *,         /* point to appname string     */
  40.                                      /* previously defined in DCDB  */
  41.                   ULONG,             /* level (0, 1)                */
  42.                   UniChar *,         /* point to buffer data struc. */
  43.                   ULONG,             /* buflen in bytes             */
  44.                   ULONG ,            /* # of entries in buf         */
  45.                   UniChar *);        /* reserved                    */
  46.  
  47. extern ULONG APIENTRY
  48.  UniNet32AppParmDel (const UCHAR  *, /* points to servername string */
  49.                   ULONG *,           /* points to RC modifier       */
  50.                   UniChar *,         /* point to appname string     */
  51.                                      /* previously defined in DCDB  */
  52.                   ULONG ,            /* level (0, 1)                */
  53.                   ULONG,             /* AppParmDel flags            */ /* F07 */
  54.                   UniChar *,         /* point to buffer data struc. */
  55.                   ULONG ,            /* buflen in bytes             */
  56.                   ULONG ,            /* # of entries in buf         */
  57.                                      /* if 0 then delete all parms  */
  58.                   UniChar *);        /* reserved                    */
  59.  
  60. /* AppParmDel flags - Bit definitions           */                     /* F07 */
  61.  
  62. /*             DEL request will delete any User-level .INI files that are F07 */
  63. /*                 related to the application that is being deleted       F07 */
  64. /*                 (thereby removing the "User-Overrides" for that appl)  F07 */
  65. #define APSFREMOVEUSEROVERRIDES  0x00000001
  66.  
  67. /*             NOTE THAT ALL OTHER BITS MUST BE SET TO ZERO - OTHERWISE   F07 */
  68. /*             A FATAL RC WILL BE RETURNED!                               F07 */
  69. #define APSFRESERVEDDEL          0xFFFFFFFE
  70.  
  71.  
  72.  
  73. extern ULONG APIENTRY
  74.  UniNet32AppParmGet  (const UCHAR *, /* points to servername string */
  75.                   ULONG *,           /* points to RC modifier       */
  76.                   UniChar *,         /* point to appname string     */
  77.                                      /* previously defined in DCDB  */
  78.                   UniChar *,         /* points to userid string,    */
  79.                                      /* previously defined in UAS   */
  80.                   ULONG,             /* level (0,1)                 */
  81.                   ULONG,             /* AppParmGet flags            */ /* F07 */
  82.                   UniChar *,         /* point to buffer data struc. */
  83.                   ULONG,             /* buflen in bytes             */
  84.                   ULONG *,           /* points to # of entries in   */
  85.                                      /* buf returned                */
  86.                   ULONG *,           /* points to # of entries      */
  87.                                      /* available.                  */
  88.                   ULONG *,           /* points to # of bytes        */
  89.                                      /* currently available.        */
  90.                   UniChar *);        /* reserved                    */
  91.  
  92. /* AppParmGet flags - Bit definitions           */                     /* F07 */
  93. /*   THESE BIT SETTINGS MUST MATCH THE RELATED  */                     /* F07 */
  94. /*   BIT VALUES IN THE: apsX_flags DEFINITION   */                     /* F07 */
  95.  
  96. /*             GET will return only invocation parameter field types      F07 */
  97. #define        APSFINVOCPARMONLY 0x00000100
  98.  
  99. /*             GET will return only OS/2 .INI style field types           F07 */
  100. #define        APSFOS2INIONLY    0x00000200
  101.  
  102. /*             GET will return only environment variable field types      F07 */
  103. #define        APSFENVVARONLY    0x00000400
  104.  
  105. /*             GET will return only Windows .INI style field types        F07 */
  106. #define        APSFWININIONLY    0x00000800
  107.  
  108. /*             GET will return ALL field types                            F07 */
  109. #define        APSFALLFIELDS    (APSFINVOCPARMONLY+APSFOS2INIONLY+APSFENVVARONLY+APSFWININIONLY)
  110.  
  111. /*             NOTE THAT ALL OTHER BITS MUST BE SET TO ZERO - OTHERWISE   F07 */
  112. /*             A FATAL RC WILL BE RETURNED!                               F07 */
  113. #define        APSFRESERVEDGET   0xFFFFF0FF
  114.  
  115. extern ULONG APIENTRY
  116.  UniNet32AppParmSet  (const UCHAR *, /* points to servername string */
  117.                   ULONG *,           /* points to RC modifier       */
  118.                   UniChar *,         /* point to appname string     */
  119.                                      /* previously defined in DCDB  */
  120.                   UniChar *,         /* points to userid string,    */
  121.                                      /* previously defined in UAS   */
  122.                   ULONG,             /* level (1)                   */
  123.                   UniChar *,         /* point to buffer data struc. */
  124.                   ULONG,             /* buflen in bytes             */
  125.                   ULONG ,            /* # of entries in             */
  126.                                      /* buf sent.                   */
  127.                   UniChar *);        /* reserved                    */
  128.  
  129. extern ULONG APIENTRY
  130. Net32AppParmAdd(const UCHAR *, ULONG *, UCHAR *, ULONG, UCHAR *,
  131.                 ULONG, ULONG, UCHAR * );
  132.  
  133. extern ULONG APIENTRY
  134. Net32AppParmDel(const UCHAR *, ULONG *, UCHAR *, ULONG, ULONG, UCHAR *,
  135.                 ULONG, ULONG, UCHAR * );                               /* F07 */
  136.  
  137. extern ULONG APIENTRY
  138. Net32AppParmGet(const UCHAR *, ULONG *, UCHAR *, UCHAR *, ULONG, ULONG,
  139.                 UCHAR *, ULONG, ULONG *, ULONG *, ULONG *, UCHAR * );  /* F07 */
  140.  
  141. extern ULONG APIENTRY
  142. Net32AppParmSet(const UCHAR *, ULONG *, UCHAR *, UCHAR *, ULONG, UCHAR *,
  143.                 ULONG, ULONG , UCHAR * );
  144.  
  145. typedef ULONG (* APIENTRY pfnUniNet32AppParmAdd)(const UCHAR *, ULONG *, UniChar *, ULONG, UniChar *,
  146.                  ULONG, ULONG , UniChar *);
  147.  
  148. typedef ULONG (* APIENTRY pfnUniNet32AppParmDel)(const UCHAR *, ULONG *,
  149.                 UniChar *, ULONG, ULONG, UniChar *, ULONG, ULONG, UniChar *); /* F07 */
  150.  
  151. typedef ULONG (* APIENTRY pfnUniNet32AppParmGet)(const UCHAR *, ULONG *,
  152.                   UniChar *, UniChar *, ULONG, ULONG, UniChar *, ULONG,
  153.                   ULONG *, ULONG *, ULONG *, UniChar *);               /* F07 */
  154.  
  155. typedef ULONG (* APIENTRY pfnUniNet32AppParmSet)(const UCHAR *, ULONG *, UniChar *, UniChar *, ULONG,
  156.                  UniChar *, ULONG, ULONG , UniChar *);
  157.  
  158. typedef ULONG (* APIENTRY pfnNet32AppParmAdd)(const UCHAR *, ULONG *, UCHAR *, ULONG, UCHAR *,
  159.                ULONG, ULONG, UCHAR * );
  160.  
  161. typedef ULONG (* APIENTRY pfnNet32AppParmDel)(const UCHAR *, ULONG *,
  162.                UCHAR *, ULONG, ULONG, UCHAR *, ULONG, ULONG, UCHAR * ); /* F07 */
  163.  
  164. typedef ULONG (* APIENTRY pfnNet32AppParmGet)(const UCHAR *, ULONG *,
  165.                UCHAR *, UCHAR *, ULONG, ULONG, UCHAR *,
  166.                ULONG, ULONG *, ULONG *, ULONG *, UCHAR * );           /* F07 */
  167.  
  168. typedef ULONG (* APIENTRY pfnNet32AppParmSet)(const UCHAR *, ULONG *, UCHAR *, UCHAR *, ULONG, UCHAR *,
  169.                ULONG, ULONG , UCHAR * );
  170.  
  171.  
  172. /******************************************************************************/
  173. /*                                                                            */
  174. /*          Net32AppParm API data structures (for Levels 0 & 1)           F07 */
  175. /*                                                                            */
  176. /******************************************************************************/
  177. /*
  178.  * Unicode version
  179.  */
  180. struct app_parm_info_0 {
  181. /*             Combining the 3 fields below, uniquely identifies parms for F07 */
  182. /*             .INI files (first 2 fields need to be NULL for env vars). F07 */
  183.  
  184.                UniChar * aps0_ini_file_name;  /* Only used w/.INI files  F07 */
  185.                UniChar * aps0_ini_app_name;   /* Only used w/.INI files  F07 */
  186.                UniChar * aps0_parm_name;      /* parm name                   */
  187.                ULONG     aps0_flags;          /* parm flags                  */
  188. };
  189.  
  190. struct app_parm_info_1 {
  191.  
  192. /*             Combining the 3 fields below, uniquely identifies parms for F07 */
  193. /*             .INI files (first 2 fields need to be NULL for env vars). F07 */
  194.  
  195.                UniChar * aps1_ini_file_name;  /* Only used w/.INI files  F07 */
  196.                UniChar * aps1_ini_app_name;   /* Only used w/.INI files  F07 */
  197.                UniChar * aps1_parm_name;      /* a.k.a. ini_key_name     F07 */
  198.  
  199.                ULONG     aps1_flags;          /* parm flags                  */
  200.                UniChar * aps1_parm_value;     /* ptr to parm value           */
  201.                ULONG     aps1_parm_length;    /* data length (only used &    */
  202.                                               /* req'd for binary data)  F07 */
  203.                ULONG     aps1_reserved;       /* reserved - Must be 0    F07 */
  204. };
  205.  
  206. /*
  207.  * ascii version
  208.  */
  209. struct app_parm_info_a0 {
  210. /*             Combining the 3 fields below, uniquely identifies parms for F07 */
  211. /*             .INI files (first 2 fields need to be NULL for env vars). F07 */
  212.  
  213.                  UCHAR *  aps0_ini_file_aname;  /* Only used w/INI files F07*/
  214.                  UCHAR *  aps0_ini_app_aname;   /* Only used w/INI files F07*/
  215.                  UCHAR *  aps0_parm_aname;      /* parm name               */
  216.                  ULONG    aps0_aflags;          /* parm flags              */
  217. };
  218.  
  219. struct app_parm_info_a1 {
  220. /*             Combining the 3 fields below, uniquely identifies parms for F07 */
  221. /*             .INI files (first 2 fields need to be NULL for env vars). F07 */
  222.  
  223.                  UCHAR *  aps1_ini_file_aname;  /* Only used w/INI files F07*/
  224.                  UCHAR *  aps1_ini_app_aname;   /* Only used w/INI files F07*/
  225.                  UCHAR *  aps1_parm_aname;      /* a.k.a. ini_key_name   F07*/
  226.  
  227.                  ULONG    aps1_aflags;          /* parm flags               */
  228.                  UCHAR *  aps1_parm_avalue;     /* parm value               */
  229.                  ULONG    aps1_parm_alength;    /* data length (only used & */
  230.                                                 /* req'd for binary data)F07*/
  231.                  ULONG    aps1_areserved;       /* reserved - Must be 0  F07*/
  232. };
  233.  
  234.  
  235. /***************************************************************************
  236.  *                                                                         *
  237.  *              AppParm Flag definitions for Net32AppParm APIs          F07*
  238.  *                                                                         *
  239.  * Notes:                                                                  *
  240.  *       These flags pertain only to the specific parmname/parmvalue    F07*
  241.  *         pair that are are defined with.                              F07*
  242.  *  ***  All bits other than those discussed below, MUST be set to zero F07*
  243.  *                                                                         *
  244.  * APSFREQUIRED                                                            *
  245.  * APSFUSEROVER                                                            *
  246.  * APSFDEFAULT                                                             *
  247.  * Notes:                                                                  *
  248.  *       If APSFREQUIRED is SET, then the parm value will be checked for   *
  249.  *          a NULL value (on Net32AppParmGet requests). The return code:   *
  250.  *          ERR_DefinitionIncomplete will be returned, if any of the       *
  251.  *          required parameters have not been supplied.                    *
  252.  *       If APSFUSEROVER is SET, then this parm can (but does not have to  *
  253.  *          be) overridden, on a per-user basis (i.e. the subsequent       *
  254.  *          user setting, will override the previously supplied default).  *
  255.  *       If APSFDEFAULT is SET, then restore the default application-wide  *
  256.  *          parm (i.e. delete the user-specific overriden parm).           *
  257.  *                                                                         *
  258.  *============================                                             *
  259.  * APSFBINNONULL    ====\                                                  *
  260.  * APSFSTRING       ==== >> mutually exclusive                             *
  261.  * APSFINT          ====/                                                  *
  262.  * Notes:                                                                  *
  263.  *       The above flags can not be set by UniNet32AppParmSet.             *
  264.  *       If APSFBINNONUL is SET, then parm is Binary (i.e. it can contain  *
  265.  *          embedded nulls).                                               *
  266.  *       If APSFSTRING is SET, then parm is String (i.e. it's a null-      *
  267.  *          terminated string).                                            *
  268.  *       If APSFINT is SET, then parm is Integer.                          *
  269.  *                                                                         *
  270.  *============================                                             *
  271.  * APSFINVOCPARM    ====\                                                  *
  272.  * APSFINIFIELD     ==== >> mutually exclusive                             *
  273.  * APSFENVRONVAR    ====/                                                  *
  274.  * APSFWININIFIELD  ===/                                               F07 *
  275.  * Notes:                                                                  *
  276.  *       The above flags can not be set by UniNet32AppParmSet.             *
  277.  *       If APFSINVOCPARM is set then concatenate the parameters to        *
  278.  *          the invoked program.                                           *
  279.  *          Ex: Prog. Path=d:\hr\ben                                       *
  280.  *           Command Line= benefit.exe                                     *
  281.  *           Work Dir.=                                                    *
  282.  *           Parameter: USER='empno=53467'                                 *
  283.  *             start benefit 'empno=43467'                                 *
  284.  *                                                                         *
  285.  *       If APSFINIFIELD  is SET, then APSFSTRING or APSFBINNONULL     F07 *
  286.  *          must also be set.                                              *
  287.  *       If APSFENVRONVAR is SET, then APSFSTRING must also be set.        *
  288.  *       If APFSENVRONVAR is SET, then prepend|append|replace the          *
  289.  *          parameter value to the environment variable.                   *
  290.  *       If APSFWININIFIELD is SET, then APSFSTRING must also be set.  F07 *
  291.  *                                                                         *
  292.  *============================                                             *
  293.  * APSFBEGIN     ----\                                                     *
  294.  * APSFEND       ----->> mutually exclusive                                *
  295.  * APSFREPLACE   ----/                                                     *
  296.  * Notes:                                                                  *
  297.  *       The APSFBEGIN, APSFEND, & APSFREPLACE are only valid for environ- *
  298.  *          ment variables (i.e. when APSFENVRONVAR is set).          F07  *
  299.  *       If APSFBEGIN is SET, then prepend the specifed value before the   *
  300.  *          environment variable.                                          *
  301.  *       If APSFEND is SET, then append the specified value to the end of  *
  302.  *          the environment variable.                                      *
  303.  *       If APSFREPLACE is SET, then replace the environment variable with *
  304.  *          the specified value.                                           *
  305.  *                                                                         *
  306.  *        APSFREPLACE is NOT VALID with APSFENVRONVAR when                 *
  307.  *             aps_parm_name is LIBPATH                                    *
  308.  *                                                                         *
  309.  *==============================                                           *
  310.  * All the above flags will be returned in the UniNet32AppParmGet.         *
  311.  * All the above flags except APSFDEFAULT, APSFEND  will be ignored in     *
  312.  * UniNet32AppParmSet.                                                     *
  313.  **************************************************************************/
  314. /*
  315.  * Parm Flags Bit Values
  316.  */
  317.  
  318. #define        APSFREQUIRED      0x00000001
  319. #define        APSFUSEROVER      0x00000002
  320. #define        APSFDEFAULT       0x00000004
  321. #define        APSFBINNONULL     0x00000010
  322. #define        APSFSTRING        0x00000020
  323. #define        APSFINT           0x00000040
  324. #define        APSFINVOCPARM     0x00000100
  325.  
  326. /*             Used for OS/2 style .INI files                             F07 */
  327. #define        APSFINIFIELD      0x00000200
  328.  
  329. #define        APSFENVRONVAR     0x00000400
  330.  
  331. /*             Used for Windows style .INI files                          F07 */
  332. #define        APSFWININIFIELD   0x00000800
  333.  
  334. #define        APSFBEGIN         0x00001000
  335. #define        APSFEND           0x00002000
  336. #define        APSFREPLACE       0x00004000
  337.  
  338. /*             NOTE THAT ALL OTHER BITS MUST BE SET TO ZERO - OTHERWISE   F07 */
  339. /*             A FATAL RC WILL BE RETURNED!                               F07 */
  340. #define        APSFRESERVED      0xFFFF8088
  341.  
  342. /*
  343.  * Maximum size in bytes of environment parameter in config.sys (OS2 limit)
  344.  * parm name (1KB) = parm value (1KB)
  345.  *
  346.  */
  347. #define        MAX_ENV_LEN       1024
  348.  
  349. /******************************************************************************/
  350.  
  351. /* Return Code Modifier (RCM) values                                          */
  352. /******************************************************************************/
  353. #define ERR_LEVEL                        1001
  354. #define ERR_INPUT_BUFF                   1002
  355. #define ERR_INVALID_NUM_OF_ENTRIES       1003
  356. #define ERR_INVALID_REQUEST              1004
  357. #define ERR_INVALID_APPNAME              1005
  358. #define ERR_INVALID_DATATYPE             1006
  359. #define ERR_INVALID_FIELDTYPE            1007
  360. #define ERR_INVALID_PLACEMENT            1008
  361. #define ERR_RESERVED_FLD_NOT_0           1009
  362. #define ERR_CONVERSION_FAILURE           1010
  363. #define ERR_ITEM_NOT_FOUND               1011
  364. #define ERR_SCHEMA_CHANGED               1012
  365. #define ERR_APP_NOT_FOUND                1013
  366. #define ERR_NO_INI_FILE                  1014
  367. #define ERR_INI_FILE_WRITE               1015
  368. #define ERR_INI_ENTRY_EXISTS             1016
  369. #define ERR_INIT_FAILED                  1017
  370. #define ERR_TERM_FAILED                  1018
  371. #define ERR_INI_FILE_OPEN_FAILED         1019
  372. #define ERR_INI_FILE_CLOSE_FAILED        1020
  373. #define ERR_CANNOT_GET_KEYS              1021
  374. #define ERR_REQUIRED_VALUE_MISSING       1022
  375. #define ERR_CANNOT_DELETE_INI_FILE       1023
  376. #define ERR_NOT_USER_OVERRIDABLE         1024
  377. #define ERR_INBUF_TOO_SMALL              1025
  378. #define ERR_GET_LAN_ROOT_FAILURE         1026
  379. #define ERR_NO_USER_DIRECTORY            1027
  380. #define ERR_CANT_CREATE_USER_DIRECTORY   1028
  381. #define ERR_USER_ENTRY_DELETED           1029
  382. #define ERR_INI_NAME_NOT_ALLOWED         1030
  383. #define ERR_USER_INI_NAME_MISSING        1031
  384. #define ERR_STRUCTURE_CORRUPTION         1032
  385.  
  386.