[2] | 1 | //
|
---|
| 2 | // MINSTALL.DLL (c) Copyright 2002-2005 Martin Kiewitz
|
---|
| 3 | //
|
---|
| 4 | // This file is part of MINSTALL.DLL for OS/2 / eComStation
|
---|
| 5 | //
|
---|
| 6 | // MINSTALL.DLL is free software: you can redistribute it and/or modify
|
---|
| 7 | // it under the terms of the GNU General Public License as published by
|
---|
| 8 | // the Free Software Foundation, either version 3 of the License, or
|
---|
| 9 | // (at your option) any later version.
|
---|
| 10 | //
|
---|
| 11 | // MINSTALL.DLL is distributed in the hope that it will be useful,
|
---|
| 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 14 | // GNU General Public License for more details.
|
---|
| 15 | //
|
---|
| 16 | // You should have received a copy of the GNU General Public License
|
---|
| 17 | // along with MINSTALL.DLL. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 18 | //
|
---|
| 19 |
|
---|
| 20 | #define INCL_NOPMAPI
|
---|
| 21 | #define INCL_BASE
|
---|
| 22 | #define INCL_DOSMODULEMGR
|
---|
| 23 | // #define INCL_OS2MM
|
---|
| 24 | // #define INCL_MMIO_CODEC
|
---|
| 25 | // #define INCL_AUDIO_CODEC_ONLY
|
---|
| 26 | #include <os2.h>
|
---|
| 27 | // #include <os2me.h>
|
---|
| 28 | #include <malloc.h>
|
---|
| 29 |
|
---|
| 30 | #include <global.h>
|
---|
| 31 | #include <cfgsys.h> // CONFIG.SYS Changing
|
---|
| 32 | #include <crcs.h>
|
---|
| 33 | #include <file.h>
|
---|
| 34 | #include <globstr.h>
|
---|
| 35 | #include <msg.h>
|
---|
| 36 | #include <mmi_public.h>
|
---|
| 37 | #include <mmi_types.h>
|
---|
| 38 | #include <mmi_main.h>
|
---|
| 39 | #include <mmi_helper.h>
|
---|
| 40 | #include <mmi_msg.h>
|
---|
| 41 | #include <mmi_inistuff.h>
|
---|
| 42 |
|
---|
| 43 | BOOL MINSTALL_LoadConfigControlFile (PMINSTFILE ScriptFilePtr) {
|
---|
| 44 | ULONG ConfigEntryCount = 0;
|
---|
| 45 | PCHAR CurPos = 0;
|
---|
| 46 | PCHAR EndPos = 0;
|
---|
| 47 | PCHAR LineStartPos = 0;
|
---|
| 48 | PCHAR LineEndPos = 0;
|
---|
| 49 | CHAR CurChar = 0;
|
---|
| 50 | ULONG Temp = 0;
|
---|
| 51 | PCHAR CommandSpacePtr = 0;
|
---|
| 52 | PCONFIGSYSACTION ConfigEntryArrayPtr = 0;
|
---|
| 53 | PCONFIGSYSACTION CurConfigEntry = 0;
|
---|
| 54 | PCONFIGSYSACTSTR ConfigStringArrayPtr = 0;
|
---|
| 55 | PCONFIGSYSACTSTR CurConfigString = 0;
|
---|
| 56 | PMINSTDIR CurDirPtr = 0;
|
---|
| 57 | ULONG CommandID1 = 0;
|
---|
| 58 | ULONG CommandID2 = 0;
|
---|
| 59 | PCHAR ValueSpacePtr = 0;
|
---|
| 60 | PCHAR TempPtr = 0;
|
---|
| 61 | ULONG ActionID = 0;
|
---|
| 62 | ULONG CurLineNo = 1;
|
---|
| 63 |
|
---|
| 64 | // Get Full-Qualified Script Name
|
---|
| 65 | if (!STRING_CombinePSZ (CHANGESCR.Name, MINSTMAX_PATHLENGTH, ScriptFilePtr->SourcePtr->FQName, ScriptFilePtr->Name))
|
---|
| 66 | return FALSE;
|
---|
| 67 | if (!FILE_LoadFileControl(&CHANGESCR, 131767)) {
|
---|
| 68 | MSG_SetInsertViaPSZ (1, CHANGESCR.Name);
|
---|
| 69 | MINSTALL_TrappedError (MINSTMSG_CouldNotLoad);
|
---|
| 70 | return FALSE;
|
---|
| 71 | }
|
---|
| 72 | FILE_PreProcessControlFile(&CHANGESCR);
|
---|
| 73 | ConfigEntryCount = FILE_CountControlFileLines (&CHANGESCR);
|
---|
| 74 | if (ConfigEntryCount==0) {
|
---|
| 75 | FILE_UnLoadFileControl(&CHANGESCR);
|
---|
| 76 | return TRUE; // No entries, so success
|
---|
| 77 | }
|
---|
| 78 |
|
---|
| 79 | // Now allocate memory for those entries...
|
---|
| 80 | ConfigEntryArrayPtr = malloc(ConfigEntryCount*CONFIGSYSACTION_Length);
|
---|
| 81 | if (!ConfigEntryArrayPtr) {
|
---|
| 82 | FILE_UnLoadFileControl(&CHANGESCR);
|
---|
| 83 | MINSTALL_TrappedError (MINSTMSG_OutOfMemory); return FALSE; // OutOfMemory
|
---|
| 84 | }
|
---|
| 85 | ConfigStringArrayPtr = malloc(ConfigEntryCount*CONFIGSYSACTSTR_Length);
|
---|
| 86 | if (!ConfigStringArrayPtr) {
|
---|
| 87 | free (ConfigEntryArrayPtr);
|
---|
| 88 | FILE_UnLoadFileControl(&CHANGESCR);
|
---|
| 89 | MINSTALL_TrappedError (MINSTMSG_OutOfMemory); return FALSE; // OutOfMemory
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | // NUL out both arrays...
|
---|
| 93 | memset (ConfigEntryArrayPtr, 0, ConfigEntryCount*sizeof(CONFIGSYSACTION));
|
---|
| 94 | memset (ConfigStringArrayPtr, 0, ConfigEntryCount*sizeof(CONFIGSYSACTSTR));
|
---|
| 95 |
|
---|
| 96 | // Now extract all entries one-by-one. Known are:
|
---|
| 97 | // "MERGE" - only used on SET lines,
|
---|
| 98 | // may include a numeric digit, which specifies the directory
|
---|
| 99 | // "REPLACE" - will replace a line, if it already got found. Otherwise
|
---|
| 100 | // the line will get added
|
---|
| 101 | // 05062004 - If a path is specified, Action is 'REPLACE' and
|
---|
| 102 | // the command is 'SET', add ';' to the end.
|
---|
| 103 | // It's done by original minstall and needed for
|
---|
| 104 | // compatibility.
|
---|
| 105 | // "DEVICE" - will add that line
|
---|
| 106 |
|
---|
| 107 | ConfigEntryCount = 0;
|
---|
| 108 | CurPos = CHANGESCR.BufferPtr; EndPos = CHANGESCR.BufferEndPtr;
|
---|
| 109 | CurConfigEntry = ConfigEntryArrayPtr;
|
---|
| 110 | CurConfigString = ConfigStringArrayPtr;
|
---|
| 111 | while (CurPos<EndPos) {
|
---|
| 112 | if (!(CurChar = STRING_GetValidChar(&CurPos, EndPos, &CurLineNo)))
|
---|
| 113 | break;
|
---|
| 114 | LineStartPos = CurPos;
|
---|
| 115 | LineEndPos = STRING_GetEndOfLinePtr (CurPos, EndPos);
|
---|
| 116 |
|
---|
| 117 | while ((CurPos<LineEndPos) && (*CurPos!=0x20) && (*CurPos!=0x3D)) {
|
---|
| 118 | *CurPos = toupper(*CurPos); // Uppercase...
|
---|
| 119 | CurPos++; // Search for space or '='
|
---|
| 120 | }
|
---|
| 121 | ActionID = CRC32_GetFromString (LineStartPos, CurPos-LineStartPos);
|
---|
| 122 |
|
---|
| 123 | if ((CurChar = STRING_GetValidChar(&CurPos, EndPos, &CurLineNo))!='=') {
|
---|
| 124 | // Read in Command/Specifier into TempBuffer...
|
---|
| 125 | CurPos = STRING_GetString(CurConfigString->CommandStr, CONFIGSYSACTSTR_MAXLENGTH, CurPos, LineEndPos);
|
---|
| 126 | CommandSpacePtr = (PCHAR)CurConfigString->CommandStr;
|
---|
| 127 | while (*CommandSpacePtr!=0x20) { // Find 1st space in HelpBuffer
|
---|
| 128 | if (*CommandSpacePtr==0x00) {
|
---|
| 129 | CommandSpacePtr = 0; break;
|
---|
| 130 | }
|
---|
| 131 | CommandSpacePtr++;
|
---|
| 132 | }
|
---|
| 133 | CurChar = STRING_GetValidChar(&CurPos, EndPos, &CurLineNo);
|
---|
| 134 | } else {
|
---|
| 135 | CommandSpacePtr = 0;
|
---|
| 136 | }
|
---|
| 137 | CurPos++;
|
---|
| 138 |
|
---|
| 139 | if (CurPos>=LineEndPos) {
|
---|
| 140 | MINSTALL_ErrorMsgID = MINSTMSG_UnexpectedEndOfLine; break; }
|
---|
| 141 |
|
---|
| 142 | if (CurChar!='=') {
|
---|
| 143 | MINSTALL_ErrorMsgID = MINSTMSG_ValueExpected; break; }
|
---|
| 144 |
|
---|
| 145 | if (ActionID==0xF9D77108) {
|
---|
| 146 | /* We have to check this earlier, because we put command 'DEVICE' */
|
---|
| 147 | /* and that one is needed because we get CommandID1/2 now instead of */
|
---|
| 148 | /* later. */
|
---|
| 149 | if (CurConfigString->CommandStr[0]!=0) MINSTALL_TrappedError (MINSTMSG_NoConfigCommandExpected);
|
---|
| 150 | strcpy (CurConfigString->CommandStr, "DEVICE");
|
---|
| 151 | }
|
---|
| 152 |
|
---|
| 153 | if (CommandSpacePtr) {
|
---|
| 154 | // We got a space in the Command, so we take 2 CommandIDs
|
---|
| 155 | CommandID1 = CRC32_GetFromString(CurConfigString->CommandStr,CommandSpacePtr-CurConfigString->CommandStr);
|
---|
| 156 | CommandID2 = CRC32_GetFromPSZ(CommandSpacePtr+1);
|
---|
| 157 | } else {
|
---|
| 158 | CommandID1 = CRC32_GetFromPSZ(CurConfigString->CommandStr);
|
---|
| 159 | CommandID2 = 0;
|
---|
| 160 | }
|
---|
| 161 |
|
---|
| 162 | CurChar = STRING_GetValidChar(&CurPos, EndPos, &CurLineNo);
|
---|
| 163 | if (CurChar=='"') {
|
---|
| 164 | // String-Delimiter, so we assume string and extract (w macros)
|
---|
| 165 | if (!(CurPos = MINSTALL_GetMacrodString((PCHAR)CurConfigString->ValueStr, MINSTMAX_PATHLENGTH, CurPos, LineEndPos)))
|
---|
| 166 | break; // Error during macro processing
|
---|
| 167 | } else {
|
---|
| 168 | if (!(CurPos = STRING_GetNumericValue(&Temp, CurPos, LineEndPos)))
|
---|
| 169 | break; // Error during value extract
|
---|
| 170 | CurDirPtr = MINSTALL_SearchDestinDirID (Temp);
|
---|
| 171 | if (CurDirPtr) {
|
---|
| 172 | strcpy (CurConfigString->ValueStr, CurDirPtr->FQName);
|
---|
| 173 | Temp = strlen(CurConfigString->ValueStr);
|
---|
| 174 | if (Temp>0) Temp--;
|
---|
| 175 | if ((ActionID==0x33D8DA5F) && (CommandID1==0x70B36756)) {
|
---|
| 176 | // If Action is 'REPLACE' and Command is 'SET'
|
---|
| 177 | // Add a ';' here for compatibility reasons (05062004)
|
---|
| 178 | CurConfigString->ValueStr[Temp] = ';';
|
---|
| 179 | } else {
|
---|
| 180 | // cut last char (which is a '\')
|
---|
| 181 | CurConfigString->ValueStr[Temp] = 0;
|
---|
| 182 | }
|
---|
| 183 | } else {
|
---|
| 184 | MINSTALL_ErrorMsgID = MINSTMSG_UnknownDestinID; break;
|
---|
| 185 | }
|
---|
| 186 | }
|
---|
| 187 |
|
---|
| 188 | switch (ActionID) {
|
---|
| 189 | case 0x33D8DA5F: // REPLACE, expects HelpBuffer
|
---|
| 190 | if (CurConfigString->CommandStr[0]==0) MINSTALL_TrappedError (MINSTMSG_ConfigCommandExpected);
|
---|
| 191 | break;
|
---|
| 192 | case 0x1C3D55E9: // MERGE, expects HelpBuffer
|
---|
| 193 | if (CurConfigString->CommandStr[0]==0) MINSTALL_TrappedError (MINSTMSG_ConfigCommandExpected);
|
---|
| 194 | CurConfigEntry->Flags |= CONFIGSYSACTION_Flags_Merge;
|
---|
| 195 | break;
|
---|
| 196 | case 0xF9D77108: // DEVICE, expects NO HelpBuffer
|
---|
| 197 | /* CommandStr should now be 'DEVICE' and is checked earlier for Error */
|
---|
| 198 | /* if (CurConfigString->CommandStr[0]!=0) MINSTALL_TrappedError (MINSTMSG_NoConfigCommandExpected); */
|
---|
| 199 | /* strcpy (CurConfigString->CommandStr, "DEVICE"); */
|
---|
| 200 | CurConfigEntry->Flags |= CONFIGSYSACTION_Flags_MatchOnFilename;
|
---|
| 201 | break;
|
---|
| 202 | default:
|
---|
| 203 | // We got something unknown...
|
---|
| 204 | MINSTALL_ErrorMsgID = MINSTMSG_BadCommand; break;
|
---|
| 205 | }
|
---|
| 206 |
|
---|
| 207 | switch (CommandID1) {
|
---|
| 208 | case 0xC6D1E64A: // RUN
|
---|
| 209 | case 0xF9D77108: // DEVICE
|
---|
| 210 | case 0x2110156E: // BASEDEV
|
---|
| 211 | break;
|
---|
| 212 | case 0x70B36756: // SET
|
---|
| 213 | if (CommandID2==0x8262959) // LIBPATH -> strip "SET"
|
---|
| 214 | strcpy (CurConfigString->CommandStr, CommandSpacePtr+1);
|
---|
| 215 | break;
|
---|
| 216 | default:
|
---|
| 217 | MINSTALL_ErrorMsgID = MINSTMSG_BadConfigCommand; break;
|
---|
| 218 | }
|
---|
| 219 | if (MINSTALL_ErrorMsgID) break;
|
---|
| 220 |
|
---|
| 221 | // If no error found, add this entry...
|
---|
| 222 | ValueSpacePtr = CurConfigString->ValueStr;
|
---|
| 223 | while (*ValueSpacePtr!=0) {
|
---|
| 224 | if (*ValueSpacePtr==0x20) // If space found
|
---|
| 225 | break;
|
---|
| 226 | ValueSpacePtr++;
|
---|
| 227 | }
|
---|
| 228 | switch (CommandID1) {
|
---|
| 229 | case 0xC6D1E64A: // RUN
|
---|
| 230 | case 0xF9D77108: // DEVICE
|
---|
| 231 | case 0x2110156E: // BASEDEV
|
---|
| 232 | if (ActionID==0xF9D77108) { // DEVICE
|
---|
| 233 | // Match only on filename...
|
---|
| 234 | TempPtr = ValueSpacePtr;
|
---|
| 235 | while (TempPtr>CurConfigString->ValueStr) {
|
---|
| 236 | if (*TempPtr==0x5C) {
|
---|
| 237 | TempPtr++;
|
---|
| 238 | break;
|
---|
| 239 | }
|
---|
| 240 | TempPtr--; // Search backwards for '\'
|
---|
| 241 | }
|
---|
| 242 | strncpy (CurConfigString->MatchStr, TempPtr, ValueSpacePtr-TempPtr);
|
---|
| 243 | } else {
|
---|
| 244 | // full qualified filename is match string...
|
---|
| 245 | strncpy (CurConfigString->MatchStr, CurConfigString->ValueStr, ValueSpacePtr-CurConfigString->ValueStr);
|
---|
| 246 | }
|
---|
| 247 | }
|
---|
| 248 | MINSTLOG_ToFile ("Command \"%s\", Match-Onto \"%s\" (Flags %X)\n", CurConfigString->CommandStr, CurConfigString->MatchStr, CurConfigEntry->Flags);
|
---|
| 249 | MINSTLOG_ToFile (" Add/Merge in \"%s\"\n", CurConfigString->ValueStr);
|
---|
| 250 | CurConfigString->MatchInLineStr[0] = 0;
|
---|
| 251 | CurConfigEntry->CommandStrPtr = CurConfigString->CommandStr;
|
---|
| 252 | CurConfigEntry->MatchStrPtr = CurConfigString->MatchStr;
|
---|
| 253 | CurConfigEntry->MatchInLineStrPtr = CurConfigString->MatchInLineStr;
|
---|
| 254 | CurConfigEntry->ValueStrPtr = CurConfigString->ValueStr;
|
---|
| 255 | ConfigEntryCount++; CurConfigEntry++; CurConfigString++;
|
---|
| 256 |
|
---|
| 257 | CurPos = LineEndPos+1; CurLineNo++;
|
---|
| 258 | }
|
---|
| 259 |
|
---|
| 260 | // Put that Array&Count into ConfigChange-Queue...
|
---|
| 261 | ScriptFilePtr->GroupPtr->ConfigChangeArray = ConfigEntryArrayPtr;
|
---|
| 262 | ScriptFilePtr->GroupPtr->ConfigStringArray = ConfigStringArrayPtr;
|
---|
| 263 | ScriptFilePtr->GroupPtr->ConfigChangeCount = ConfigEntryCount;
|
---|
| 264 |
|
---|
| 265 | // Remove that file from memory...
|
---|
| 266 | FILE_UnLoadFileControl(&CHANGESCR);
|
---|
| 267 |
|
---|
| 268 | // We didn't find anything?
|
---|
| 269 | if (ConfigEntryCount==0)
|
---|
| 270 | MINSTALL_ErrorMsgID = MINSTMSG_UnexpectedEndOfFile;
|
---|
| 271 |
|
---|
| 272 | if (MINSTALL_ErrorMsgID) { // If Error-found during parsing...
|
---|
| 273 | MSG_SetInsertFileLocation (1, CHANGESCR.Name, CurLineNo);
|
---|
| 274 | MINSTALL_TrappedError (MINSTALL_ErrorMsgID);
|
---|
| 275 | return FALSE;
|
---|
| 276 | }
|
---|
| 277 | return TRUE;
|
---|
| 278 | }
|
---|
| 279 |
|
---|
| 280 | // ****************************************************************************
|
---|
| 281 |
|
---|
| 282 | //
|
---|
| 283 | ULONG MINSTALL_GetNextINIFuncID (PCHAR *CurPosPtr, PCHAR EndPos, PULONG CurLineNoPtr) {
|
---|
| 284 | PCHAR CurPos = *CurPosPtr;
|
---|
| 285 | PCHAR StartPos = 0;
|
---|
| 286 | ULONG FunctionID = 0;
|
---|
| 287 | CHAR CurChar;
|
---|
| 288 |
|
---|
| 289 | if (!(CurChar = STRING_GetValidChar(&CurPos, EndPos, CurLineNoPtr))) {
|
---|
| 290 | *CurPosPtr = CurPos; return 0; // No more valid chars...
|
---|
| 291 | }
|
---|
| 292 |
|
---|
| 293 | StartPos = CurPos;
|
---|
| 294 | while (CurPos<EndPos) {
|
---|
| 295 | CurChar = *CurPos; *CurPos = toupper(CurChar);
|
---|
| 296 | if ((CurChar==0x0D) || (CurChar==' ') || (CurChar=='[') || (CurChar=='=')) {
|
---|
| 297 | FunctionID = CRC32_GetFromString(StartPos, CurPos-StartPos);
|
---|
| 298 | *CurPosPtr = CurPos;
|
---|
| 299 | // Now check that we got "=" and "(" afterwards...
|
---|
| 300 | if (STRING_GetValidChar (CurPosPtr, EndPos, CurLineNoPtr)!='=') {
|
---|
| 301 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; return 0;
|
---|
| 302 | }
|
---|
| 303 | *CurPosPtr += 1;
|
---|
| 304 | if (STRING_GetValidChar (CurPosPtr, EndPos, CurLineNoPtr)!='(') {
|
---|
| 305 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; return 0;
|
---|
| 306 | }
|
---|
| 307 | *CurPosPtr += 1;
|
---|
| 308 | // CHECK Function for validity...
|
---|
| 309 | if (ICF_CheckFuncList) {
|
---|
| 310 | // Lookup Function-Name in FuncList, issue error if not found
|
---|
| 311 | ICF_CurFuncEntry = ICF_CheckFuncList;
|
---|
| 312 | while (FunctionID!=ICF_CurFuncEntry->ID) {
|
---|
| 313 | if (!ICF_CurFuncEntry->ID) {
|
---|
| 314 | MINSTALL_ErrorMsgID = MINSTMSG_ICUnknownFunction; return 0;
|
---|
| 315 | }
|
---|
| 316 | ICF_CurFuncEntry++;
|
---|
| 317 | }
|
---|
| 318 | ICF_CheckParmList = (PMINSTINI_DEFENTRY)ICF_CurFuncEntry->ParmListPtr;
|
---|
| 319 | ICF_FilledParms = 0; // No parms currently filled out...
|
---|
| 320 | }
|
---|
| 321 | return FunctionID;
|
---|
| 322 | }
|
---|
| 323 | CurPos++;
|
---|
| 324 | }
|
---|
| 325 | *CurPosPtr = CurPos; // Experienced End-Of-Buffer
|
---|
| 326 | return 0;
|
---|
| 327 | }
|
---|
| 328 |
|
---|
| 329 | ULONG MINSTALL_GetNextINIParmID (PCHAR *CurPosPtr, PCHAR EndPos, PULONG CurLineNoPtr, PLONG ArrayCountPtr) {
|
---|
| 330 | PCHAR CurPos = *CurPosPtr;
|
---|
| 331 | PCHAR StartPos = 0;
|
---|
| 332 | ULONG ParamID = 0;
|
---|
| 333 | CHAR CurChar;
|
---|
| 334 | ULONG ParamBit = 0;
|
---|
| 335 |
|
---|
| 336 | if (!(CurChar = STRING_GetValidChar(&CurPos, EndPos, CurLineNoPtr))) {
|
---|
| 337 | *CurPosPtr = CurPos; // No more valid chars...
|
---|
| 338 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; return 0;
|
---|
| 339 | }
|
---|
| 340 |
|
---|
| 341 | if (CurChar==')') {
|
---|
| 342 | *CurPosPtr = CurPos+1;
|
---|
| 343 | STRING_GetValidChar (CurPosPtr, EndPos, CurLineNoPtr);
|
---|
| 344 | return 0; // Signals End-Of-Param-List
|
---|
| 345 | }
|
---|
| 346 |
|
---|
| 347 | StartPos = CurPos;
|
---|
| 348 | while (CurPos<EndPos) {
|
---|
| 349 | *CurPos = toupper(CurChar);
|
---|
| 350 | if ((CurChar==0x0D) || (CurChar==' ') || (CurChar=='[') || (CurChar=='=')) {
|
---|
| 351 | ParamID = CRC32_GetFromString(StartPos, CurPos-StartPos);
|
---|
| 352 | *CurPosPtr = CurPos;
|
---|
| 353 | if (!(CurChar = STRING_GetValidChar(CurPosPtr, EndPos, CurLineNoPtr))) {
|
---|
| 354 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; return 0;
|
---|
| 355 | }
|
---|
| 356 | if (CurChar=='[') {
|
---|
| 357 | // We got an array here...
|
---|
| 358 | *CurPosPtr += 1;
|
---|
| 359 | if (!(*CurPosPtr = STRING_GetNumericValue ((PULONG)ArrayCountPtr, *CurPosPtr, EndPos))) {
|
---|
| 360 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadArray; return 0;
|
---|
| 361 | }
|
---|
| 362 | if (**CurPosPtr!=']') {
|
---|
| 363 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadArray; return 0;
|
---|
| 364 | }
|
---|
| 365 | *CurPosPtr += 1;
|
---|
| 366 | if (STRING_GetValidChar(CurPosPtr, EndPos, CurLineNoPtr)!='=') {
|
---|
| 367 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; return 0;
|
---|
| 368 | }
|
---|
| 369 | *CurPosPtr += 1;
|
---|
| 370 | if (STRING_GetValidChar(CurPosPtr, EndPos, CurLineNoPtr)!='(') {
|
---|
| 371 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; return 0;
|
---|
| 372 | }
|
---|
| 373 | } else if (CurChar!='=') {
|
---|
| 374 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; return 0;
|
---|
| 375 | } else {
|
---|
| 376 | *ArrayCountPtr = -1;
|
---|
| 377 | }
|
---|
| 378 | // CHECK Parameter for validity...
|
---|
| 379 | if (ICF_CheckParmList) {
|
---|
| 380 | // Lookup Parameter-Name in ParmList, issue error if not found
|
---|
| 381 | ICF_CurParmEntry = ICF_CheckParmList; ParamBit = 1;
|
---|
| 382 | while (ParamID!=ICF_CurParmEntry->ID) {
|
---|
| 383 | if (!ICF_CurParmEntry->ID) {
|
---|
| 384 | MINSTALL_ErrorMsgID = MINSTMSG_ICUnknownParameter; return 0;
|
---|
| 385 | }
|
---|
| 386 | ICF_CurParmEntry++; ParamBit <<= 1;
|
---|
| 387 | }
|
---|
| 388 | if (ParamBit & ICF_FilledParms) {
|
---|
| 389 | MSG_SetInsertViaPSZ (2, ICF_CurParmEntry->Name);
|
---|
| 390 | MINSTALL_ErrorMsgID = MINSTMSG_ICDuplicateParameter; return 0;
|
---|
| 391 | }
|
---|
| 392 | ICF_FilledParms |= ParamBit; // Got that parameter...
|
---|
| 393 | // CHECK Array descriptor...
|
---|
| 394 | if (*ArrayCountPtr==-1) { // <-- Array got not specified
|
---|
| 395 | if (ICF_CurParmEntry->MaxSize!=0) {
|
---|
| 396 | MSG_SetInsertViaPSZ (2, ICF_CurParmEntry->Name);
|
---|
| 397 | MINSTALL_ErrorMsgID = MINSTMSG_ICParameterIsArray; return 0;
|
---|
| 398 | }
|
---|
| 399 | } else { // <-- Array got specified
|
---|
| 400 | if (ICF_CurParmEntry->MaxSize==0) {
|
---|
| 401 | MSG_SetInsertViaPSZ (2, ICF_CurParmEntry->Name);
|
---|
| 402 | MINSTALL_ErrorMsgID = MINSTMSG_ICParameterNotArray; return 0;
|
---|
| 403 | }
|
---|
| 404 | if (ICF_CurParmEntry->MaxSize<*ArrayCountPtr) {
|
---|
| 405 | MSG_SetInsertViaPSZ (2, ICF_CurParmEntry->Name);
|
---|
| 406 | MINSTALL_ErrorMsgID = MINSTMSG_ICArrayTooBig; return 0;
|
---|
| 407 | }
|
---|
| 408 | }
|
---|
| 409 | }
|
---|
| 410 | *CurPosPtr += 1;
|
---|
| 411 | // Now seek to next valid char...
|
---|
| 412 | if (!STRING_GetValidChar(CurPosPtr, EndPos, CurLineNoPtr)) {
|
---|
| 413 | MINSTALL_ErrorMsgID = MINSTMSG_UnexpectedEndOfFile; return 0; }
|
---|
| 414 | return ParamID;
|
---|
| 415 | }
|
---|
| 416 | CurPos++; CurChar = *CurPos;
|
---|
| 417 | }
|
---|
| 418 | *CurPosPtr = CurPos; // Experienced End-Of-Buffer
|
---|
| 419 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure;
|
---|
| 420 | return 0;
|
---|
| 421 | }
|
---|
| 422 |
|
---|
| 423 | // CurLineNo is transferred for Warning-logging
|
---|
| 424 | BOOL MINSTALL_CheckForMissingINIParms (ULONG CurLineNo) {
|
---|
| 425 | ULONG ParamBit = 1;
|
---|
| 426 |
|
---|
| 427 | if (ICF_CheckParmList) {
|
---|
| 428 | // Check, if all parameters were set...
|
---|
| 429 | ICF_CurParmEntry = ICF_CheckParmList;
|
---|
| 430 | while (ICF_CurParmEntry->ID) {
|
---|
| 431 | if (!(ParamBit & ICF_FilledParms)) {
|
---|
| 432 | MSG_SetInsertViaPSZ (2, ICF_CurParmEntry->Name);
|
---|
| 433 | if (ICF_CurParmEntry->Mandatory==TRUE) {
|
---|
| 434 | MINSTALL_ErrorMsgID = MINSTMSG_ICMissingParameter; return TRUE;
|
---|
| 435 | } else {
|
---|
| 436 | MSG_SetInsertFileLocation (1, CHANGESCR.Name, CurLineNo);
|
---|
| 437 | MINSTALL_TrappedWarning (MINSTMSG_ICMissingParameterWarning);
|
---|
| 438 | }
|
---|
| 439 | }
|
---|
| 440 | ICF_CurParmEntry++; ParamBit <<= 1;
|
---|
| 441 | }
|
---|
| 442 | }
|
---|
| 443 | return FALSE;
|
---|
| 444 | }
|
---|
| 445 |
|
---|
| 446 | BOOL MINSTALL_LoadINIControlFile (PMINSTFILE ScriptFilePtr) {
|
---|
| 447 | ULONG ConfigEntryCount = 0;
|
---|
| 448 | PCHAR CurPos = 0;
|
---|
| 449 | PCHAR StartPos = 0;
|
---|
| 450 | PCHAR EndPos = 0;
|
---|
| 451 | PCHAR LineStartPos = 0;
|
---|
| 452 | PCHAR LineEndPos = 0;
|
---|
| 453 | CHAR CurChar = 0;
|
---|
| 454 | ULONG Temp = 0;
|
---|
| 455 | ULONG FunctionID = 0;
|
---|
| 456 | ULONG ParamID = 0;
|
---|
| 457 | ULONG CurLineNo = 1;
|
---|
| 458 | ULONG RequiredSpace = 0;
|
---|
| 459 | LONG ArrayCount = -1;
|
---|
| 460 | ULONG CurArray = 0;
|
---|
| 461 | ULONG ArrayTotal = 0;
|
---|
| 462 |
|
---|
| 463 | PVOID INIChange1stEntryPtr = 0;
|
---|
| 464 | ULONG INIChangeCount = 0;
|
---|
| 465 | PMINSTINIHEADER INIChangeEntryPtr = 0; // <-- Current Entry
|
---|
| 466 | PMINSTINIHEADER INIChangeLastEntryPtr = 0;
|
---|
| 467 |
|
---|
| 468 | ULONG MainFilledParms = 0; // <-- helper for array processing
|
---|
| 469 | PMINSTINI_DEFENTRY MainCheckParmList = NULL;
|
---|
| 470 |
|
---|
| 471 | CHAR TempBuffer[MINSTMAX_PATHLENGTH]; // Temporary buffer
|
---|
| 472 | ULONG TempULong;
|
---|
| 473 | ULONG TmpNo;
|
---|
| 474 |
|
---|
| 475 | // Get Full-Qualified Script Name
|
---|
| 476 | if (!STRING_CombinePSZ (CHANGESCR.Name, MINSTMAX_PATHLENGTH, ScriptFilePtr->SourcePtr->FQName, ScriptFilePtr->Name))
|
---|
| 477 | return FALSE;
|
---|
| 478 | if (!FILE_LoadFileControl(&CHANGESCR, 131767)) {
|
---|
| 479 | MSG_SetInsertViaPSZ (1, CHANGESCR.Name);
|
---|
| 480 | MINSTALL_TrappedError (MINSTMSG_CouldNotLoad);
|
---|
| 481 | return FALSE;
|
---|
| 482 | }
|
---|
| 483 | FILE_PreProcessControlFile(&CHANGESCR);
|
---|
| 484 |
|
---|
| 485 | // Switch on Function-Name checking...
|
---|
| 486 | ICF_CheckFuncList = MINSTINI_FuncList;
|
---|
| 487 |
|
---|
| 488 | // Now we are doing the REAL read-in...
|
---|
| 489 | // This is MUCH MUCH code, but the damn IBM Linker didnt want to compile my
|
---|
| 490 | // structure-based stuff, so I needed to do it the hardcoded way :(
|
---|
| 491 |
|
---|
| 492 | CurLineNo = 1; INIChangeCount = 0;
|
---|
| 493 | CurPos = CHANGESCR.BufferPtr; EndPos = CHANGESCR.BufferEndPtr;
|
---|
| 494 | while (CurPos<EndPos) {
|
---|
| 495 | if (!(FunctionID = MINSTALL_GetNextINIFuncID (&CurPos, EndPos, &CurLineNo)))
|
---|
| 496 | break; // End reached
|
---|
| 497 |
|
---|
| 498 | // We got a function, so allocate a memory-block for it...
|
---|
| 499 | if (!(INIChangeEntryPtr = malloc(ICF_CurFuncEntry->MaxSize))) {
|
---|
| 500 | MINSTALL_TrappedError (MINSTMSG_OutOfMemory); break; }
|
---|
| 501 | if (!INIChangeLastEntryPtr) {
|
---|
| 502 | INIChange1stEntryPtr = INIChangeEntryPtr;
|
---|
| 503 | } else {
|
---|
| 504 | INIChangeLastEntryPtr->NextPtr = INIChangeEntryPtr;
|
---|
| 505 | }
|
---|
| 506 | INIChangeLastEntryPtr = INIChangeEntryPtr;
|
---|
| 507 |
|
---|
| 508 | // Reset structure and set INI Header
|
---|
| 509 | memset (INIChangeEntryPtr, 0, ICF_CurFuncEntry->MaxSize);
|
---|
| 510 | INIChangeEntryPtr->ID = FunctionID;
|
---|
| 511 | INIChangeEntryPtr->Size = ICF_CurFuncEntry->MaxSize;
|
---|
| 512 |
|
---|
| 513 | // We have now switched the parm-list, process Parameters now...
|
---|
| 514 | switch (FunctionID) {
|
---|
| 515 | case EA_JOINEA_ID: // ==================== EA - JoinEA
|
---|
| 516 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 517 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 518 | break;
|
---|
| 519 | // JoinFileName/JoinEAFileName
|
---|
| 520 | switch (ParamID) {
|
---|
| 521 | case 0x0FD42A68: CurPos = MINSTALL_GetMacrodString(((PEA_JOINEA)INIChangeEntryPtr)->JoinFileName, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 522 | case 0xDF5CDE5B: CurPos = MINSTALL_GetMacrodString(((PEA_JOINEA)INIChangeEntryPtr)->JoinEAFileName, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 523 | }
|
---|
| 524 | }
|
---|
| 525 | break;
|
---|
| 526 | case EA_JOINLONGNAMEEA_ID: // ============ EA - JoinLongNameEA
|
---|
| 527 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 528 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 529 | break;
|
---|
| 530 | // JoinLongName/JoinLongFileName/JoinEALongFileName
|
---|
| 531 | switch (ParamID) {
|
---|
| 532 | case 0xCACCF1F1: CurPos = MINSTALL_GetMacrodString(((PEA_JOINLONGNAMEEA)INIChangeEntryPtr)->JoinLongName, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 533 | case 0xD5C2CE0C: CurPos = MINSTALL_GetMacrodString(((PEA_JOINLONGNAMEEA)INIChangeEntryPtr)->JoinLongFileName, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 534 | case 0xF01882D8: CurPos = MINSTALL_GetMacrodString(((PEA_JOINLONGNAMEEA)INIChangeEntryPtr)->JoinEALongFileName, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 535 | }
|
---|
| 536 | }
|
---|
| 537 | break;
|
---|
| 538 | case MCI_MCIINSTALLDRV_ID: // ============ MCI - MciInstallDrv
|
---|
| 539 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 540 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 541 | break;
|
---|
| 542 | // DrvInstallName/DrvDeviceType/DrvDeviceFlag/DrvVersionNumber/
|
---|
| 543 | // DrvProductInfo/DrvMCDDriver/DrvVSDDriver/DrvPDDName/DrvMCDTable
|
---|
| 544 | // DrvVSDTable/DrvShareType/DrvResourceName/DrvClassArray
|
---|
| 545 | switch (ParamID) {
|
---|
| 546 | case 0xCAECA131: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->szInstallName, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 547 | case 0xF1558F48:
|
---|
| 548 | if (!(CurPos = MINSTALL_GetNumericValue(&TempULong, CurPos, EndPos)))
|
---|
| 549 | break;
|
---|
| 550 | ((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->usDeviceType = TempULong;
|
---|
| 551 | break;
|
---|
| 552 | case 0xAC7F33FB: CurPos = MINSTALL_GetNumericValue(&((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->ulDeviceFlag, CurPos, EndPos); break;
|
---|
| 553 | case 0xDD6E470A: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->szVersionNumber, MCIMAX_VERSIONLENGTH, CurPos, EndPos); break;
|
---|
| 554 | case 0xB377234D: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->szProductInfo, MCIMAX_PRODLENGTH, CurPos, EndPos); break;
|
---|
| 555 | case 0xB4BFB2C2: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->szMCDDriver, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 556 | case 0xE6915F45: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->szVSDDriver, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 557 | case 0xE8AB4FF7: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->szPDDName, MCIMAX_PDDNAMELENGTH, CurPos, EndPos); break;
|
---|
| 558 | case 0x2552FF41: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->szMCDTable, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 559 | case 0x635D4EF2: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->szVSDTable, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 560 | case 0xC5E91968:
|
---|
| 561 | if (!(CurPos = MINSTALL_GetNumericValue(&TempULong, CurPos, EndPos)))
|
---|
| 562 | break;
|
---|
| 563 | ((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->usShareType = TempULong;
|
---|
| 564 | break;
|
---|
| 565 | case 0x25A89CAF: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->szResourceName, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 566 | case 0x7DAFC42F:
|
---|
| 567 | if (!(CurPos = MINSTALL_GetNumericValue(&TempULong, CurPos, EndPos)))
|
---|
| 568 | break;
|
---|
| 569 | ((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->usResourceUnits = TempULong;
|
---|
| 570 | break;
|
---|
| 571 | case 0x924AB2E1: // DrvClassArray is ARRAY
|
---|
| 572 | // Safe current Main-ParmList and FilledParms...
|
---|
| 573 | MainFilledParms = ICF_FilledParms; MainCheckParmList = ICF_CheckParmList;
|
---|
| 574 | // Set to Array-specific ParmList...
|
---|
| 575 | ICF_CheckParmList = ICF_CurParmEntry->ParmListPtr;
|
---|
| 576 |
|
---|
| 577 | ((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->usResourceClasses = ArrayCount;
|
---|
| 578 | ArrayTotal = ArrayCount; CurArray = 0;
|
---|
| 579 | while ((CurArray<ArrayTotal) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 580 | if (*CurPos!='(') {
|
---|
| 581 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; break; }
|
---|
| 582 | CurPos++;
|
---|
| 583 | ICF_FilledParms = 0; // We dont have any Parms yet
|
---|
| 584 | while (CurPos<EndPos) {
|
---|
| 585 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 586 | break;
|
---|
| 587 | // DrvClassNumber (ARRAY!)
|
---|
| 588 | switch (ParamID) {
|
---|
| 589 | case 0x2FC58D01:
|
---|
| 590 | if (!(CurPos = MINSTALL_GetNumericValue(&TempULong, CurPos, EndPos)))
|
---|
| 591 | break;
|
---|
| 592 | ((PMCI_MCIINSTALLDRV)INIChangeEntryPtr)->ausClassArray[CurArray] = TempULong;
|
---|
| 593 | break;
|
---|
| 594 | }
|
---|
| 595 | if (MINSTALL_ErrorMsgID) break; // If any error occured...
|
---|
| 596 | }
|
---|
| 597 | if (MINSTALL_ErrorMsgID) break;
|
---|
| 598 | // Check, if array element had all parameters...
|
---|
| 599 | if (MINSTALL_CheckForMissingINIParms(CurLineNo)) break;
|
---|
| 600 | CurArray++;
|
---|
| 601 | }
|
---|
| 602 | if (MINSTALL_ErrorMsgID) break;
|
---|
| 603 | if (*CurPos!=')') {
|
---|
| 604 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; break; }
|
---|
| 605 | CurPos++;
|
---|
| 606 | // Now restore Main-ParmList and FilledParms...
|
---|
| 607 | ICF_FilledParms = MainFilledParms; ICF_CheckParmList = MainCheckParmList;
|
---|
| 608 | }
|
---|
| 609 | }
|
---|
| 610 | break;
|
---|
| 611 | case MCI_MCIINSTALLCONN_ID: // =========== MCI - MciInstallConn
|
---|
| 612 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 613 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 614 | break;
|
---|
| 615 | // ConnInstallName/ConnArray
|
---|
| 616 | switch (ParamID) {
|
---|
| 617 | case 0x7C9375DB: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLCONN)INIChangeEntryPtr)->szInstallName, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 618 | case 0x40B7450F: // ConnArray is ARRAY
|
---|
| 619 | // Safe current Main-ParmList and FilledParms...
|
---|
| 620 | MainFilledParms = ICF_FilledParms; MainCheckParmList = ICF_CheckParmList;
|
---|
| 621 | // Set to Array-specific ParmList...
|
---|
| 622 | ICF_CheckParmList = ICF_CurParmEntry->ParmListPtr;
|
---|
| 623 |
|
---|
| 624 | ((PMCI_MCIINSTALLCONN)INIChangeEntryPtr)->usNumConnectors = ArrayCount;
|
---|
| 625 | ArrayTotal = ArrayCount; CurArray = 0;
|
---|
| 626 | while ((CurArray<ArrayTotal) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 627 | if (*CurPos!='(') {
|
---|
| 628 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; break; }
|
---|
| 629 | CurPos++;
|
---|
| 630 | ICF_FilledParms = 0; // We dont have any Parms yet
|
---|
| 631 | while (CurPos<EndPos) {
|
---|
| 632 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 633 | break;
|
---|
| 634 | // ConnType/ConnInstallTo/ConnIndexTo (ARRAY!)
|
---|
| 635 | switch (ParamID) {
|
---|
| 636 | case 0x39EDF742:
|
---|
| 637 | if (!(CurPos = MINSTALL_GetNumericValue(&TempULong, CurPos, EndPos)))
|
---|
| 638 | break;
|
---|
| 639 | ((PMCI_MCIINSTALLCONN)INIChangeEntryPtr)->ConnectorList[CurArray].usConnectType = TempULong;
|
---|
| 640 | break;
|
---|
| 641 | case 0x77E86C5D: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLCONN)INIChangeEntryPtr)->ConnectorList[CurArray].szToInstallName, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 642 | case 0xDEB82C0C:
|
---|
| 643 | if (!(CurPos = MINSTALL_GetNumericValue(&TempULong, CurPos, EndPos)))
|
---|
| 644 | break;
|
---|
| 645 | ((PMCI_MCIINSTALLCONN)INIChangeEntryPtr)->ConnectorList[CurArray].usToConnectIndex = TempULong;
|
---|
| 646 | break;
|
---|
| 647 | }
|
---|
| 648 | if (MINSTALL_ErrorMsgID) break; // If any error occured...
|
---|
| 649 | }
|
---|
| 650 | if (MINSTALL_ErrorMsgID) break;
|
---|
| 651 | // Check, if array element had all parameters...
|
---|
| 652 | if (MINSTALL_CheckForMissingINIParms(CurLineNo)) break;
|
---|
| 653 | CurArray++;
|
---|
| 654 | }
|
---|
| 655 | if (MINSTALL_ErrorMsgID) break;
|
---|
| 656 | if (*CurPos!=')') {
|
---|
| 657 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; break; }
|
---|
| 658 | CurPos++;
|
---|
| 659 | // Now restore Main-ParmList and FilledParms...
|
---|
| 660 | ICF_FilledParms = MainFilledParms; ICF_CheckParmList = MainCheckParmList;
|
---|
| 661 | }
|
---|
| 662 | }
|
---|
| 663 | break;
|
---|
| 664 | case MCI_MCIINSTALLPARM_ID: // =========== MCI - MciInstallParm
|
---|
| 665 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 666 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 667 | break;
|
---|
| 668 | // ParmInstallName/ParmString
|
---|
| 669 | switch (ParamID) {
|
---|
| 670 | case 0xBB3418BC: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLPARM)INIChangeEntryPtr)->szInstallName, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 671 | case 0x7E2CCDF4: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLPARM)INIChangeEntryPtr)->szDevParams, MCIMAX_DEVPARAMSLENGTH, CurPos, EndPos); break;
|
---|
| 672 | }
|
---|
| 673 | }
|
---|
| 674 | break;
|
---|
| 675 | case MCI_MCIINSTALLALIAS_ID: // ========== MCI - MciInstallAlias
|
---|
| 676 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 677 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 678 | break;
|
---|
| 679 | // AliasInstallName/AliasString
|
---|
| 680 | switch (ParamID) {
|
---|
| 681 | case 0xDE60EB0E: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLALIAS)INIChangeEntryPtr)->szInstallName, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 682 | case 0xA278C064: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLALIAS)INIChangeEntryPtr)->szAliasName, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 683 | }
|
---|
| 684 | }
|
---|
| 685 | break;
|
---|
| 686 | case MCI_MCIINSTALLEXT_ID: // ============ MCI - MciInstallExt
|
---|
| 687 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 688 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 689 | break;
|
---|
| 690 | // ExtInstallName/ExtArray
|
---|
| 691 | switch (ParamID) {
|
---|
| 692 | case 0x8187B8FE: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLEXT)INIChangeEntryPtr)->szInstallName, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 693 | case 0x130025CB: // ExtArray is ARRAY
|
---|
| 694 | // Safe current Main-ParmList and FilledParms...
|
---|
| 695 | MainFilledParms = ICF_FilledParms; MainCheckParmList = ICF_CheckParmList;
|
---|
| 696 | // Set to Array-specific ParmList...
|
---|
| 697 | ICF_CheckParmList = ICF_CurParmEntry->ParmListPtr;
|
---|
| 698 |
|
---|
| 699 | ((PMCI_MCIINSTALLEXT)INIChangeEntryPtr)->usNumExtensions = ArrayCount;
|
---|
| 700 | ArrayTotal = ArrayCount; CurArray = 0;
|
---|
| 701 | while ((CurArray<ArrayTotal) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 702 | if (*CurPos!='(') {
|
---|
| 703 | MINSTALL_TrappedError (MINSTMSG_ICBadStructure); break; }
|
---|
| 704 | CurPos++;
|
---|
| 705 | ICF_FilledParms = 0; // We dont have any Parms yet
|
---|
| 706 | while (CurPos<EndPos) {
|
---|
| 707 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 708 | break;
|
---|
| 709 | // ExtString (ARRAY!)
|
---|
| 710 | switch (ParamID) {
|
---|
| 711 | case 0xFCD1A3BD: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLEXT)INIChangeEntryPtr)->szExtension[CurArray], MCIMAX_EXTENSIONNAMELENGTH, CurPos, EndPos); break;
|
---|
| 712 | }
|
---|
| 713 | if (MINSTALL_ErrorMsgID) break; // If any error occured...
|
---|
| 714 | }
|
---|
| 715 | if (MINSTALL_ErrorMsgID) break;
|
---|
| 716 | // Check, if array element had all parameters...
|
---|
| 717 | if (MINSTALL_CheckForMissingINIParms(CurLineNo)) break;
|
---|
| 718 | CurArray++;
|
---|
| 719 | }
|
---|
| 720 | if (MINSTALL_ErrorMsgID) break;
|
---|
| 721 | if (*CurPos!=')') {
|
---|
| 722 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadStructure; break; }
|
---|
| 723 | CurPos++;
|
---|
| 724 | // Now restore Main-ParmList and FilledParms...
|
---|
| 725 | ICF_FilledParms = MainFilledParms; ICF_CheckParmList = MainCheckParmList;
|
---|
| 726 | }
|
---|
| 727 | }
|
---|
| 728 | break;
|
---|
| 729 | case MCI_MCIINSTALLTYPES_ID: // ========== MCI - MciInstallTypes
|
---|
| 730 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 731 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 732 | break;
|
---|
| 733 | // TypesInstallName/TypesTypeList
|
---|
| 734 | switch (ParamID) {
|
---|
| 735 | case 0x3DA680F8: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLTYPES)INIChangeEntryPtr)->szInstallName, MCIMAX_DEVICENAMELENGTH, CurPos, EndPos); break;
|
---|
| 736 | case 0x84C253AD: CurPos = MINSTALL_GetMacrodString(((PMCI_MCIINSTALLTYPES)INIChangeEntryPtr)->szTypes, MCIMAX_TYPELISTLENGTH, CurPos, EndPos); break;
|
---|
| 737 | }
|
---|
| 738 | }
|
---|
| 739 | break;
|
---|
| 740 | case MMIO_MMIOINSTALL_ID: // ============= MMIO - mmioInstall
|
---|
| 741 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 742 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 743 | break;
|
---|
| 744 | // FourCC/DllName/DllEntryPoint/Flags/ExtendLen/MediaType/IOProcType/DefExt
|
---|
| 745 | switch (ParamID) {
|
---|
| 746 | case 0x874AF32B: // mmioFourCC must be 4 chars wide
|
---|
| 747 | if (!(CurPos = MINSTALL_GetMacrodString(TempBuffer, MINSTMAX_PATHLENGTH, CurPos, EndPos)))
|
---|
| 748 | break;
|
---|
| 749 | if (strlen(TempBuffer)!=4) {
|
---|
| 750 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadFourCC; break; }
|
---|
| 751 | ((PMMIO_MMIOINSTALL)INIChangeEntryPtr)->fccIOProc = *((PULONG)&TempBuffer);
|
---|
| 752 | break;
|
---|
| 753 | case 0x83BC6E92: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOINSTALL)INIChangeEntryPtr)->szDLLName, MMIOMAX_DLLLENGTH, CurPos, EndPos); break;
|
---|
| 754 | case 0x383FA8EC: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOINSTALL)INIChangeEntryPtr)->szProcName, MMIOMAX_PROCNAMELENGTH, CurPos, EndPos); break;
|
---|
| 755 | case 0x6EA2DBC6: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOINSTALL)INIChangeEntryPtr)->dwFlags, CurPos, EndPos); break;
|
---|
| 756 | case 0x953B087F: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOINSTALL)INIChangeEntryPtr)->dwExtendLen, CurPos, EndPos); break;
|
---|
| 757 | case 0xB1824C61: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOINSTALL)INIChangeEntryPtr)->dwMediaType, CurPos, EndPos); break;
|
---|
| 758 | case 0xCD997BB5: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOINSTALL)INIChangeEntryPtr)->dwIOProcType, CurPos, EndPos); break;
|
---|
| 759 | case 0xF1124958: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOINSTALL)INIChangeEntryPtr)->szDefExt, MMIOMAX_EXTENSIONNAMELENGTH, CurPos, EndPos); break;
|
---|
| 760 | }
|
---|
| 761 | }
|
---|
| 762 | break;
|
---|
| 763 | case MMIO_MMIOCODECDELETE_ID: // ========= MMIO - mmioCodecDelete
|
---|
| 764 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 765 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 766 | break;
|
---|
| 767 | // Length/FourCC/DllName/DllEntryPoint/CompTypeFcc/CompSubType/
|
---|
| 768 | // MediaType/Flags/CapsFlags/HWName/MaxSrcBuf/SyncMethod/Reserved1
|
---|
| 769 | // XAlign/YAlign/SpecInfo
|
---|
| 770 | switch (ParamID) {
|
---|
| 771 | case 0xB8420316: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulStructLen, CurPos, EndPos); break;
|
---|
| 772 | case 0x5CCDD4CA: // mmioFourCC must be 4 chars wide
|
---|
| 773 | if (!(CurPos = MINSTALL_GetMacrodString(TempBuffer, MINSTMAX_PATHLENGTH, CurPos, EndPos)))
|
---|
| 774 | break;
|
---|
| 775 | if (strlen(TempBuffer)!=4) {
|
---|
| 776 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadFourCC; break; }
|
---|
| 777 | ((PMMIO_MMIOCODEC)INIChangeEntryPtr)->fcc = *((PULONG)&TempBuffer);
|
---|
| 778 | break;
|
---|
| 779 | case 0x546A3B5B: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szDLLName, MMIOMAX_DLLLENGTH, CurPos, EndPos); break;
|
---|
| 780 | case 0x75D262DB: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szProcName, MMIOMAX_PROCNAMELENGTH, CurPos, EndPos); break;
|
---|
| 781 | case 0xB3D96C53: // mmioCompressType (FCC) must be 4 chars wide
|
---|
| 782 | if (!(CurPos = MINSTALL_GetMacrodString(TempBuffer, MINSTMAX_PATHLENGTH, CurPos, EndPos)))
|
---|
| 783 | break;
|
---|
| 784 | if (strlen(TempBuffer)!=4) {
|
---|
| 785 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadFourCC; break; }
|
---|
| 786 | ((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulCompressType = *((PULONG)&TempBuffer);
|
---|
| 787 | break;
|
---|
| 788 | case 0x6CCF6654: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulCompressSubType, CurPos, EndPos); break;
|
---|
| 789 | case 0xB0BB52CB: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulMediaType, CurPos, EndPos); break;
|
---|
| 790 | case 0x524CECEC: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulFlags, CurPos, EndPos); break;
|
---|
| 791 | case 0x09007EEC: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulCapsFlags, CurPos, EndPos); break;
|
---|
| 792 | case 0xD8CF2CF5: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szHWID, MMIOMAX_HWNAMELENGTH, CurPos, EndPos); break;
|
---|
| 793 | case 0x2841E06C: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulMaxSrcBufLen, CurPos, EndPos); break;
|
---|
| 794 | case 0xD9643500: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulSyncMethod, CurPos, EndPos); break;
|
---|
| 795 | case 0xF7CAA0ED: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->fccPreferredFormat, CurPos, EndPos); break;
|
---|
| 796 | case 0xFD9EE47D: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulXalignment, CurPos, EndPos); break;
|
---|
| 797 | case 0x36C237D8: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulYalignment, CurPos, EndPos); break;
|
---|
| 798 | case 0x2DCCCF4F: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szSpecInfo, MMIOMAX_SPECINFOLENGTH, CurPos, EndPos); break;
|
---|
| 799 | }
|
---|
| 800 | }
|
---|
| 801 | break;
|
---|
| 802 | case MMIO_MMIOCODEC1INSTALL_ID: // ======= MMIO - mmioCodec1Install
|
---|
| 803 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 804 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 805 | break;
|
---|
| 806 | // Length/FourCC/DllName/DllEntryPoint/CompTypeFcc/CompSubType/
|
---|
| 807 | // MediaType/Flags/CapsFlags/HWName/MaxSrcBuf/SyncMethod/Reserved1
|
---|
| 808 | // XAlign/YAlign/SpecInfo
|
---|
| 809 | switch (ParamID) {
|
---|
| 810 | case 0xD1C05A78: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulStructLen, CurPos, EndPos); break;
|
---|
| 811 | case 0x354F8DA4: // mmioFourCC must be 4 chars wide
|
---|
| 812 | if (!(CurPos = MINSTALL_GetMacrodString(TempBuffer, MINSTMAX_PATHLENGTH, CurPos, EndPos)))
|
---|
| 813 | break;
|
---|
| 814 | if (strlen(TempBuffer)!=4) {
|
---|
| 815 | MINSTALL_ErrorMsgID = MINSTMSG_ICBadFourCC; break; }
|
---|
| 816 | ((PMMIO_MMIOCODEC)INIChangeEntryPtr)->fcc = *((PULONG)&TempBuffer);
|
---|
| 817 | break;
|
---|
| 818 | case 0xFE09F55D: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szDLLName, MMIOMAX_DLLLENGTH, CurPos, EndPos); break;
|
---|
| 819 | case 0x08D25727: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szProcName, MMIOMAX_PROCNAMELENGTH, CurPos, EndPos); break;
|
---|
| 820 | // Codec1Install -> Change is here: ULONG instead of FCC
|
---|
| 821 | case 0x487146E0: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulCompressType, CurPos, EndPos); break;
|
---|
| 822 | case 0xAA46F050: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulCompressSubType, CurPos, EndPos); break;
|
---|
| 823 | case 0x9A3DB099: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulMediaType, CurPos, EndPos); break;
|
---|
| 824 | case 0xD6D77C7F: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulFlags, CurPos, EndPos); break;
|
---|
| 825 | case 0x23869CBE: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulCapsFlags, CurPos, EndPos); break;
|
---|
| 826 | case 0xB14D759B: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szHWID, MMIOMAX_HWNAMELENGTH, CurPos, EndPos); break;
|
---|
| 827 | case 0x02C7023E: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulMaxSrcBufLen, CurPos, EndPos); break;
|
---|
| 828 | case 0x5C2B833A: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulSyncMethod, CurPos, EndPos); break;
|
---|
| 829 | case 0xDD4C42BF: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->fccPreferredFormat, CurPos, EndPos); break;
|
---|
| 830 | case 0x941CBD13: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulXalignment, CurPos, EndPos); break;
|
---|
| 831 | case 0x5F406EB6: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulYalignment, CurPos, EndPos); break;
|
---|
| 832 | case 0xC40509B4: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szSpecInfo, MMIOMAX_SPECINFOLENGTH, CurPos, EndPos); break;
|
---|
| 833 | }
|
---|
| 834 | }
|
---|
| 835 | break;
|
---|
| 836 | case MMIO_MMIOCODEC2INSTALL_ID: // ======= MMIO - mmioCodec2Install
|
---|
| 837 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 838 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 839 | break;
|
---|
| 840 | // Length/FourCC/DllName/DllEntryPoint/CompTypeFcc/CompSubType/
|
---|
| 841 | // MediaType/Flags/CapsFlags/HWName/MaxSrcBuf/SyncMethod/Reserved1
|
---|
| 842 | // XAlign/YAlign/SpecInfo
|
---|
| 843 | switch (ParamID) {
|
---|
| 844 | case 0xE02840E5: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulStructLen, CurPos, EndPos); break;
|
---|
| 845 | case 0x04A79739: // mmioFourCC must be 4 chars wide
|
---|
| 846 | if (!(CurPos = MINSTALL_GetMacrodString(TempBuffer, MINSTMAX_PATHLENGTH, CurPos, EndPos)))
|
---|
| 847 | break;
|
---|
| 848 | if (strlen(TempBuffer)!=4) {
|
---|
| 849 | MINSTALL_TrappedError (MINSTMSG_ICBadFourCC); break; }
|
---|
| 850 | ((PMMIO_MMIOCODEC)INIChangeEntryPtr)->fcc = *((PULONG)&TempBuffer);
|
---|
| 851 | break;
|
---|
| 852 | case 0x7086F2BE: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szDLLName, MMIOMAX_DLLLENGTH, CurPos, EndPos); break;
|
---|
| 853 | case 0x74B372FC: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szProcName, MMIOMAX_PROCNAMELENGTH, CurPos, EndPos); break;
|
---|
| 854 | // Codec2Install -> Change is here: FCC instead of ULONG
|
---|
| 855 | case 0x02CE28A7: // mmioCompressType (FCC) must be 4 chars wide
|
---|
| 856 | if (!(CurPos = MINSTALL_GetMacrodString(TempBuffer, MINSTMAX_PATHLENGTH, CurPos, EndPos)))
|
---|
| 857 | break;
|
---|
| 858 | if (strlen(TempBuffer)!=4) {
|
---|
| 859 | MINSTALL_TrappedError (MINSTMSG_ICBadFourCC); break; }
|
---|
| 860 | ((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulCompressType = *((PULONG)&TempBuffer);
|
---|
| 861 | break;
|
---|
| 862 | case 0xDDD822A0: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulCompressSubType, CurPos, EndPos); break;
|
---|
| 863 | case 0x710A0B9A: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulMediaType, CurPos, EndPos); break;
|
---|
| 864 | case 0x50430ED1: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulFlags, CurPos, EndPos); break;
|
---|
| 865 | case 0xC8B127BD: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulCapsFlags, CurPos, EndPos); break;
|
---|
| 866 | case 0x80A56F06: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szHWID, MMIOMAX_HWNAMELENGTH, CurPos, EndPos); break;
|
---|
| 867 | case 0xE9F0B93D: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulMaxSrcBufLen, CurPos, EndPos); break;
|
---|
| 868 | case 0xC5C9E53B: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulSyncMethod, CurPos, EndPos); break;
|
---|
| 869 | case 0x367BF9BC: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->fccPreferredFormat, CurPos, EndPos); break;
|
---|
| 870 | case 0xA5F4A78E: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulXalignment, CurPos, EndPos); break;
|
---|
| 871 | case 0x6EA8742B: CurPos = MINSTALL_GetNumericValue(&((PMMIO_MMIOCODEC)INIChangeEntryPtr)->ulYalignment, CurPos, EndPos); break;
|
---|
| 872 | case 0xFD883571: CurPos = MINSTALL_GetMacrodString(((PMMIO_MMIOCODEC)INIChangeEntryPtr)->szSpecInfo, MMIOMAX_SPECINFOLENGTH, CurPos, EndPos); break;
|
---|
| 873 | }
|
---|
| 874 | }
|
---|
| 875 | break;
|
---|
| 876 | case PRF_PROFILEDATA_ID: // ============== PRF - ProfileData
|
---|
| 877 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 878 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 879 | break;
|
---|
| 880 | // Ini/AppName/KeyName/Dll/Id
|
---|
| 881 | switch (ParamID) {
|
---|
| 882 | case 0xE1F0F4E2: CurPos = MINSTALL_GetMacrodString(((PPRF_PROFILEDATA)INIChangeEntryPtr)->Ini, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 883 | case 0x027F2A21: CurPos = MINSTALL_GetMacrodString(((PPRF_PROFILEDATA)INIChangeEntryPtr)->AppName, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 884 | case 0xF8048436: CurPos = MINSTALL_GetMacrodString(((PPRF_PROFILEDATA)INIChangeEntryPtr)->KeyName, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 885 | case 0xAB74F1BC: CurPos = MINSTALL_GetMacrodString(((PPRF_PROFILEDATA)INIChangeEntryPtr)->Dll, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 886 | case 0x11D3633A: CurPos = MINSTALL_GetNumericValue(&((PPRF_PROFILEDATA)INIChangeEntryPtr)->Id, CurPos, EndPos); break;
|
---|
| 887 | }
|
---|
| 888 | }
|
---|
| 889 | break;
|
---|
| 890 | case PRF_PROFILESTRING_ID: // ============ PRF - ProfileString
|
---|
| 891 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 892 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 893 | break;
|
---|
| 894 | // Inis/AppNames/KeyNames/Datas
|
---|
| 895 | switch (ParamID) {
|
---|
| 896 | case 0x6E859C63: CurPos = MINSTALL_GetMacrodString(((PPRF_PROFILESTRING)INIChangeEntryPtr)->Inis, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 897 | case 0x6C0B80B7: CurPos = MINSTALL_GetMacrodString(((PPRF_PROFILESTRING)INIChangeEntryPtr)->AppNames, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 898 | case 0xEF227EDE: CurPos = MINSTALL_GetMacrodString(((PPRF_PROFILESTRING)INIChangeEntryPtr)->KeyNames, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 899 | case 0x384CCEAA: CurPos = MINSTALL_GetMacrodString(((PPRF_PROFILESTRING)INIChangeEntryPtr)->Datas, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 900 | }
|
---|
| 901 | }
|
---|
| 902 | break;
|
---|
| 903 | case SPI_SPIINSTALL_ID: // =============== SPI - SpiInstall
|
---|
| 904 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 905 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 906 | break;
|
---|
| 907 | // SpiDllName
|
---|
| 908 | switch (ParamID) {
|
---|
| 909 | case 0xE906AF16: CurPos = MINSTALL_GetMacrodString(((PSPI_SPIINSTALL)INIChangeEntryPtr)->SpiDllName, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 910 | }
|
---|
| 911 | }
|
---|
| 912 | break;
|
---|
| 913 | case WPS_CREATEOBJECT_ID: // ================= WPS - WPObject
|
---|
| 914 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 915 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 916 | break;
|
---|
| 917 | // WPClassName/WPTitle/WPSetupString/WPLocation/WPFlags
|
---|
| 918 | switch (ParamID) {
|
---|
| 919 | case 0x441CEA42: CurPos = MINSTALL_GetMacrodString(((PWPS_CREATEOBJECT)INIChangeEntryPtr)->WPClassName, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 920 | case 0x6DD04D76: CurPos = MINSTALL_GetMacrodString(((PWPS_CREATEOBJECT)INIChangeEntryPtr)->WPTitle, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 921 | case 0x10108A85: CurPos = MINSTALL_GetMacrodString(((PWPS_CREATEOBJECT)INIChangeEntryPtr)->WPSetupString, MINSTMAX_PATHLENGTH, CurPos, EndPos); break;
|
---|
| 922 | case 0x379F7EDF: CurPos = MINSTALL_GetMacrodString(((PWPS_CREATEOBJECT)INIChangeEntryPtr)->WPLocation, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 923 | case 0x4DE374A7: CurPos = MINSTALL_GetNumericValue(&((PWPS_CREATEOBJECT)INIChangeEntryPtr)->WPFlags, CurPos, EndPos); break;
|
---|
| 924 | }
|
---|
| 925 | }
|
---|
| 926 | break;
|
---|
| 927 | case WPS_DESTROYOBJECT_ID: // ================ WPS - WPDestroyObject
|
---|
| 928 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 929 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 930 | break;
|
---|
| 931 | // WPDestroyObjectID
|
---|
| 932 | switch (ParamID) {
|
---|
| 933 | case 0x5BE681E8: CurPos = MINSTALL_GetMacrodString(((PWPS_DESTROYOBJECT)INIChangeEntryPtr)->WPDestroyObjectID, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 934 | }
|
---|
| 935 | }
|
---|
| 936 | break;
|
---|
| 937 | case WPS_WPCLASS_ID: // ================= WPS - WPClass
|
---|
| 938 | while ((CurPos<EndPos) && (!MINSTALL_ErrorMsgID)) {
|
---|
| 939 | if (!(ParamID = MINSTALL_GetNextINIParmID (&CurPos, EndPos, &CurLineNo, &ArrayCount)))
|
---|
| 940 | break;
|
---|
| 941 | // WPClassNameNew/WPDllName/WPReplaceClass
|
---|
| 942 | switch (ParamID) {
|
---|
| 943 | case 0x3ECA180C: CurPos = MINSTALL_GetMacrodString(((PWPS_WPCLASS)INIChangeEntryPtr)->WPClassNameNew, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 944 | case 0xB933A94C: CurPos = MINSTALL_GetMacrodString(((PWPS_WPCLASS)INIChangeEntryPtr)->WPDllName, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 945 | case 0x7F6632F4: CurPos = MINSTALL_GetMacrodString(((PWPS_WPCLASS)INIChangeEntryPtr)->WPReplaceClass, MINSTMAX_STRLENGTH, CurPos, EndPos); break;
|
---|
| 946 | }
|
---|
| 947 | }
|
---|
| 948 | break;
|
---|
| 949 | default:
|
---|
| 950 | MINSTLOG_ToFile ("Inconsistent MINSTINI_CheckFuncTable\n");
|
---|
| 951 | return FALSE; // Internal error
|
---|
| 952 | }
|
---|
| 953 | if (MINSTALL_ErrorMsgID) break; // If any error occured, get out...
|
---|
| 954 |
|
---|
| 955 | // Last but not least check if any parameter(s) are missing...
|
---|
| 956 | if (MINSTALL_CheckForMissingINIParms(CurLineNo)) break;
|
---|
| 957 |
|
---|
| 958 | // // Now update current INIChangeArray-Pointers to point behind this entry
|
---|
| 959 | // INIChangeCustomPtr = (PVOID)(((ULONG)INIChangeEntryPtr)+INIChangeHeaderPtr->Size);
|
---|
| 960 | // INIChangeHeaderPtr = (PVOID)(((ULONG)INIChangeHeaderPtr)+INIChangeHeaderPtr->Size);
|
---|
| 961 | INIChangeCount++;
|
---|
| 962 | }
|
---|
| 963 |
|
---|
| 964 | // Put that Array&Count into INIChange-Queue...
|
---|
| 965 | ScriptFilePtr->GroupPtr->INIChange1stEntry = INIChange1stEntryPtr;
|
---|
| 966 | ScriptFilePtr->GroupPtr->INIChangeCount = INIChangeCount;
|
---|
| 967 |
|
---|
| 968 | // Remove that file from memory...
|
---|
| 969 | FILE_UnLoadFileControl(&CHANGESCR);
|
---|
| 970 |
|
---|
| 971 | // For debugging the memory structure...
|
---|
| 972 | // FileHandle = fopen ("minstall.out", "wb");
|
---|
| 973 | // fwrite(INIChangeArrayPtr, 1, RequiredSpace, FileHandle);
|
---|
| 974 | // fclose (FileHandle);
|
---|
| 975 |
|
---|
| 976 | if (MINSTALL_ErrorMsgID) { // If Error-found during parsing...
|
---|
| 977 | MSG_SetInsertFileLocation (1, CHANGESCR.Name, CurLineNo);
|
---|
| 978 | MINSTALL_TrappedError (MINSTALL_ErrorMsgID);
|
---|
| 979 | return FALSE;
|
---|
| 980 | }
|
---|
| 981 | return TRUE;
|
---|
| 982 | }
|
---|
| 983 |
|
---|
| 984 | // ****************************************************************************
|
---|
| 985 |
|
---|
| 986 | BOOL MINSTALL_LoadCustomControl (VOID) {
|
---|
| 987 | PMINSTFILE CurFilePtr = FCF_FileArrayPtr;
|
---|
| 988 | USHORT CurNo = 0;
|
---|
| 989 |
|
---|
| 990 | // Remember this action for cleanup...
|
---|
| 991 | MINSTALL_Done |= MINSTDONE_LOADCUSTOMCTRLSCR;
|
---|
| 992 |
|
---|
| 993 | while (CurNo<FCF_FileCount) {
|
---|
| 994 | if (CurFilePtr->Flags & MINSTFILE_Flags_CFGCF) {
|
---|
| 995 | // Is an CONFIG-Control-File, so process it...
|
---|
| 996 | MINSTLOG_ToFile ("LoadConfigControlFile \"%s\"...\n", CurFilePtr->Name);
|
---|
| 997 | if (!MINSTALL_LoadConfigControlFile (CurFilePtr))
|
---|
| 998 | return FALSE;
|
---|
| 999 | MINSTLOG_ToFile ("LoadConfigControlFile DONE\n");
|
---|
| 1000 | } else if (CurFilePtr->Flags & MINSTFILE_Flags_INICF) {
|
---|
| 1001 | // Is an INI-Control-File, so process it...
|
---|
| 1002 | MINSTLOG_ToFile ("LoadINIControlFile \"%s\"...\n", CurFilePtr->Name);
|
---|
| 1003 | if (!(MINSTALL_LoadINIControlFile (CurFilePtr)))
|
---|
| 1004 | return FALSE;
|
---|
| 1005 | MINSTLOG_ToFile ("LoadINIControlFile DONE\n");
|
---|
| 1006 | }
|
---|
| 1007 | CurFilePtr++; CurNo++;
|
---|
| 1008 | }
|
---|
| 1009 | return TRUE;
|
---|
| 1010 | }
|
---|
| 1011 |
|
---|
| 1012 | VOID MINSTALL_CleanUpCustomControl (VOID) {
|
---|
| 1013 | BOOL CurNo = 0;
|
---|
| 1014 | PMINSTGRP CurGroupPtr = MCF_GroupArrayPtr;
|
---|
| 1015 | PMINSTINIHEADER CurINIChangePtr = 0;
|
---|
| 1016 | PMINSTINIHEADER NextINIChangePtr = 0;
|
---|
| 1017 |
|
---|
| 1018 | // Release CustomControl-memory-blocks...
|
---|
| 1019 | while (CurNo<MCF_GroupCount) {
|
---|
| 1020 | // Release Config-Control-Script blocks...
|
---|
| 1021 | if (CurGroupPtr->ConfigChangeArray) {
|
---|
| 1022 | free (CurGroupPtr->ConfigChangeArray);
|
---|
| 1023 | CurGroupPtr->ConfigChangeArray = 0; }
|
---|
| 1024 | if (CurGroupPtr->ConfigStringArray) {
|
---|
| 1025 | free (CurGroupPtr->ConfigStringArray);
|
---|
| 1026 | CurGroupPtr->ConfigChangeArray = 0; }
|
---|
| 1027 | CurGroupPtr->ConfigChangeCount = 0;
|
---|
| 1028 |
|
---|
| 1029 | // Release INI-Control-Script blocks...
|
---|
| 1030 | CurINIChangePtr = CurGroupPtr->INIChange1stEntry;
|
---|
| 1031 | while (CurINIChangePtr) {
|
---|
| 1032 | NextINIChangePtr = CurINIChangePtr->NextPtr;
|
---|
| 1033 | free (CurINIChangePtr);
|
---|
| 1034 | CurINIChangePtr = NextINIChangePtr;
|
---|
| 1035 | }
|
---|
| 1036 | CurGroupPtr->INIChangeCount = 0;
|
---|
| 1037 | CurGroupPtr++; CurNo++;
|
---|
| 1038 | }
|
---|
| 1039 |
|
---|
| 1040 | // Remove this action from cleanup...
|
---|
| 1041 | MINSTALL_Done &= !MINSTDONE_LOADCUSTOMCTRLSCR;
|
---|
| 1042 | }
|
---|