Source code of Windows XP (NT5)
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.

115 lines
3.4 KiB

  1. /**************************************************************************
  2. *
  3. * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. * PURPOSE.
  7. *
  8. * Copyright (c) 1992-1995 Microsoft Corporation
  9. *
  10. * MSMCIVCR.C
  11. *
  12. * Description:
  13. *
  14. * Runs the background VCR task in NT.
  15. *
  16. * Notes:
  17. *
  18. * WinMain() - calls initialization function, processes message loop
  19. *
  20. **************************************************************************/
  21. #define UNICODE
  22. #include <windows.h> // required for all Windows applications
  23. #include <windowsx.h>
  24. #ifdef DEBUG
  25. #define DOUTSTR(a) OutputDebugString(a);
  26. #else
  27. #define DOUTSTR(a) //
  28. #endif
  29. #if !defined(_WIN32) // Windows 3.x uses a FARPROC for dialogs
  30. #define DLGPROC FARPROC
  31. #endif
  32. #if !defined (APIENTRY) // Windows NT defines APIENTRY, but 3.x doesn't
  33. #define APIENTRY far pascal
  34. #endif
  35. HINSTANCE hInst; // current instance
  36. /****************************************************************************
  37. FUNCTION: WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
  38. PURPOSE: calls initialization function, processes message loop
  39. COMMENTS:
  40. Windows recognizes this function by name as the initial entry point
  41. for the program. This function calls the application initialization
  42. routine, if no other instance of the program is running, and always
  43. calls the instance initialization routine. It then executes a message
  44. retrieval and dispatch loop that is the top-level control structure
  45. for the remainder of execution. The loop is terminated when a WM_QUIT
  46. message is received, at which time this function exits the application
  47. instance by returning the value passed by PostQuitMessage().
  48. If this function must abort before entering the message loop, it
  49. returns the conventional value NULL.
  50. ****************************************************************************/
  51. int APIENTRY WinMain(
  52. HINSTANCE hInstance,
  53. HINSTANCE hPrevInstance,
  54. LPSTR lpCmdLine,
  55. int nCmdShow)
  56. {
  57. MSG msg;
  58. HINSTANCE hLibrary;
  59. FARPROC lpFunc;
  60. /* Perform initializations that apply to a specific instance */
  61. DOUTSTR(L"** ** ** ** ** ** We are in the process...\n")
  62. hLibrary = LoadLibrary(L"mcivis32.dll"); // It's DLL in NT.
  63. if(!hLibrary)
  64. {
  65. DOUTSTR(L"===Error mcivisca.drv not found.\n")
  66. }
  67. lpFunc = GetProcAddress(hLibrary, "viscaTaskCommNotifyHandlerProc");
  68. if(lpFunc != (FARPROC)NULL)
  69. {
  70. (*lpFunc)((DWORD)hInstance);
  71. }
  72. else
  73. {
  74. DOUTSTR(L"Null function in msmcivcr.exe\n")
  75. }
  76. DOUTSTR(L"Going into message loop in msmcivcr.exe.\n")
  77. /* Acquire and dispatch messages until a WM_QUIT message is received. */
  78. while (GetMessage(&msg, // message structure
  79. (HWND)NULL, // handle of window receiving the message
  80. 0, // lowest message to examine
  81. 0)) // highest message to examine
  82. {
  83. TranslateMessage(&msg); // Translates virtual key codes
  84. DispatchMessage(&msg); // Dispatches message to window
  85. }
  86. DOUTSTR(L"MsMciVcr.Exe Quitting _Goodbye_ *hei*.\n")
  87. FreeLibrary(hLibrary);
  88. return (msg.wParam); // Returns the value from PostQuitMessage
  89. lpCmdLine; // This will prevent 'unused formal parameter' warnings
  90. }