Source code of Windows XP (NT5)
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.

79 lines
1.3 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. MikeSw 06-Oct-1996 Stolen from security\msv_sspi\encrypt.cxx
  13. --*/
  14. #include <lsapch.hxx>
  15. extern "C"
  16. BOOLEAN
  17. LsapIsEncryptionPermitted(
  18. VOID
  19. )
  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. LCID DefaultLcid;
  32. WCHAR CountryCode[10];
  33. ULONG CountryValue;
  34. DefaultLcid = GetSystemDefaultLCID();
  35. //
  36. // Check if the default language is Standard French
  37. //
  38. if (LANGIDFROMLCID(DefaultLcid) == 0x40c) {
  39. return(FALSE);
  40. }
  41. //
  42. // Check if the users's country is set to FRANCE
  43. //
  44. if (GetLocaleInfoW(DefaultLcid,LOCALE_ICOUNTRY,CountryCode,10) == 0) {
  45. return(FALSE);
  46. }
  47. CountryValue = (ULONG) wcstol(CountryCode,NULL,10);
  48. if (CountryValue == CTRY_FRANCE) {
  49. return(FALSE);
  50. }
  51. return(TRUE);
  52. }