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.

152 lines
4.1 KiB

  1. /*******************************************************************************
  2. *
  3. * rdpcfgex.c
  4. *
  5. * WinCfg extension DLL
  6. *
  7. * Copyright (c) 1997, Microsoft Corporation
  8. * All rights reserved.
  9. *
  10. *******************************************************************************/
  11. #include <windows.h>
  12. #include <tscfgex.h>
  13. #include "rdpcfgex.h"
  14. #include <ntverp.h>
  15. //
  16. // This global variable is returned to TSCFG and is used to populate the
  17. // Encryption Level field.
  18. //
  19. const EncryptionLevel EncryptionLevels[] = {
  20. { IDS_LOW, REG_LOW, 0 },
  21. { IDS_COMPATIBLE, REG_MEDIUM, ELF_DEFAULT },
  22. { IDS_HIGH, REG_HIGH, 0 },
  23. { IDS_FIPS, REG_FIPS, 0 }
  24. };
  25. /////////////////////////////////////////////////////////////////////////////
  26. // DllMain
  27. //
  28. // Main entry point of the DLL
  29. //
  30. BOOL APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  31. {
  32. #if defined(FULL_DEBUG)
  33. OutputDebugString(TEXT("RDPCFGX: DllMain Called\n"));
  34. #endif
  35. return TRUE;
  36. }
  37. /////////////////////////////////////////////////////////////////////////////
  38. // ExtStart
  39. //
  40. // WinCfg calls this function immediately after loading the DLL
  41. // Put any global initialization stuff here
  42. //
  43. void WINAPI ExtStart(WDNAME *pWdName)
  44. {
  45. #if defined(FULL_DEBUG)
  46. OutputDebugString(TEXT("RDPCFGX: ExtStart Called\n"));
  47. #endif
  48. }
  49. /////////////////////////////////////////////////////////////////////////////
  50. // ExtEnd
  51. //
  52. // WinCfg calls this function when exiting
  53. // Put any global cleanup stuff here
  54. //
  55. void WINAPI ExtEnd()
  56. {
  57. #if defined(FULL_DEBUG)
  58. OutputDebugString(TEXT("RDPCFGX: ExtEnd Called\n"));
  59. #endif
  60. }
  61. //-------------------------------------------------------------------------
  62. // We need to be compatible with citrix, modifying EncryptionLevel struct
  63. // would cause some undesirable results on a metaframe server. Currently
  64. // the MS ext will support description for the encryption levels.
  65. // When TSCC obtains the extension config dll it will getproc this method
  66. // failure indicates that we have a non-MS cfgdll
  67. //
  68. LONG WINAPI ExtGetEncryptionLevelDescr( int idx , int *pnResid )
  69. {
  70. switch( idx )
  71. {
  72. case REG_LOW:
  73. *pnResid = IDS_LOW_DESCR;
  74. break;
  75. case REG_MEDIUM:
  76. *pnResid = IDS_COMPATIBLE_DESCR;
  77. break;
  78. case REG_HIGH:
  79. *pnResid = IDS_HI_DESCR;
  80. break;
  81. case REG_FIPS:
  82. *pnResid = IDS_FIPS_DESCR;
  83. break;
  84. default:
  85. #if DBG
  86. OutputDebugString(TEXT("RDPCFGX: ExtGetEncryptionLevelDescr - invalid arg\n"));
  87. #endif
  88. *pnResid = 0;
  89. }
  90. return ( *pnResid ? 0 : -1 );
  91. }
  92. //-------------------------------------------------------------------------
  93. // VER_PRODUCTVERSION_DW defined in ntverp.h
  94. //-------------------------------------------------------------------------
  95. DWORD WINAPI ExGetCfgVersionInfo( void )
  96. {
  97. return VER_PRODUCTVERSION_DW;
  98. }
  99. /////////////////////////////////////////////////////////////////////////////
  100. // ExtEncryptionLevels
  101. //
  102. // Provide array of encryption levels for this protocol
  103. // Returns the number of encryption levels in the array
  104. //
  105. LONG WINAPI ExtEncryptionLevels(WDNAME *pWdName, EncryptionLevel **levels)
  106. {
  107. #if defined(FULL_DEBUG)
  108. OutputDebugString(TEXT("RDPCFGX: ExtEncryptionLevels Called\n"));
  109. #endif
  110. *levels = (EncryptionLevel *)EncryptionLevels;
  111. return NUM_RDP_ENCRYPTION_LEVELS;
  112. }
  113. /////////////////////////////////////////////////////////////////////////////
  114. // ExtGetCapabilities
  115. //
  116. // This routine returns a ULONG which contains a mask of the different
  117. // Client settings that the RDP protocol supports.
  118. //
  119. ULONG WINAPI ExtGetCapabilities(void)
  120. {
  121. return ( WDC_CLIENT_AUDIO_MAPPING |
  122. WDC_CLIENT_DRIVE_MAPPING |
  123. WDC_WIN_CLIENT_PRINTER_MAPPING |
  124. WDC_CLIENT_LPT_PORT_MAPPING |
  125. WDC_CLIENT_COM_PORT_MAPPING |
  126. WDC_CLIENT_CLIPBOARD_MAPPING |
  127. // left here for backwards compatibility
  128. WDC_SHADOWING );
  129. }