home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / H / MINSTALL.H < prev    next >
C/C++ Source or Header  |  1995-08-24  |  24KB  |  437 lines

  1. /********************** START OF SPECIFICATIONS ****************************/
  2. /*                                                                         */
  3. /* Module Name: MInstall.h                                                 */
  4. /*                                                                         */
  5. /* DESCRIPTIVE NAME: Defines for creation of Installation Device Specific  */
  6. /*                   Dlls.                                                 */
  7. /*                                                                         */
  8. /* ABSTRACT: This file contains information necessary for the creation of  */
  9. /*           device specific Dlls. A message based interface exists so     */
  10. /*           that theses Dlls can do such things as change config.sys,     */
  11. /*           update the MME.INI file, and create WPS Objects.              */
  12. /*                                                                         */
  13. /* Copyright (c) International Business Machines Corporation 1990,1991     */
  14. /*                         All Rights Reserved                             */
  15. /*                                                                         */
  16. /*********************** END OF SPECIFICATIONS *****************************/
  17.  
  18. #ifndef __MINSTALL_H_
  19. #define __MINSTALL_H_
  20.  
  21. #define MAX_SETUP_STRING      1000     /* Longest setup string including   */
  22.                                        /*   expanded macros                */
  23.  
  24. #define MAX_FOLDER_NAME       150      /* Longest desktop folder name      */
  25.  
  26. #define MAX_RESPONSE_LENGTH   256      /* Max device specific DLL response */
  27.  
  28. /* XLATOFF */
  29. #pragma pack(4)
  30. /* XLATON */
  31.  
  32. /***************************************************************************/
  33. /* This is a function pointer prototype that describes the entry point     */
  34. /* into the device specific DLL.                                           */
  35. /*                                                                         */
  36. /* Parameters:  HWND - Owner handle.                                       */
  37. /*              PSZ  - Source path.                                        */
  38. /*              PSZ  - Destination Drive (drive letter, colon - eg.  "X:") */
  39. /*              PSZ  - Dll input parms in script file (DLL specific)       */
  40. /*              HWND - Object window that receives message to do MCI and   */
  41. /*                     CONFIG.SYS work.                                    */
  42. /*              PSZ  - PSZ used for response file. (Is a CHAR [256] and    */
  43. /*                     used for IN/OUT)                                    */
  44. /***************************************************************************/
  45. typedef ULONG APIENTRY VENDORFUNCTION(HWND,
  46.                                           PSZ,
  47.                                           PSZ,
  48.                                           PSZ,
  49.                                           HWND,
  50.                                           PSZ);
  51.  
  52. typedef VENDORFUNCTION  * PVENDORFUNCTION;
  53.  
  54. /***************************************************************************/
  55. /* MM_DISPATCHVARS and MM_DISPATCHMESSAGES() are two macros used by Device */
  56. /* specific DLL's to keep the user interface responsive while they are     */
  57. /* doing updates to MME.INI, config.sys, etc . . . This is necessary       */
  58. /* because the device specific dll's are executing in install's msg queue  */
  59. /* thread (thread 1).                                                      */
  60. /*                                                                         */
  61. /* MM_DISPATCHVARS should be declared in the scope required for the        */
  62. /* MM_DISPATCHMESSAGES() macro to use them.                                */
  63. /*                                                                         */
  64. /* MM_DISPATHMESSAGES() should be used before and after every I/O intensive*/
  65. /* operation.                                                              */
  66. /*                                                                         */
  67. /* An example would be:                                                    */
  68. /*                                                                         */
  69. /* void IOIntensive()                                                      */
  70. /*    {                                                                    */
  71. /*    MM_DISPATCHVARS;                                                     */
  72. /*                                                                         */
  73. /*    MM_DISPATHMESSAGES();                                                */
  74. /*    DiskIO();                                                            */
  75. /*    MM_DISPATHMESSAGES();                                                */
  76. /*    }                                                                    */
  77. /*                                                                         */
  78. /* Please set the mouse pointer to SPTR_WAIT during operations lasting     */
  79. /* than 1 second.                                                          */
  80. /***************************************************************************/
  81. #define MM_DISPATCHVARS        HAB MM_hab_ = WinQueryAnchorBlock(HWND_DESKTOP);\
  82.                                QMSG MM_qmsg_
  83.  
  84. #define MM_DISPATCHMESSAGES()  while (WinPeekMsg(MM_hab_,                   \
  85.                                                  &MM_qmsg_,                 \
  86.                                                  (HWND)NULL,                \
  87.                                                  0,                         \
  88.                                                  0,                         \
  89.                                                  PM_NOREMOVE))              \
  90.                                   {                                         \
  91.                                   WinGetMsg(MM_hab_, &MM_qmsg_, NULL, 0, 0);\
  92.                                   WinDispatchMsg(MM_hab_, &MM_qmsg_);       \
  93.                                   }
  94.  
  95. /***************************************************************************/
  96. /* IM_MCI_EXTENDED_SYSINFO - Maps to MCI_SYSINFO.                          */
  97. /*                                                                         */
  98. /* mp1 = msg;                                                              */
  99. /* mp2 = pvoid;                                                            */
  100. /*                                                                         */
  101. /* This will map to:                                                       */
  102. /*         sysinfo.dwItem       = (ULONG)LONGFROMMP(mp1);                  */
  103. /*         sysinfo.pSysInfoParm = PVOIDFROMMP(mp2);                        */
  104. /*         mciSendCommand((USHORT)0,                                       */
  105. /*                        (USHORT)MCI_SYSINFO,                             */
  106. /*                        (ULONG)MCI_SYSINFO_ITEM,                         */
  107. /*                        (ULONG)&sysinfo,                                 */
  108. /*                        (USHORT)0);                                      */
  109. /***************************************************************************/
  110. #define IM_MCI_EXTENDED_SYSINFO     0x057E
  111.  
  112. /* XLATOFF */
  113. #pragma pack(1)
  114. /* XLATON */
  115.  
  116. typedef struct _INSTIOPROC
  117.    {
  118.    CHAR  fccIOProc[5];
  119.    CHAR  szDLLName[CCHMAXPATH];
  120.    CHAR  szProcName[32];  /* [128] */
  121.    ULONG ulFlags;                          /* feature 5508 */
  122.    ULONG ulExtendLen;                      /* feature 5508 */
  123.    ULONG ulMediaType;                      /* feature 5508 */
  124.    ULONG ulIOProcType;                     /* feature 5508 */
  125.    CHAR  szDefExt[4];                      /* feature 5508 */
  126.    } INSTIOPROC;
  127.  
  128. typedef INSTIOPROC *PINSTIOPROC;
  129.  
  130. typedef struct _INSTCODECINIFILEINFO         /* codecinifileinfo            */
  131.    {                                                       /* feature 5572 */
  132.    ULONG       ulStructLen;                  /* length of this structure    */
  133.                                                            /* feature 5572 */
  134.    CHAR        fcc[5];                       /* File Format ID              */
  135.                                                            /* feature 5572 */
  136.    CHAR        szDLLName[CCHMAXPATH];        /* DLL name string             */
  137.                                                            /* feature 5572 */
  138.    CHAR        szProcName[32];               /* Procedure name string       */
  139.                                                            /* feature 5572 */
  140. /* ULONG       ulCompressType;   */          /* Compression Type            */
  141.    union
  142.                                                            /* feature 5572 */
  143.       {
  144.       ULONG  ulCodecCompType;
  145.                                                            /* feature 5572 */
  146.       CHAR   fccCodecCompType[5];
  147.       } x;
  148.                                                            /* feature 5572 */
  149.    ULONG       ulCompressSubType;            /* Compression SubType         */
  150.                                                            /* feature 5572 */
  151.    ULONG       ulMediaType;                  /* Media type                  */
  152.                                                            /* feature 5572 */
  153.    ULONG       ulCapsFlags;                  /* capabilities flags          */
  154.                                                            /* feature 5572 */
  155.    ULONG       ulFlags;                      /* flags                       */
  156.                                                            /* feature 5572 */
  157.    CHAR        szHWID[32];                   /* specific information        */
  158.                                                            /* feature 5572 */
  159.    ULONG       ulMaxSrcBufLen;               /* max source buffer length    */
  160.                                                            /* feature 5572 */
  161.    ULONG       ulSyncMethod;                  /* Synchronization method      */
  162.                                                            /* feature 5572 */
  163.    ULONG       fccPreferredFormat;           /* Preferred output format     */
  164.                                                            /* feature 5572 */
  165.    ULONG       ulXalignment;                 /* x alignment - video only    */
  166.                                                            /* feature 5572 */
  167.    ULONG       ulYalignment;                 /* y alignment - video only    */
  168.                                                            /* feature 5572 */
  169.    CHAR        szSpecInfo[32];               /* specific information        */
  170.                                                            /* feature 5572 */
  171.    } INSTCODECINIFILEINFO;
  172.                                                            /* feature 5572 */
  173.  
  174. typedef INSTCODECINIFILEINFO * PINSTCODECINIFILEINFO;
  175.                                                            /* feature 5572 */
  176.  
  177. /* XLATOFF */
  178. #pragma pack( )
  179. /* XLATON */
  180.  
  181. /***************************************************************************/
  182. /* IM_MMIO_INSTALL - Install an IO-Proc                                    */
  183. /*                                                                         */
  184. /* mp1 = 0;                        ** Not used                             */
  185. /* mp2 = (PINSTIOPROC)&instioproc; ** pointer to the INSTIOPROC struct     */
  186. /***************************************************************************/
  187. #define IM_MMIO_INSTALL    0x057F
  188.  
  189. /***************************************************************************/
  190. /* IM_SPI_INSTALL - Install stream protocol information                    */
  191. /*                                                                         */
  192. /* mp1 = 0;                ** Not used                                     */
  193. /* mp2 = (PSZ)pszDllPath;  ** Fully qualified path of a SPI resource DLL   */
  194. /***************************************************************************/
  195. #define IM_SPI_INSTALL     0x0580
  196.  
  197. #define INST_MAXCLASSNAME   256
  198. #define INST_MAXTITLE       256
  199. #define INST_MAXSETUPSTRING 1024
  200. #define INST_MAXLOCATION    256
  201.  
  202.  
  203. typedef struct _INSTOBJECTDATA
  204.    {
  205.    CHAR  achClassName[INST_MAXCLASSNAME];
  206.    CHAR  achTitle[INST_MAXTITLE];
  207.    CHAR  achSetupString[INST_MAXSETUPSTRING];
  208.    CHAR  achLocation[INST_MAXLOCATION];
  209.    ULONG ulFlags;
  210.    } INSTOBJECTDATA;
  211.  
  212. typedef INSTOBJECTDATA *PINSTOBJECTDATA;
  213.  
  214. /***************************************************************************/
  215. /* IM_CREATE_WPS_OBJECT - Install a folder and its contents                */
  216. /*                                                                         */
  217. /* mp1 = 0;                ** Not used                                     */
  218. /* mp2 = MPFROMP(pinstOBJECTdata);                                         */
  219. /***************************************************************************/
  220. #define IM_CREATE_WPS_OBJECT  0x0571
  221.  
  222. /***************************************************************************/
  223. /* IM_DESTROY_WPS_OBJECT - Install a folder and its contents               */
  224. /*                                                                         */
  225. /* mp1 = 0;                ** Not used                                     */
  226. /* mp2 = MPFROMP(HOBJECT); ** or "<OBJECT_ID>"                             */
  227. /***************************************************************************/
  228. #define IM_DESTROY_WPS_OBJECT  0x0572
  229.  
  230. /***************************************************************************/
  231. /* IM_LOG_ERROR - Write a message to the log file.                         */
  232. /*                                                                         */
  233. /* mp1 = (PSZ)pszStatement;   ** Should end with a '\n' and be NULL        */
  234. /*                            **  terminated                               */
  235. /* mp2 = 0;                   ** Unused                                    */
  236. /***************************************************************************/
  237. #define IM_LOG_ERROR       0x0573
  238.  
  239. /***************************************************************************/
  240. /* CONFIGDATA - Pointer to this structure is passed in mp1 in all CONFIG   */
  241. /*              messages.                                                  */
  242. /***************************************************************************/
  243. typedef struct _CONFIGDATA
  244.    {
  245.    LONG lLine;
  246.    LONG lBufferLen;
  247.    PSZ  pszBuffer;
  248.    BOOL fAdd;
  249.    } CONFIGDATA;
  250.  
  251. typedef CONFIGDATA *PCONFIGDATA;
  252.  
  253. /***************************************************************************/
  254. /* IM_CONFIGENUMERATE - Get a line from the config.sys file.               */
  255. /*                                                                         */
  256. /* mp1 = (PCONFIGDATA)pconfdata;                                           */
  257. /* mp2 = 0                                                                 */
  258. /***************************************************************************/
  259. #define IM_CONFIGENUMERATE 0x0574
  260.  
  261. /***************************************************************************/
  262. /* IM_CONFIGUPDATE - Update an entry in the config.sys file.               */
  263. /*                                                                         */
  264. /* mp1 = (PCONFIGDATA)pconfdata;                                           */
  265. /* mp2 = 0                                                                 */
  266. /***************************************************************************/
  267. #define IM_CONFIGUPDATE    0x0575
  268.  
  269. /***************************************************************************/
  270. /* IM_CONFIGMERGE - Merge data into an existing config.sys entry.          */
  271. /*                                                                         */
  272. /* mp1 = (PCONFIGDATA)pconfdata;                                           */
  273. /* mp2 = 0                                                                 */
  274. /***************************************************************************/
  275. #define IM_CONFIGMERGE     0x0576
  276.  
  277. /***************************************************************************/
  278. /* IM_CONFIGEREPLACE - Replace an entry that exists in config.sys.         */
  279. /*                                                                         */
  280. /* mp1 = (PCONFIGDATA)pconfdata;                                           */
  281. /* mp2 = 0                                                                 */
  282. /***************************************************************************/
  283. #define IM_CONFIGREPLACE   0x0577
  284.  
  285. /***************************************************************************/
  286. /* IM_CONFIGNEW - Add a line to the config.sys file.                       */
  287. /*                                                                         */
  288. /* mp1 = (PCONFIGDATA)pconfdata;                                           */
  289. /* mp2 = 0                                                                 */
  290. /***************************************************************************/
  291. #define IM_CONFIGNEW       0x0578
  292.  
  293. /***************************************************************************/
  294. /* IM_CONFIGDELETE - Delete a line (REM it out) from the config.sys file.  */
  295. /*                                                                         */
  296. /* mp1 = (PCONFIGDATA)pconfdata;                                           */
  297. /* mp2 = 0                                                                 */
  298. /***************************************************************************/
  299. #define IM_CONFIGDELETE    0x0579
  300.  
  301. /***************************************************************************/
  302. /* IM_CONFIGQUERYCHANGED - Returns TRUE if config.sys has changed else     */
  303. /*                         FALSE.                                          */
  304. /*                                                                         */
  305. /* mp1 = 0                                                                 */
  306. /* mp2 = 0                                                                 */
  307. /***************************************************************************/
  308. #define IM_CONFIGQUERYCHANGED    0x057A
  309.  
  310.  
  311. typedef struct _MIDIMAPINSTALLDATA
  312.    {
  313.    CHAR  achIniName[CCHMAXPATH];
  314.    CHAR  achAppName[1024];
  315.    CHAR  achKeyName[1024];
  316.    CHAR  achDllName[CCHMAXPATH];
  317.    ULONG ulResourceID;
  318.    } MIDIMAPINSTALLDATA;
  319.  
  320. typedef MIDIMAPINSTALLDATA *PMIDIMAPINSTALLDATA;
  321.  
  322. /***************************************************************************/
  323. /* IM_MIDIMAP_INSTALL - Install a midi map.                                */
  324. /*                                                                         */
  325. /* mp1 = 0;                ** Not used                                     */
  326. /* mp2 = MPFROMP(pmidimapinstalldata);                                     */
  327. /*                                                                         */
  328. /* Return 0 on success, else error occurred.                               */
  329. /***************************************************************************/
  330. #define IM_MIDIMAP_INSTALL 0x057B
  331.  
  332. typedef struct _INSTMCISENDCOMMAND
  333.    {
  334.    USHORT wDeviceID;
  335.    USHORT wMessage;
  336.    ULONG  dwParam1;
  337.    ULONG  dwParam2;
  338.    USHORT wUserParm;
  339.    } INSTMCISENDCOMMAND;
  340.  
  341. typedef INSTMCISENDCOMMAND *PINSTMCISENDCOMMAND;
  342.  
  343. /***************************************************************************/
  344. /* IM_MCI_SEND_COMMAND - Send an MCI command                               */
  345. /*                                                                         */
  346. /* mp1 = 0;                ** Not used                                     */
  347. /* mp2 = MPFROMP(PINSTMCISENDCOMMAND);                                     */
  348. /*                                                                         */
  349. /* Return mciSendCommand result.                                           */
  350. /***************************************************************************/
  351. #define IM_MCI_SEND_COMMAND         0x057C
  352.  
  353. typedef struct _INSTEAJOIN
  354.    {
  355.    CHAR achFileName[CCHMAXPATH];
  356.    CHAR achEAFileName[CCHMAXPATH];
  357.    } INSTEAJOIN;
  358.  
  359. typedef INSTEAJOIN *PINSTEAJOIN;
  360.  
  361. /***************************************************************************/
  362. /* IM_EA_JOIN                                                              */
  363. /*                                                                         */
  364. /* mp1 = 0;                ** Not used                                     */
  365. /* mp2 = MPFROMP(PINSTEAJOIN);                                             */
  366. /*                                                                         */
  367. /* Return EA join result.                                                  */
  368. /***************************************************************************/
  369. #define IM_EA_JOIN                  0x057D
  370.  
  371. typedef struct _INSTEALONGNAMEJOIN
  372.    {
  373.    CHAR achLongName[CCHMAXPATH];
  374.    CHAR achLongFileName[CCHMAXPATH];
  375.    CHAR achEALongFileName[CCHMAXPATH];
  376.    } INSTEALONGNAMEJOIN;
  377.  
  378. typedef INSTEALONGNAMEJOIN *PINSTEALONGNAMEJOIN;
  379.  
  380. /***************************************************************************/
  381. /* IM_EA_LONG_NAME_JOIN                                                    */
  382. /*                                                                         */
  383. /* mp1 = 0;                ** Not used                                     */
  384. /* mp2 = MPFROMP(PINSTEALONGNAMEJOIN);                                     */
  385. /*                                                                         */
  386. /* Return EA long name creation result.                                    */
  387. /***************************************************************************/
  388. #define IM_EA_LONG_NAME_JOIN                  0x0581
  389.                                                            /* feature 6302 */
  390. #define IM_QUERYPATH                          0x0582
  391.  
  392.  
  393. /***************************************************************************/
  394. /* IM_CODECINSTALL - Install a Codec-Proc                                  */
  395. /*                                                                         */
  396. /* mp1 = 0;                        ** Not used                             */
  397. /* mp2 = (PINSTCODECINIFILEINFO)&instioproc;                               */
  398. /*                                 ** pointer to the INSTIOPROC struct     */
  399. /*                                                            feature 5572 */
  400. /***************************************************************************/
  401. #define IM_CODEC1INSTALL                       0x0583
  402.                                                            /* feature 5572 */
  403. #define IM_CODEC2INSTALL                       0x0584
  404.                                                            /* feature 5572 */
  405.  
  406. #ifndef NO_ERROR
  407. #define NO_ERROR 0
  408. #endif
  409.  
  410. #define CFGERR_BASE                    0xFF00
  411. #define CFGERR_START                   (CFGERR_BASE + 1)
  412.  
  413. #define CFGERR_OPENFAILED              (CFGERR_START +  1)
  414. #define CFGERR_OUTOFMEMORY             (CFGERR_START +  2)
  415. #define CFGERR_INVALIDPARAMETER        (CFGERR_START +  3)
  416. #define CFGERR_INVALIDENUMFLAG         (CFGERR_START +  4)
  417. #define CFGERR_ATTOP                   (CFGERR_START +  5)
  418. #define CFGERR_ATBOTTOM                (CFGERR_START +  6)
  419. #define CFGERR_BUFFEROVERFLOW          (CFGERR_START +  7)
  420. #define CFGERR_LINENOTFOUND            (CFGERR_START +  8)
  421. #define CFGERR_CANTPARSEBUFFER         (CFGERR_START +  9)
  422. #define CFGERR_VARIABLENOTFOUND        (CFGERR_START + 10)
  423.  
  424. /* Line positions */
  425. #define CONFIG_TOP      -1
  426. #define CONFIG_BOTTOM   -2
  427. #define CONFIG_NEXT     -3
  428. #define CONFIG_PREV     -4
  429. #define CONFIG_CURRENT  -5
  430.  
  431. /* XLATOFF */
  432. #pragma pack( )
  433. /* XLATON */
  434.  
  435. #endif /* #ifndef __MINSTALL_H_ */
  436.  
  437.