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.

60 lines
2.0 KiB

  1. #define ERROR_ONLY_VERSION_STAMP 1
  2. #define ERROR_NO_RESOURCES 2
  3. #define ERROR_LANGUAGE_NOT_IN_SOURCE 3
  4. #define ERROR_NO_SOURCE 4
  5. #define ERROR_NO_TARGET 5
  6. #define ERROR_NO_LANGUAGE_SPECIFIED 6
  7. #define ERROR_TOO_FEW_ARGUMENTS 7
  8. #define DEPENDENT_RESOURCE_REMOVED 8
  9. #define ERROR_OFFSET 100
  10. #define ADDED_EXT ".RES"
  11. #define ASCII_OFFSET 48
  12. #define RESOURCE_CHECK_SUM L"ResourceChecksum"
  13. #define GetFilePointer(hFile) SetFilePointer(hFile, 0, NULL, FILE_CURRENT)
  14. #define GetVLFilePointer(hFile, lpPositionHigh) \
  15. (*lpPositionHigh = 0, \
  16. SetFilePointer(hFile, 0, lpPositionHigh, FILE_CURRENT))
  17. #define MD5_CHECKSUM_SIZE 16
  18. struct CommandLineInfo {
  19. char *pszSource;
  20. char *pszTarget;
  21. HANDLE hFile;
  22. WORD wLanguage;
  23. char **pszIncResType;
  24. BOOL bContainsOnlyVersion;
  25. BOOL bContainsResources;
  26. BOOL bLanguageFound;
  27. BOOL bIncDependent;
  28. BOOL bIncludeFlag;
  29. BOOL bVerbose;
  30. char *pszChecksumFile;
  31. BOOL bIsResChecksumGenerated;
  32. unsigned char pResourceChecksum[MD5_CHECKSUM_SIZE];
  33. };
  34. typedef struct CommandLineInfo *pCommandLineInfo;
  35. void PutByte(HANDLE OutFile, TCHAR b, LONG *plSize1, LONG *plSize2);
  36. void PutWord(HANDLE OutFile, WORD w, LONG *plSize1, LONG *plSize2);
  37. void PutDWord (HANDLE OutFile, DWORD l, LONG *plSize1, LONG *plSize2);
  38. void PutString(HANDLE OutFile, LPCSTR szStr , LONG *plSize1, LONG *plSize2);
  39. void PutStringW(HANDLE OutFile, LPCWSTR szStr , LONG *plSize1, LONG *plSize2);
  40. void PutPadding(HANDLE OutFile, int paddingCount, LONG *plSize1, LONG *plSize2);
  41. void Usage();
  42. void CleanUp(pCommandLineInfo pInfo, HANDLE hModule, BOOL bDeleteFile);
  43. void FreeAll(pCommandLineInfo pInfo);
  44. BOOL ParseCommandLine(int argc, char *argv[], pCommandLineInfo pInfo);
  45. BOOL CALLBACK EnumTypesFunc(HMODULE hModule, LPTSTR lpType, LONG_PTR lParam);
  46. BOOL CALLBACK EnumNamesFunc(HMODULE hModule, LPCTSTR lpType, LPTSTR lpName, LONG_PTR lParam);
  47. BOOL bTypeIncluded(LPCSTR pszType, char **pszIncResType);
  48. BOOL bInsertHeader(HANDLE hFile);