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.

148 lines
3.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: precomp.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /*
  11. * IRXFER.H
  12. *
  13. *
  14. *
  15. */
  16. #ifndef _IRXFER_H_
  17. #define _IRXFER_H_
  18. #define INC_OLE2
  19. #include <nt.h>
  20. #include <ntrtl.h>
  21. #include <nturtl.h>
  22. #include <windows.h>
  23. #include <commctrl.h>
  24. #include <winuser.h>
  25. #include <mmsystem.h>
  26. #include <pbt.h>
  27. #include <winsock2.h>
  28. #ifndef _WIN32_WINDOWS
  29. #define _WIN32_WINDOWS 0
  30. #endif
  31. #include <af_irda.h>
  32. #include <initguid.h>
  33. #include <shlobj.h>
  34. #include <shellapi.h>
  35. //
  36. // CONNECT_MAXPKT is the size of each network packet, so the actual file data sent
  37. // in each pkt is slightly smaller. Xfer_PutBody calls _Put in chunks of cbSOCK_BUFFER_SIZE,
  38. // so this should be a good multiple of CONNECT_MAXPKT.
  39. //
  40. #if 1
  41. #define MAX_IRDA_PDU (2042)
  42. #define CONNECT_MAXPKT (BYTE2)((MAX_IRDA_PDU*16))
  43. #define cbSOCK_BUFFER_SIZE ( CONNECT_MAXPKT * 2 ) // max amount of data read from/written to sockets at a time
  44. #define cbSTORE_SIZE_RECV ( CONNECT_MAXPKT * 2 ) // size of receive buffer - MUST FIT INTO 2 BYTES
  45. #else
  46. #define CONNECT_MAXPKT (BYTE2)(10000-17)
  47. #define cbSOCK_BUFFER_SIZE ( 60000 ) // max amount of data read from/written to sockets at a time
  48. #define cbSTORE_SIZE_RECV ( 60000 ) // size of receive buffer - MUST FIT INTO 2 BYTES
  49. #endif
  50. #define TEMP_FILE_PREFIX L"infrared"
  51. typedef BYTE BYTE1, *LPBYTE1; // one-byte value
  52. typedef WORD BYTE2, *LPBYTE2; // two-byte value
  53. typedef DWORD BYTE4, *LPBYTE4; // four-byte value
  54. typedef struct {
  55. DWORD dwSize; // size of ab1Store, NOT entire memory block
  56. DWORD dwUsed; // bytes used
  57. DWORD dwOutOffset; // next position to get data from
  58. BYTE1 ab1Store[1]; // actual data
  59. } STORE, *LPSTORE;
  60. typedef enum {
  61. xferRECV = 0,
  62. xferSEND = 1,
  63. xferNONE
  64. } XFER_TYPE, *LPXFER_TYPE;
  65. #define ExitOnErr( err ) { if( err ) goto lExit; }
  66. extern "C"
  67. {
  68. #ifndef ASSERT
  69. //
  70. // If debugging support enabled, define an ASSERT macro that works. Otherwise
  71. // define the ASSERT macro to expand to an empty expression.
  72. //
  73. #if DBG
  74. NTSYSAPI
  75. VOID
  76. NTAPI
  77. RtlAssert(
  78. PVOID FailedAssertion,
  79. PVOID FileName,
  80. ULONG LineNumber,
  81. PCHAR Message
  82. );
  83. #define ASSERT( exp ) \
  84. if (!(exp)) \
  85. RtlAssert( #exp, __FILE__, __LINE__, NULL )
  86. #define ASSERTMSG( msg, exp ) \
  87. if (!(exp)) \
  88. RtlAssert( #exp, __FILE__, __LINE__, msg )
  89. #else
  90. #define ASSERT( exp )
  91. #define ASSERTMSG( msg, exp )
  92. #endif // DBG
  93. #endif // !ASSERT
  94. }
  95. #include "eventlog.h"
  96. #include "log.h"
  97. #include "irsend.h"
  98. #include "irrecv.h"
  99. #include "irtypes.h"
  100. #include "mutex.hxx"
  101. #include "resource.h"
  102. #include "util.h"
  103. #include "store.h"
  104. #include "xfer.h"
  105. #include "xferlist.h"
  106. //extern PXFER_LIST TransferList;
  107. VOID
  108. RemoveFromTransferList(
  109. FILE_TRANSFER * Transfer
  110. );
  111. extern BOOL g_fShutdown;
  112. extern "C" HANDLE g_UserToken;
  113. extern wchar_t g_UiCommandLine[];
  114. BOOL LaunchUi( wchar_t * cmdline );
  115. VOID ChangeByteOrder( void * pb1, UINT uAtomSize, UINT uDataSize );
  116. VOID SetDesktopIconName( LPWSTR lpszTarget, BOOL fWaitForCompletion );
  117. VOID SetSendToIconName( LPWSTR lpszTarget, BOOL fWaitForCompletion );
  118. #endif // _IRXFER_H_