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.

71 lines
1.9 KiB

  1. #include <windows.h>
  2. #include <wininet.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. // Status Constants
  7. #define CONNECTED 1
  8. #define CONNECTING 2
  9. #define REQUEST_OPENING 3
  10. #define REQUEST_OPENED 4
  11. #define LDG_STARTING 5
  12. #define LDG_START 6
  13. #define LDG_LDG 7
  14. #define LDG_RDY 8
  15. #define LDG_DONE 9
  16. // Priority Constants
  17. #define LOW 1
  18. #define MEDIUM 2
  19. #define HIGH 3
  20. #define BUF_SIZE 8192
  21. #define BUF_NUM 16
  22. #define URLMAX 4
  23. #define TIMEOUT 60000
  24. #define MAX_SCHEME_LENGTH 64
  25. //MESSAGE ID'S
  26. #define DOWNLOAD_DONE WM_USER + 1
  27. #define DOWNLOAD_OPEN_REQUEST WM_USER + 2
  28. #define DOWNLOAD_SEND_REQUEST WM_USER + 3
  29. #define DOWNLOAD_READ_FILE WM_USER + 4
  30. typedef struct
  31. {
  32. TCHAR *pURLName; //The name of the URL
  33. TCHAR szRHost[INTERNET_MAX_HOST_NAME_LENGTH]; //from crackUrl
  34. TCHAR szRPath[INTERNET_MAX_PATH_LENGTH]; //from crackUrl
  35. TCHAR szRScheme[MAX_SCHEME_LENGTH]; //from crackUrl
  36. INTERNET_PORT nPort; //from crackUrl
  37. INTERNET_SCHEME nScheme; //from crackUrl
  38. void *pNext; //pointer to next element
  39. } url_info;
  40. typedef struct
  41. {
  42. url_info *pHead;
  43. } url_info_cache;
  44. typedef struct
  45. {
  46. url_info *pURLInfo; //Url info struct
  47. INT iStatus; //the url's status
  48. INT iPriority; //the url's priority
  49. // LOW, MEDIUM, or HIGH
  50. DWORD lNumRead; //number of bytes read in buffer
  51. void *pNext; //pointer to next element
  52. HINTERNET hInetCon; //Internet connection
  53. HINTERNET hInetReq; //Internet Request
  54. } outQ;
  55. //
  56. void callOpenRequest(outQ *pOutQ);
  57. void callSendRequest(outQ *pOutQ);
  58. void callReadFile(outQ *pOutQ);
  59. BOOL getServerName(outQ *pOutQ);