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.

108 lines
2.1 KiB

  1. #include "faxrtp.h"
  2. #pragma hdrstop
  3. typedef struct _STRING_TABLE {
  4. DWORD ResourceId;
  5. DWORD InternalId;
  6. LPCTSTR String;
  7. } STRING_TABLE, *PSTRING_TABLE;
  8. static STRING_TABLE StringTable[] =
  9. {
  10. { IDS_SERVICE_NAME, IDS_SERVICE_NAME, NULL },
  11. { IDS_UNKNOWN_SENDER, IDS_UNKNOWN_SENDER, NULL },
  12. { IDS_UNKNOWN_RECIPIENT, IDS_UNKNOWN_RECIPIENT, NULL }
  13. };
  14. #define CountStringTable (sizeof(StringTable)/sizeof(STRING_TABLE))
  15. VOID
  16. InitializeStringTable(
  17. VOID
  18. )
  19. {
  20. DWORD i;
  21. TCHAR Buffer[256];
  22. for (i=0; i<CountStringTable; i++)
  23. {
  24. if (LoadString(
  25. g_hResource,
  26. StringTable[i].ResourceId,
  27. Buffer,
  28. ARR_SIZE(Buffer)
  29. ))
  30. {
  31. StringTable[i].String = (LPCTSTR) MemAlloc( StringSize( Buffer ) );
  32. if (!StringTable[i].String)
  33. {
  34. StringTable[i].String = TEXT("");
  35. }
  36. else
  37. {
  38. _tcscpy( (LPTSTR)StringTable[i].String, Buffer );
  39. }
  40. } else
  41. {
  42. StringTable[i].String = TEXT("");
  43. }
  44. }
  45. }
  46. LPCTSTR
  47. GetString(
  48. DWORD InternalId
  49. )
  50. /*++
  51. Routine Description:
  52. Loads a resource string and returns a pointer to the string.
  53. The caller must free the memory.
  54. Arguments:
  55. ResourceId - resource string id
  56. Return Value:
  57. pointer to the string
  58. --*/
  59. {
  60. DWORD i;
  61. for (i=0; i<CountStringTable; i++)
  62. {
  63. if (StringTable[i].InternalId == InternalId)
  64. {
  65. return StringTable[i].String;
  66. }
  67. }
  68. return NULL;
  69. }
  70. DWORD
  71. GetMaskBit(
  72. LPCWSTR RoutingGuid
  73. )
  74. {
  75. if (_tcsicmp( RoutingGuid, REGVAL_RM_EMAIL_GUID ) == 0) {
  76. return LR_EMAIL;
  77. } else if (_tcsicmp( RoutingGuid, REGVAL_RM_FOLDER_GUID ) == 0) {
  78. return LR_STORE;
  79. } else if (_tcsicmp( RoutingGuid, REGVAL_RM_PRINTING_GUID ) == 0) {
  80. return LR_PRINT;
  81. }
  82. return 0;
  83. }