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.

87 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. encrypt.cxx
  5. Abstract:
  6. Contains routine to check whether encryption is supported on this
  7. system or not.
  8. Author:
  9. Mike Swift (MikeSw) 2-Aug-1994
  10. Revision History:
  11. ChandanS 03-Aug-1996 Stolen from net\svcdlls\ntlmssp\common\encrypt.c
  12. --*/
  13. #include <windows.h>
  14. #include <stdlib.h>
  15. #include <string.h>
  16. #include <rpc.h>
  17. extern "C"
  18. BOOLEAN
  19. IsEncryptionPermitted(VOID)
  20. /*++
  21. Routine Description:
  22. This routine checks whether encryption is getting the system default
  23. LCID and checking whether the country code is CTRY_FRANCE.
  24. Arguments:
  25. none
  26. Return Value:
  27. TRUE - encryption is permitted
  28. FALSE - encryption is not permitted
  29. --*/
  30. {
  31. //
  32. // sfield: permission to remove FRANCE check obtained 08-21-1999
  33. //
  34. #if 0
  35. LCID DefaultLcid;
  36. WCHAR CountryCode[10];
  37. ULONG CountryValue;
  38. DefaultLcid = GetSystemDefaultLCID();
  39. //
  40. // Check if the default language is Standard French
  41. //
  42. if (LANGIDFROMLCID(DefaultLcid) == 0x40c) {
  43. return(FALSE);
  44. }
  45. //
  46. // Check if the users's country is set to FRANCE
  47. //
  48. if (GetLocaleInfo(DefaultLcid,LOCALE_ICOUNTRY,CountryCode,10) == 0) {
  49. return(FALSE);
  50. }
  51. CountryValue = (ULONG) wcstol(CountryCode,NULL,10);
  52. if (CountryValue == CTRY_FRANCE) {
  53. return(FALSE);
  54. }
  55. #endif
  56. return(TRUE);
  57. }