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