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.

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