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.

69 lines
2.3 KiB

  1. #ifndef _TOKENAPI_H_
  2. #define _TOKENAPI_H_
  3. #define MAXINPUTBUFFER 564 // Longest supported line in the token file
  4. #define MAXTOKENBUFFER 1024 // Size for the t_token struct plus the strings
  5. #define MAXFILENAME 256 // maximum length of file pathname
  6. #define MAXCUSTFILTER 40 // maximum size of custom filter buffer
  7. #define CCHNPMAX 65535 // max number of bytes in a notepad file
  8. // Token flag Masks
  9. #define ISPOPUP 0x0001
  10. #define ISCOR 0x0010
  11. #define ISDUP 0x0020
  12. #define ISCAP 0x0040
  13. #define ISDLGFONTNAME 0x0004
  14. #define ISDLGFONTSIZE 0x0008
  15. #define ISALIGN 0x0080
  16. #define ISKEY 0x0010
  17. #define ISVAL 0x0020
  18. // status bits
  19. #define ST_TRANSLATED 4
  20. #define ST_READONLY 2
  21. #define ST_NEW 1
  22. #define ST_DIRTY 1
  23. #define ST_CHANGED 4
  24. #define TOKENSTRINGBUFFER 260
  25. #define MAXTEXTLEN (4096+TOKENSTRINGBUFFER)
  26. // Increased buffer size of TokeString and TokenText to 260
  27. // I increased to 260 and not 256 to be on the safe side. (PW)
  28. // DHW - For Message Resource Table tokens, the high word of the ulong ID# is
  29. // now stored as a string in the szName field. String is result of _itoa().
  30. // MHotchin - Converted to szText field to a pointer, for var length text fields
  31. // Added a new constant - MAXTEXTLEN is the longest token text we are
  32. // willing to handle.
  33. #pragma pack(1)
  34. struct t_token {
  35. WORD wType; // Type of the token
  36. WORD wName; // Name ID of token, 65535 => contains TokenString
  37. WORD wID; // Token item ID or duplicated number
  38. WORD wFlag; // =0 -> ID is unique
  39. // >0 -> ID not unique
  40. WORD wLangID; // Locale ID for Win32 resources
  41. WORD wReserved; // Not used now
  42. TCHAR szType[TOKENSTRINGBUFFER]; // Pointer to type string (Not yet used.)
  43. TCHAR szName[TOKENSTRINGBUFFER]; // Pointer to name string, or msg ID hiword
  44. TCHAR *szText; // Pointer to the text for the token
  45. };
  46. typedef struct t_token TOKEN;
  47. int GetToken( FILE * , TOKEN * );
  48. int PutToken( FILE * , TOKEN * );
  49. int FindToken( FILE * , TOKEN * , WORD);
  50. void ParseTokToBuf( TCHAR *, TOKEN * );
  51. void ParseBufToTok( TCHAR *, TOKEN * );
  52. int TokenToTextSize( TOKEN *);
  53. #pragma pack()
  54. #endif // _TOKENAPI_H_