home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 217 / DPCS0306DVD.ISO / Toolkit / Internet / FileZilla / Server / FileZilla_Server-0.9.11.exe / source / StdAfx.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-03-21  |  4.9 KB  |  203 lines

  1. // FileZilla Server - a Windows ftp server
  2.  
  3. // Copyright (C) 2002-2004 - Tim Kosse <tim.kosse@gmx.de>
  4.  
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9.  
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14.  
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. // stdafx.h : Include-Datei fⁿr Standard-System-Include-Dateien,
  20. //  oder projektspezifische Include-Dateien, die hΣufig benutzt, aber
  21. //      in unregelmΣ▀igen AbstΣnden geΣndert werden.
  22. //
  23.  
  24. #if !defined(AFX_STDAFX_H__0D7D6CEC_E1AA_4287_BB10_A97FA4D444B6__INCLUDED_)
  25. #define AFX_STDAFX_H__0D7D6CEC_E1AA_4287_BB10_A97FA4D444B6__INCLUDED_
  26.  
  27. #if _MSC_VER > 1000
  28. #pragma once
  29. #endif // _MSC_VER > 1000
  30.  
  31. #define WIN32_LEAN_AND_MEAN        // Selten verwendete Teile der Windows-Header nicht einbinden
  32.  
  33. #pragma warning (disable : 4786)
  34.  
  35. #include <windows.h>
  36. #include <crtdbg.h>
  37. #include <stddef.h>
  38.  
  39. #include <wtypes.h>
  40. #include <oleauto.h>
  41. #include "atlconv.h"
  42.  
  43. #include "shlobj.h"
  44.  
  45. #include "config.h"
  46.  
  47. #include "misc\stdstring.h"
  48.  
  49. #include "MFC64bitFix.h"
  50. #include <map>
  51. #include <list>
  52. #include <vector>
  53. #include <set>
  54.  
  55. #ifdef MMGR
  56. #include "misc/mmgr.h"
  57. #endif
  58.  
  59. #include "AsyncSocketEx.h"
  60.  
  61. #define FILEZILLA_SERVER_MESSAGE _T("FileZilla Server Message")
  62. #define FILEZILLA_THREAD_MESSAGE _T("FileZilla Thread Message")
  63.  
  64. const UINT WM_FILEZILLA_RELOADCONFIG = WM_APP;
  65. const UINT WM_FILEZILLA_SERVERMSG = (WM_APP + 1);
  66. const UINT WM_FILEZILLA_THREADMSG = ::RegisterWindowMessage(FILEZILLA_THREAD_MESSAGE);
  67.  
  68. #define FSM_STATUSMESSAGE 0
  69. #define FSM_CONNECTIONDATA 1
  70. #define FSM_THREADCANQUIT 2
  71. #define FSM_SEND 3
  72. #define FSM_RECV 4
  73.  
  74. #define FTM_NEWSOCKET 0
  75. #define FTM_DELSOCKET 1
  76. #define FTM_COMMAND 2
  77. #define FTM_TRANSFERMSG 3
  78. #define FTM_GOOFFLINE 4
  79. #define FTM_CONTROL 5
  80. #define FTM_NEWSOCKET_SSL 6
  81.  
  82. #define USERCONTROL_GETLIST 0
  83. #define USERCONTROL_CONNOP 1
  84. #define USERCONTROL_KICK 2
  85.  
  86. #define USERCONTROL_CONNOP_ADD 0
  87. #define USERCONTROL_CONNOP_CHANGEUSER 1
  88. #define USERCONTROL_CONNOP_REMOVE 2
  89. #define USERCONTROL_CONNOP_TRANSFERINIT 3
  90. #define USERCONTROL_CONNOP_TRANSFEROFFSETS 4
  91.  
  92. typedef struct
  93. {
  94.     int command;
  95.     int socketid;
  96. } t_controlmessage;
  97.  
  98. typedef struct
  99. {
  100.     TCHAR ip[16];
  101.     char *user;
  102.     SYSTEMTIME time;
  103.     UINT userid;
  104.     int type;
  105.     char *status;
  106. } t_statusmsg;
  107.  
  108. class CServerThread;
  109. typedef struct
  110. {
  111.     int userid;
  112.     
  113.     // Set only by USERCONTROL_CONNOP_CHANGEUSER messages
  114.     CStdString user;
  115.  
  116.     // Set only by USERCONTROL_CONNOP_ADD messages
  117.     TCHAR ip[16];
  118.     unsigned int port;
  119.     CServerThread *pThread;
  120.  
  121.     // Set only by USERCONTROL_CONNOP_TRANSFERINFO messages
  122.     unsigned char transferMode;
  123.     CStdString physicalFile;
  124.     CStdString logicalFile;
  125.     __int64 currentOffset;
  126.     __int64 totalSize;
  127. } t_connectiondata;
  128.  
  129. struct t_connectiondata_add
  130. {
  131.     TCHAR ip[16];
  132.     unsigned int port;
  133.     CServerThread *pThread;
  134. };
  135.  
  136. struct t_connectiondata_changeuser
  137. {
  138.     CStdString user;
  139. };
  140.  
  141. struct t_connectiondata_transferinfo
  142. {
  143.     unsigned char transferMode;
  144.     CStdString physicalFile;
  145.     CStdString logicalFile;
  146.     __int64 startOffset;
  147.     __int64 totalSize;
  148. };
  149.  
  150. struct t_connectiondata_transferoffsets
  151. {
  152.     unsigned char* pData;
  153.     int len;
  154. };
  155.  
  156. typedef struct
  157. {
  158.     void *data;
  159.     int op;
  160.     int userid;
  161. } t_connop;
  162.  
  163. extern HWND hMainWnd;
  164. #ifndef CCRITICALSECTIONWRAPPERINCLUDED
  165. class CCriticalSectionWrapper
  166. {
  167. public:
  168.     CCriticalSectionWrapper();
  169.     ~CCriticalSectionWrapper();
  170.     
  171.     void Lock();
  172.     void Unlock();
  173.  
  174. #ifndef DEADLOCKDEBUG
  175. protected:
  176. #else
  177. public:
  178. #endif
  179.     CRITICAL_SECTION m_criticalSection;
  180.     BOOL m_bInitialized;
  181. #ifdef DEBUG
  182.     int m_lockCount;
  183. #endif
  184.  
  185. };
  186. #define CCRITICALSECTIONWRAPPERINCLUDED
  187. #endif
  188.  
  189. #ifndef DEADLOCKDEBUG
  190. #define EnterCritSection(section) section.Lock()
  191. #define LeaveCritSection(section) section.Unlock()
  192. #else
  193. void EnterCritSectionDebug(CCriticalSectionWrapper §ion, const char *pFile, int line);
  194. void LeaveCritSectionDebug(CCriticalSectionWrapper §ion, const char *pFile, int line);
  195. #define EnterCritSection(section) EnterCritSectionDebug(section, __FILE__, __LINE__)
  196. #define LeaveCritSection(section) LeaveCritSectionDebug(section, __FILE__, __LINE__)
  197. #endif
  198.  
  199. //{{AFX_INSERT_LOCATION}}
  200. // Microsoft Visual C++ fⁿgt unmittelbar vor der vorhergehenden Zeile zusΣtzliche Deklarationen ein.
  201.  
  202. #endif // !defined(AFX_STDAFX_H__0D7D6CEC_E1AA_4287_BB10_A97FA4D444B6__INCLUDED_)
  203.