msgqueue.pp 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2008 Free Pascal development team.
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. ********************************************************************** }
  10. //
  11. // msgqueue.h - Message queue point-to-point.
  12. //
  13. //
  14. // Microsoft Windows Mobile 6.0 for PocketPC SDK.
  15. //
  16. {$IFNDEF FPC_DOTTEDUNITS}
  17. unit MsgQueue;
  18. {$ENDIF FPC_DOTTEDUNITS}
  19. {$CALLING cdecl}
  20. interface
  21. {$IFDEF FPC_DOTTEDUNITS}
  22. uses WinApi.Windows;
  23. {$ELSE FPC_DOTTEDUNITS}
  24. uses Windows;
  25. {$ENDIF FPC_DOTTEDUNITS}
  26. // Declarations of constants and structures transferred from winbase.h.
  27. const
  28. MSGQUEUE_NOPRECOMMIT = $00000001;
  29. MSGQUEUE_ALLOW_BROKEN = $00000002;
  30. MSGQUEUE_MSGALERT = $00000001;
  31. type
  32. MSGQUEUEOPTIONS_OS = record
  33. dwSize:DWORD; // size of the structure
  34. dwFlags:DWORD; // behavior of message queue
  35. dwMaxMessages:DWORD; // max # of msgs in queue
  36. cbMaxMessage:DWORD; // max size of msg
  37. bReadAccess:BOOL; // read access requested
  38. end;
  39. MSGQUEUEOPTIONS = MSGQUEUEOPTIONS_OS;
  40. LPMSGQUEUEOPTIONS = ^MSGQUEUEOPTIONS_OS;
  41. PMSGQUEUEOPTIONS = ^MSGQUEUEOPTIONS_OS;
  42. type
  43. MSGQUEUEINFO = record
  44. dwSize:DWORD; // size of structure
  45. dwFlags:DWORD; // behavior of message queue
  46. dwMaxMessages:DWORD; // max # of msgs in queue
  47. cbMaxMessage:DWORD; // max size of msg
  48. dwCurrentMessages:DWORD; // # of message in queue currently
  49. dwMaxQueueMessages:DWORD; // high water mark of queue
  50. wNumReaders:word; // # of readers
  51. wNumWriters:word; // # of writes
  52. end;
  53. PMSGQUEUEINFO = ^MSGQUEUEINFO;
  54. LPMSGQUEUEINFO = ^MSGQUEUEINFO;
  55. function CreateMsgQueue(lpName:LPCWSTR; lpOptions:LPMSGQUEUEOPTIONS):HANDLE; external KernelDLL name 'CreateMsgQueue'; // index 111
  56. function OpenMsgQueue(hSrcProc:HANDLE; hMsgQ:HANDLE; lpOptions:LPMSGQUEUEOPTIONS):HANDLE; external KernelDLL name 'OpenMsgQueue'; // index 116
  57. function ReadMsgQueue(hMsgQ:HANDLE;
  58. lpBuffer:LPVOID;
  59. cbBufferSize:DWORD;
  60. lpNumberOfBytesRead:LPDWORD;
  61. dwTimeout:DWORD;
  62. pdwFlags:LPDWORD):BOOL; external KernelDLL name 'ReadMsgQueue'; // index 112
  63. function WriteMsgQueue(hMsgQ:HANDLE;
  64. lpBuffer:LPVOID;
  65. cbDataSize:DWORD;
  66. dwTimeout:DWORD;
  67. dwFlags:DWORD):BOOL; external KernelDLL name 'WriteMsgQueue'; // index 113
  68. function GetMsgQueueInfo(hMsgQ:HANDLE; lpInfo:LPMSGQUEUEINFO):BOOL; external KernelDLL name 'GetMsgQueueInfo'; // index 114
  69. function CloseMsgQueue(hMsgQ:HANDLE):BOOL; external KernelDLL name 'CloseMsgQueue'; // index 115
  70. implementation
  71. end.