Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

907 lines
23 KiB

  1. /*
  2. ** MEP Party extension
  3. **
  4. ** History:
  5. ** 17-Oct-1991 Ported to NT
  6. **
  7. */
  8. #define _CTYPE_DISABLE_MACROS
  9. #include <ctype.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12. #include "ext.h"
  13. #include <winuserp.h>
  14. #ifndef TRUE
  15. #define TRUE -1
  16. #define FALSE 0
  17. #endif
  18. flagType iconizeOnExit = TRUE;
  19. flagType pascal DoCaseLine(
  20. PFILE CurFile,
  21. LINE y,
  22. COL x,
  23. COL maxX,
  24. flagType LowerCase
  25. )
  26. {
  27. flagType Modified;
  28. int cb;
  29. char buf[ BUFLEN ], *s;
  30. cb = GetLine( y, buf, CurFile );
  31. s = &buf[ x ];
  32. if (maxX != 0) {
  33. if (maxX - x < cb) {
  34. cb = maxX - x + 1;
  35. }
  36. }
  37. else {
  38. cb -= x;
  39. }
  40. Modified = FALSE;
  41. while (cb--) {
  42. if (LowerCase) {
  43. if (*s >= 'A' && *s <= 'Z') {
  44. *s -= 'A' - 'a';
  45. Modified = TRUE;
  46. }
  47. }
  48. else {
  49. if (*s >= 'a' && *s <= 'z') {
  50. *s += 'A' - 'a';
  51. Modified = TRUE;
  52. }
  53. }
  54. s++;
  55. }
  56. if (Modified) {
  57. PutLine( y, buf, CurFile );
  58. }
  59. return( TRUE );
  60. }
  61. flagType pascal EXTERNAL
  62. Case(
  63. CMDDATA argData,
  64. ARG far *pArg,
  65. flagType fMeta
  66. )
  67. {
  68. int i;
  69. PFILE CurFile;
  70. CurFile = FileNameToHandle("",NULL);
  71. switch( pArg->argType ) {
  72. case NOARG:
  73. return( DoCaseLine( CurFile, pArg->arg.noarg.y, 0, 0, fMeta ) );
  74. break;
  75. case NULLARG:
  76. return( DoCaseLine( CurFile,
  77. pArg->arg.nullarg.y,
  78. pArg->arg.nullarg.x,
  79. 0,
  80. fMeta
  81. )
  82. );
  83. break;
  84. case LINEARG:
  85. for (i=pArg->arg.linearg.yStart; i<=pArg->arg.linearg.yEnd; i++) {
  86. if (!DoCaseLine( CurFile, (LINE)i, 0, 0, fMeta )) {
  87. return( FALSE );
  88. }
  89. }
  90. return( TRUE );
  91. break;
  92. case BOXARG:
  93. for (i=pArg->arg.boxarg.yTop; i<=pArg->arg.boxarg.yBottom; i++) {
  94. if (!DoCaseLine( CurFile,
  95. (LINE)i,
  96. pArg->arg.boxarg.xLeft,
  97. pArg->arg.boxarg.xRight,
  98. fMeta
  99. )
  100. ) {
  101. return( FALSE );
  102. }
  103. }
  104. return( TRUE );
  105. break;
  106. default:
  107. BadArg();
  108. return( FALSE );
  109. }
  110. argData;
  111. }
  112. int CountMsgFiles;
  113. int MsgFileIndex;
  114. HANDLE MsgFiles[ 2 ];
  115. int MsgFileOffsetIndex;
  116. LONG MsgFileOffsets[ 3 ];
  117. char
  118. GetHexDigit(
  119. ULONG value,
  120. int index
  121. )
  122. {
  123. int digit;
  124. if (index < 4) {
  125. index <<= 2;
  126. digit = (int)((value >> index) & 0xF);
  127. }
  128. else {
  129. digit = 0;
  130. }
  131. if (digit <= 9) {
  132. return( (char)(digit+'0') );
  133. }
  134. else {
  135. return( (char)((digit-10)+'A') );
  136. }
  137. }
  138. void
  139. MyFormatMessage(
  140. char *buf,
  141. char *msg,
  142. long value1,
  143. long value2
  144. );
  145. void
  146. MyFormatMessage(
  147. char *buf,
  148. char *msg,
  149. long value1,
  150. long value2
  151. )
  152. {
  153. char c, *src, *dst;
  154. long value;
  155. src = msg;
  156. dst = buf;
  157. while (c = *src++) {
  158. if (c == '%' && src[1] == 'x') {
  159. if (*src == '1') {
  160. value = value1;
  161. }
  162. else {
  163. value = value2;
  164. }
  165. *dst++ = GetHexDigit( value, 3 );
  166. *dst++ = GetHexDigit( value, 2 );
  167. *dst++ = GetHexDigit( value, 1 );
  168. *dst++ = GetHexDigit( value, 0 );
  169. src++;
  170. src++;
  171. }
  172. else {
  173. *dst++ = c;
  174. }
  175. }
  176. *dst = '\0';
  177. DoMessage( buf );
  178. }
  179. flagType pascal EXTERNAL
  180. ShowBuildMessage(
  181. CMDDATA argData,
  182. ARG far *pArg,
  183. flagType fMeta
  184. )
  185. {
  186. int i, BytesRead, BytesScanned, linenum;
  187. ULONG NewOffset;
  188. char LineBuffer[ 256 ], *s, *s1;
  189. if (!fMeta && CountMsgFiles == 0) {
  190. MsgFileIndex = 0;
  191. MsgFiles[ MsgFileIndex ] = CreateFile( "build.wrn",
  192. GENERIC_READ,
  193. FILE_SHARE_READ,
  194. NULL,
  195. OPEN_EXISTING,
  196. 0,
  197. NULL
  198. );
  199. if (MsgFiles[ MsgFileIndex ] != INVALID_HANDLE_VALUE) {
  200. CountMsgFiles++;
  201. MsgFileIndex++;
  202. }
  203. MsgFiles[ MsgFileIndex ] = CreateFile( "build.err",
  204. GENERIC_READ,
  205. FILE_SHARE_READ,
  206. NULL,
  207. OPEN_EXISTING,
  208. 0,
  209. NULL
  210. );
  211. if (MsgFiles[ MsgFileIndex ] != INVALID_HANDLE_VALUE) {
  212. CountMsgFiles++;
  213. MsgFileIndex++;
  214. }
  215. MsgFileIndex = 0;
  216. MsgFileOffsetIndex = 0;
  217. MsgFileOffsets[ 0 ] = 0L;
  218. MsgFileOffsets[ 1 ] = 0L;
  219. MsgFileOffsets[ 2 ] = 0L;
  220. }
  221. else
  222. if (fMeta && CountMsgFiles != 0) {
  223. for (i=0; i<CountMsgFiles; i++) {
  224. CloseHandle( MsgFiles[ i ] );
  225. }
  226. CountMsgFiles = 0;
  227. return( TRUE );
  228. }
  229. if (CountMsgFiles == 0) {
  230. DoMessage( "No BUILD.WRN or BUILD.ERR message file." );
  231. return( FALSE );
  232. }
  233. switch( pArg->argType ) {
  234. case NULLARG:
  235. if (MsgFileOffsetIndex-- == 0) {
  236. MsgFileOffsetIndex = 2;
  237. }
  238. //
  239. // fall through
  240. //
  241. case NOARG:
  242. retrymsgfile:
  243. NewOffset = SetFilePointer( MsgFiles[ MsgFileIndex ],
  244. MsgFileOffsets[ MsgFileOffsetIndex ],
  245. NULL,
  246. FILE_BEGIN
  247. );
  248. if (NewOffset == -1) {
  249. MyFormatMessage( LineBuffer,
  250. "SetFilePointer( %1x ) failed - rc == %2x",
  251. MsgFileOffsets[ MsgFileOffsetIndex ],
  252. GetLastError()
  253. );
  254. DoMessage( LineBuffer );
  255. return( FALSE );
  256. }
  257. if (!ReadFile( MsgFiles[ MsgFileIndex ],
  258. LineBuffer,
  259. sizeof( LineBuffer ),
  260. ( LPDWORD )&BytesRead,
  261. NULL
  262. )
  263. ) {
  264. MyFormatMessage( LineBuffer,
  265. "ReadFile( %1x ) failed - rc == %2x",
  266. (ULONG)BytesRead,
  267. GetLastError()
  268. );
  269. DoMessage( LineBuffer );
  270. return( FALSE );
  271. }
  272. s = LineBuffer;
  273. BytesScanned = 0;
  274. while (BytesScanned < BytesRead) {
  275. BytesScanned++;
  276. if (*s == '\n') {
  277. *s = '\0';
  278. break;
  279. }
  280. else
  281. if (*s == '\r' && s[1] == '\n') {
  282. *s = '\0';
  283. BytesScanned++;
  284. break;
  285. }
  286. else {
  287. s++;
  288. }
  289. }
  290. if (BytesScanned == 0) {
  291. if (++MsgFileIndex == CountMsgFiles) {
  292. for (i=0; i<CountMsgFiles; i++) {
  293. CloseHandle( MsgFiles[ i ] );
  294. }
  295. CountMsgFiles = 0;
  296. DoMessage( "no more BUILD messages" );
  297. return( FALSE );
  298. }
  299. else {
  300. MsgFileOffsetIndex = 0;
  301. MsgFileOffsets[ 0 ] = 0L;
  302. MsgFileOffsets[ 1 ] = 0L;
  303. MsgFileOffsets[ 2 ] = 0L;
  304. goto retrymsgfile;
  305. }
  306. }
  307. else {
  308. NewOffset = MsgFileOffsets[ MsgFileOffsetIndex ];
  309. if (++MsgFileOffsetIndex == 3) {
  310. MsgFileOffsetIndex = 0;
  311. }
  312. MsgFileOffsets[ MsgFileOffsetIndex ] = NewOffset + BytesScanned;
  313. }
  314. s = LineBuffer;
  315. while (*s) {
  316. if (*s == '(') {
  317. *s++ = '\0';
  318. s1 = s;
  319. while (*s && isdigit( *s )) {
  320. s++;
  321. }
  322. *s++ = '\0';
  323. linenum = atoi( s1 );
  324. while (*s) {
  325. if (*s++ == ':') {
  326. fChangeFile( FALSE, LineBuffer );
  327. MoveCur( 0, (LINE)(linenum-1) );
  328. fExecute( "begline" );
  329. DoMessage( s+1 );
  330. return( TRUE );
  331. }
  332. }
  333. }
  334. else {
  335. s++;
  336. }
  337. }
  338. goto retrymsgfile;
  339. default:
  340. BadArg();
  341. return( FALSE );
  342. }
  343. return( TRUE );
  344. argData;
  345. }
  346. char ErrorText[ 64 ],
  347. Arguments[ 64 + MAX_PATH ],
  348. PathName[ MAX_PATH ];
  349. flagType pascal EXTERNAL
  350. SlmOut(
  351. CMDDATA argData,
  352. ARG far *pArg,
  353. flagType fMeta
  354. )
  355. {
  356. PFILE CurFile;
  357. STARTUPINFO StartupInfo;
  358. PROCESS_INFORMATION ProcessInformation;
  359. DWORD ExitCode;
  360. char *FileName;
  361. DWORD FileFlags;
  362. CurFile = FileNameToHandle( (char far *)"", (char far *)NULL );
  363. FileFlags = 0;
  364. GetEditorObject( 0xFF | RQ_FILE_FLAGS, CurFile, (PVOID)&FileFlags );
  365. GetEditorObject( 0xFF | RQ_FILE_NAME, CurFile, (PVOID)PathName );
  366. FileName = PathName + strlen( PathName );
  367. while (FileName > PathName) {
  368. if (*--FileName == '\\') {
  369. *FileName++ = '\0';
  370. break;
  371. }
  372. }
  373. if (FileName > PathName) {
  374. if (fMeta) {
  375. strcpy( Arguments, "in -i " );
  376. }
  377. else {
  378. strcpy( Arguments, "out -z " );
  379. }
  380. strcat( Arguments, FileName );
  381. DoMessage( Arguments );
  382. memset( &StartupInfo, 0, sizeof( StartupInfo ) );
  383. StartupInfo.cb = sizeof(StartupInfo);
  384. if (CreateProcess( NULL,
  385. Arguments,
  386. NULL,
  387. NULL,
  388. FALSE,
  389. 0,
  390. NULL,
  391. PathName,
  392. &StartupInfo,
  393. &ProcessInformation
  394. )
  395. ) {
  396. WaitForSingleObject( ProcessInformation.hProcess, (DWORD)-1 );
  397. if (!GetExitCodeProcess( ProcessInformation.hProcess, &ExitCode )) {
  398. ExitCode = 1;
  399. }
  400. CloseHandle( ProcessInformation.hProcess );
  401. CloseHandle( ProcessInformation.hThread );
  402. }
  403. else {
  404. ExitCode = 1;
  405. }
  406. if (ExitCode == 0) {
  407. if (!fMeta && FileFlags & DIRTY) {
  408. FileFlags &= ~(REFRESH|READONLY);
  409. SetEditorObject( 0xFF | RQ_FILE_FLAGS, CurFile, (PVOID)&FileFlags );
  410. GetEditorObject( 0xFF | RQ_FILE_NAME, CurFile, (PVOID)PathName );
  411. fChangeFile( FALSE, PathName );
  412. FileFlags = 0;
  413. GetEditorObject( 0xFF | RQ_FILE_FLAGS, CurFile, (PVOID)&FileFlags );
  414. if (FileFlags & DIRTY) {
  415. DoMessage( "Modified file has been checked out." );
  416. }
  417. else {
  418. DoMessage( "Current file has been checked out." );
  419. }
  420. }
  421. else {
  422. fExecute( "refresh" );
  423. if (fMeta) {
  424. DoMessage( "Changes to current file discarded. No longer checked out." );
  425. }
  426. else {
  427. DoMessage( "Current file has been checked out." );
  428. }
  429. }
  430. return( TRUE );
  431. }
  432. else {
  433. return( FALSE );
  434. }
  435. }
  436. else {
  437. DoMessage( "Unable to change current directory" );
  438. return( FALSE );
  439. }
  440. argData;
  441. pArg;
  442. fMeta;
  443. }
  444. EVT evtIdle;
  445. HANDLE Thread;
  446. DWORD ThreadId;
  447. HANDLE EditorStartEvent;
  448. HANDLE EditorStopEvent;
  449. HANDLE EditorSharedMemory;
  450. LPSTR EditorMemoryPointer;
  451. HWND hPrevWindow = (HWND)-1;
  452. PFILE pMailFile;
  453. LPSTR lpCmdLine = NULL;
  454. char CommandLineBuffer[ 256 ];
  455. flagType
  456. CheckForCmdLine( VOID )
  457. {
  458. LPSTR s;
  459. PFILE pCurFile;
  460. int fFileFlags;
  461. flagType fMailFile;
  462. if (lpCmdLine) {
  463. s = lpCmdLine;
  464. lpCmdLine = NULL;
  465. while (*s == ' ')
  466. s++;
  467. fMailFile = FALSE;
  468. if (*s) {
  469. if (*s == '/' || *s == '-')
  470. if (*++s == 't' || *s == 'T')
  471. if (*++s == ' ') {
  472. s++;
  473. fMailFile = TRUE;
  474. }
  475. if (fChangeFile( TRUE, s ) && fMailFile) {
  476. pCurFile = FileNameToHandle( "", NULL );
  477. fFileFlags = 0;
  478. GetEditorObject( 0xFF | RQ_FILE_FLAGS, pCurFile,
  479. (PVOID)&fFileFlags );
  480. fFileFlags |= TEMP;
  481. SetEditorObject( 0xFF | RQ_FILE_FLAGS, pCurFile,
  482. (PVOID)&fFileFlags );
  483. fExecute( "entermail" );
  484. pMailFile = pCurFile;
  485. }
  486. }
  487. }
  488. return( FALSE ); // We never handle a character
  489. }
  490. HWND
  491. GetWindowHandleOfEditor( void );
  492. void
  493. WaitForStartEvent( void );
  494. void SwitchToProgram( HWND hwnd );
  495. void
  496. SwitchToTaskManager( void );
  497. flagType pascal EXTERNAL
  498. StartExt(
  499. CMDDATA argData,
  500. ARG far *pArg,
  501. flagType fMeta
  502. )
  503. {
  504. PFILE pCurFile;
  505. int fFileFlags;
  506. CHAR szFileName[ 256 ];
  507. if (!fMeta || pMailFile) {
  508. pCurFile = FileNameToHandle( "", NULL );
  509. fFileFlags = 0;
  510. GetEditorObject( 0xFF | RQ_FILE_FLAGS, pCurFile, (PVOID)&fFileFlags );
  511. if (fFileFlags & DIRTY)
  512. FileWrite( "", pCurFile );
  513. if (pMailFile) {
  514. RemoveFile( pMailFile );
  515. pMailFile = NULL;
  516. }
  517. }
  518. if (hPrevWindow) {
  519. if (hPrevWindow != (HWND)-1) {
  520. SetEvent( EditorStopEvent );
  521. SwitchToProgram( hPrevWindow );
  522. }
  523. hPrevWindow = NULL;
  524. }
  525. else {
  526. SwitchToTaskManager();
  527. }
  528. #if 0
  529. //
  530. // Wait for this window to enter foreground again.
  531. //
  532. WaitForSingleObject( EditorStartEvent, (DWORD)-1 );
  533. fExecute( "cancel" );
  534. fExecute( "setwindow" );
  535. pCurFile = FileNameToHandle( "", NULL );
  536. pFileToTop( pCurFile );
  537. szFileName[ 0 ] = '\0';
  538. GetEditorObject( 0xFF | RQ_FILE_NAME, pCurFile, (PVOID)szFileName );
  539. if (szFileName[ 0 ] != '\0') {
  540. fChangeFile( TRUE, szFileName );
  541. }
  542. return( CheckForCmdLine() );
  543. #else
  544. fExecute( "savetmpfile" );
  545. return TRUE;
  546. #endif
  547. argData;
  548. pArg;
  549. }
  550. HWND
  551. GetWindowHandleOfEditor( void )
  552. {
  553. HWND hwnd;
  554. hwnd = GetWindow( GetDesktopWindow(), GW_CHILD );
  555. while (hwnd) {
  556. /*
  557. * Only look at visible, non-owned, Top Level Windows.
  558. */
  559. if (IsWindowVisible( hwnd ) && !GetWindow( hwnd, GW_OWNER )) {
  560. break;
  561. }
  562. hwnd = GetWindow( hwnd, GW_HWNDNEXT );
  563. }
  564. return hwnd;
  565. }
  566. void
  567. SwitchToProgram(
  568. HWND hwnd
  569. )
  570. {
  571. HWND hwndSelf;
  572. HWND hwndFoo;
  573. hwndSelf = GetWindowHandleOfEditor();
  574. if (hwndSelf && iconizeOnExit) {
  575. ShowWindow( hwndSelf, SW_MINIMIZE );
  576. }
  577. //
  578. // Temporary hack to make SetForegroundWindow work from a console
  579. // window - create an invisible window, make it the foreground
  580. // window and then make the window we want the foreground window.
  581. // After that destroy the temporary window.
  582. //
  583. hwndFoo = CreateWindow( "button", "baz", 0, 0, 0, 0, 0,
  584. NULL, NULL, NULL, NULL
  585. );
  586. SetForegroundWindow( hwndFoo );
  587. SetForegroundWindow( hwnd );
  588. ShowWindow( hwnd, SW_RESTORE);
  589. DestroyWindow( hwndFoo );
  590. }
  591. void
  592. SwitchToTaskManager( void )
  593. {
  594. HWND hwnd;
  595. wchar_t szTitle[ 256 ];
  596. /*
  597. * Search the window list for task manager window.
  598. */
  599. hwnd = GetWindow( GetDesktopWindow(), GW_CHILD );
  600. while (hwnd) {
  601. /*
  602. * Only look at non-visible, non-owned, Top Level Windows.
  603. */
  604. if (!IsWindowVisible( hwnd ) && !GetWindow( hwnd, GW_OWNER )) {
  605. //
  606. // Use internal call to get current Window title that does NOT
  607. // use SendMessage to query the title from the window procedure
  608. // but instead returns the most recent title displayed.
  609. //
  610. InternalGetWindowText( hwnd,
  611. (LPWSTR)szTitle,
  612. sizeof( szTitle ) / sizeof(szTitle[0])
  613. );
  614. if (!_wcsicmp( L"Task List", szTitle )) {
  615. SwitchToProgram( hwnd );
  616. break;
  617. }
  618. }
  619. hwnd = GetWindow( hwnd, GW_HWNDNEXT );
  620. }
  621. return;
  622. }
  623. void
  624. WaitForStartEvent( void )
  625. {
  626. LPSTR lpName, lpValue, lpNewCmdLine, lpEditorMem;
  627. WaitForSingleObject( EditorStartEvent, (DWORD)-1 );
  628. lpEditorMem = EditorMemoryPointer;
  629. hPrevWindow = *(HWND *)lpEditorMem;
  630. lpEditorMem += sizeof( hPrevWindow );
  631. pMailFile = NULL;
  632. SetCurrentDirectory( lpEditorMem );
  633. while( *lpEditorMem++ ) {
  634. }
  635. lpNewCmdLine = CommandLineBuffer;
  636. while( *lpNewCmdLine++ = *lpEditorMem++ ) {
  637. }
  638. while (*lpEditorMem) {
  639. lpName = lpEditorMem;
  640. while (*lpEditorMem) {
  641. if (*lpEditorMem++ == '=') {
  642. lpValue = lpEditorMem;
  643. lpValue[ -1 ] = '\0';
  644. while (*lpEditorMem++) {
  645. }
  646. SetEnvironmentVariableA( lpName, lpValue );
  647. lpValue[ -1 ] = '=';
  648. break;
  649. }
  650. }
  651. }
  652. lpCmdLine = CommandLineBuffer;
  653. return;
  654. }
  655. flagType pascal EXPORT MyIdleEvent( EVTargs far *pArgs )
  656. {
  657. return( CheckForCmdLine() );
  658. pArgs;
  659. }
  660. DWORD
  661. EnvThread(
  662. PVOID Parameter
  663. );
  664. flagType
  665. StartExtLoaded( void );
  666. flagType
  667. StartExtLoaded ()
  668. {
  669. EditorStartEvent = CreateEvent( NULL, FALSE, FALSE, "EditorStartEvent" );
  670. if (EditorStartEvent == NULL) {
  671. DoMessage( "Create of EditorStartEvent failed" );
  672. return FALSE;
  673. }
  674. EditorStopEvent = CreateEvent( NULL, FALSE, FALSE, "EditorStopEvent" );
  675. if (EditorStopEvent == NULL) {
  676. DoMessage( "Create of EditorStopEvent failed" );
  677. CloseHandle( EditorStartEvent );
  678. return FALSE;
  679. }
  680. EditorSharedMemory = CreateFileMapping( INVALID_HANDLE_VALUE,
  681. NULL,
  682. PAGE_READWRITE,
  683. 0,
  684. 8192,
  685. "EditorSharedMemory"
  686. );
  687. if (EditorSharedMemory == NULL) {
  688. DoMessage( "Create of EditorStartMemory failed" );
  689. CloseHandle( EditorStopEvent );
  690. CloseHandle( EditorStartEvent );
  691. return FALSE;
  692. }
  693. EditorMemoryPointer = MapViewOfFile( EditorSharedMemory,
  694. FILE_MAP_READ | FILE_MAP_WRITE,
  695. 0,
  696. 0,
  697. 8192
  698. );
  699. if (EditorMemoryPointer == NULL) {
  700. DoMessage( "MapView of EditorStartMemory failed" );
  701. CloseHandle( EditorStopEvent );
  702. CloseHandle( EditorStartEvent );
  703. CloseHandle( EditorSharedMemory );
  704. return FALSE;
  705. }
  706. hPrevWindow = (HWND)-1;
  707. evtIdle.evtType = EVT_RAWKEY;
  708. evtIdle.func = MyIdleEvent;
  709. evtIdle.focus = NULL;
  710. RegisterEvent( (EVT far *)&evtIdle );
  711. Thread = CreateThread( NULL,
  712. 8192,
  713. (LPTHREAD_START_ROUTINE)EnvThread,
  714. 0,
  715. 0,
  716. &ThreadId
  717. );
  718. if (Thread == NULL) {
  719. DoMessage( "Can't start environment thread" );
  720. UnmapViewOfFile( EditorMemoryPointer );
  721. CloseHandle( EditorSharedMemory );
  722. CloseHandle( EditorStopEvent );
  723. CloseHandle( EditorStartEvent );
  724. return FALSE;
  725. }
  726. if (!SetThreadPriority( Thread, THREAD_PRIORITY_ABOVE_NORMAL )) {
  727. DoMessage( "Can't set priority of environment thread" );
  728. }
  729. return TRUE;
  730. }
  731. #if _MSC_FULL_VER >= 13008827
  732. #pragma warning(push)
  733. #pragma warning(disable:4715) // Not all control paths return (due to infinite loop)
  734. #endif
  735. DWORD
  736. EnvThread(
  737. PVOID Parameter
  738. )
  739. {
  740. while( TRUE ) {
  741. WaitForStartEvent();
  742. }
  743. Parameter;
  744. return 0;
  745. }
  746. #if _MSC_FULL_VER >= 13008827
  747. #pragma warning(pop)
  748. #endif
  749. struct swiDesc swiTable[] = {
  750. { "iconizeonexit", toPIF(iconizeOnExit), SWI_BOOLEAN },
  751. {0, 0, 0},
  752. {0, 0, 0},
  753. {0, 0, 0}
  754. };
  755. struct cmdDesc cmdTable[] = {
  756. {"startext", StartExt, 0, NOARG },
  757. { "MapCase", Case, 0, NOARG | NULLARG | LINEARG | BOXARG | NUMARG },
  758. { "BuildMessage", ShowBuildMessage, 0, NOARG | NULLARG | TEXTARG },
  759. { "SlmOut", SlmOut, 0, NOARG | NULLARG | TEXTARG },
  760. { NULL, (funcCmd)NULL, 0, 0 }
  761. };
  762. void EXTERNAL WhenLoaded(void)
  763. {
  764. if (StartExtLoaded()) {
  765. CountMsgFiles = 0;
  766. DoMessage("MEPPARTY extensions loaded.");
  767. }
  768. }