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.

52 lines
1.8 KiB

  1. /***********************************************************************
  2. *
  3. * At Work Fax: FAX Inter Process Communication
  4. *
  5. *
  6. * Copyright 1992, 1993 Microsoft Corporation. All Rights Reserved.
  7. *
  8. *
  9. ***********************************************************************/
  10. // Message queue structure: This lives in shared memory
  11. typedef struct _IPC_MSG {
  12. UINT uMessageId; // Message Identifier
  13. WPARAM wParam; // wParam message specific data
  14. LPARAM lParam; // lParam message specific data
  15. } IPC_MSG, *LPIPC_MSG;
  16. // Message queue header: This lives at the top of shared memory
  17. typedef struct _IPC_QUEUE {
  18. DWORD cEntries; // Count of entries in queue
  19. DWORD cMaxEntries; // Maximum number of entries to fit in queue
  20. IPC_MSG Messages[]; // Queue of entries
  21. } IPC_QUEUE, *LPIPC_QUEUE;
  22. // IPC structure: This lives in local memory of each process
  23. typedef struct _FAX_IPC {
  24. HANDLE hevNew; // Event handle to be triggered on new data
  25. HANDLE hmtxAccess; // Mutex handle to control access to IPC queue
  26. HANDLE hMapFile; // Mapped File handle
  27. LPIPC_QUEUE lpQueue; // Pointer to queue of IPC messages
  28. } FAX_IPC, *LPFAX_IPC;
  29. #define ERROR_APPLICATION_DEFINED 0x20000000
  30. #define FAXIPC_ERROR_QUEUE_FULL (ERROR_APPLICATION_DEFINED | 1)
  31. //
  32. // Function Templates
  33. //
  34. LPFAX_IPC IPCOpen(PUCHAR lpName);
  35. BOOL IPCPost(LPFAX_IPC lpIPC, UINT uMessageId, WPARAM wParam, LPARAM lParam);
  36. BOOL IPCGetMessage(LPFAX_IPC lpIPC, PUINT lpuMessageId, WPARAM * lpwParam,
  37. LPARAM * lplParam, UINT uMsgFilterMin, UINT uMsgFilterMax, DWORD dwTimeout);
  38. BOOL IPCWait(LPFAX_IPC lpIPC, PUINT lpuMessageId, WPARAM * lpwParam,
  39. LPARAM * lplParam, DWORD dwTimeout);
  40. BOOL IPCTest(LPFAX_IPC lpIPC);
  41. BOOL IPCClear(LPFAX_IPC lpIPC);
  42. BOOL IPCClose(LPFAX_IPC lpIPC);