ReactOS 0.4.16-dev-2110-ge3521eb
wcsicmp.cpp File Reference
#include <corecrt_internal.h>
#include <ctype.h>
#include <locale.h>
#include <string.h>
Include dependency graph for wcsicmp.cpp:

Go to the source code of this file.

Functions

int __cdecl _wcsicmp_l (wchar_t const *const lhs, wchar_t const *const rhs, _locale_t const plocinfo)
 
int __cdecl __ascii_wcsicmp (wchar_t const *const lhs, wchar_t const *const rhs)
 
int __cdecl _wcsicmp (wchar_t const *const lhs, wchar_t const *const rhs)
 

Function Documentation

◆ __ascii_wcsicmp()

int __cdecl __ascii_wcsicmp ( wchar_t const *const  lhs,
wchar_t const *const  rhs 
)

Definition at line 75 of file wcsicmp.cpp.

79{
80 unsigned short const * lhs_ptr = reinterpret_cast<unsigned short const *>(lhs);
81 unsigned short const * rhs_ptr = reinterpret_cast<unsigned short const *>(rhs);
82
83 int result;
84 int lhs_value;
85 int rhs_value;
86 do
87 {
88 lhs_value = __ascii_towlower(*lhs_ptr++);
89 rhs_value = __ascii_towlower(*rhs_ptr++);
90 result = lhs_value - rhs_value;
91 }
92 while (result == 0 && lhs_value != 0);
93
94 return result;
95}
GLuint64EXT * result
Definition: glext.h:11304
__forceinline int __CRTDECL __ascii_towlower(int const _C)
Definition: ctype.h:180

Referenced by _wcsicmp(), and _wcsicmp_l().

◆ _wcsicmp()

int __cdecl _wcsicmp ( wchar_t const *const  lhs,
wchar_t const *const  rhs 
)

Definition at line 97 of file wcsicmp.cpp.

101{
102 if (!__acrt_locale_changed())
103 {
104 /* validation section */
105 _VALIDATE_RETURN(lhs != nullptr, EINVAL, _NLSCMPERROR);
106 _VALIDATE_RETURN(rhs != nullptr, EINVAL, _NLSCMPERROR);
107
108 return __ascii_wcsicmp(lhs, rhs);
109 }
110
111 return _wcsicmp_l(lhs, rhs, nullptr);
112}
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
#define EINVAL
Definition: errno.h:44
#define _NLSCMPERROR
Definition: mbstring.h:28
int __cdecl __ascii_wcsicmp(wchar_t const *const lhs, wchar_t const *const rhs)
Definition: wcsicmp.cpp:75
int __cdecl _wcsicmp_l(wchar_t const *const lhs, wchar_t const *const rhs, _locale_t const plocinfo)
Definition: wcsicmp.cpp:39

Referenced by CFSDropTarget::_CopyItems(), _CreateNonspooledPort(), _DoDLLInjection(), CFSDropTarget::_DoDrop(), _LocalEnumPrintersCheckName(), _LocalGetPrintServerHandleData(), _LocalSetPrintServerHandleData(), _PrinterListCompareRoutine(), _tmain(), AccpOpenNamedObject(), AddCodePage(), AddDialogControl(), AddKeyboardLayouts(), AddOrUpdateHwnd(), CDefaultContextMenu::AddStaticEntry(), ApplyAuditEvents(), ApplyRegistryValues(), ArcMatchTokenU(), assign_main(), AssocQ(), automount_main(), AvrfpFindDuplicateThunk(), AvrfpResolveThunks(), BinaryFileCompare(), BlpDisplayRegisterLocale(), BuildLogListAndFilterList(), BuildParameterArray(), CNewMenu::CacheItems(), ChanMgrGetChannelByName(), CheckForChangedNames(), CheckForDeviceId(), CheckInfFile(), CheckLogOrSourceExistence(), CheckUnattendedSetup(), ChooseGinaUI(), clean_main(), cmdAccounts(), cmdComputer(), cmdConfig(), cmdContinue(), cmdGroup(), cmdHelp(), cmdHelpMsg(), cmdLocalGroup(), cmdPause(), cmdSession(), cmdShare(), cmdStart(), cmdStatistics(), cmdStop(), cmdUse(), cmdUser(), co_UserCreateWindowEx(), compare(), compare_info(), CompareCanonical(), CZipFolder::CompareIDs(), CFontExt::CompareIDs(), CompareInfo(), CompareName(), CHString::CompareNoCase(), CFSFolder::CompareUiStrings(), ConvertAddCmdLine(), CountryEnumProc(), CreateEfiPartition(), CreateExtendedPartition(), CreateFileSystemList(), CreateLogicalPartition(), CreateMsrPartition(), CreatePrimaryPartition(), CreateProfile(), CryptOIDEnumCallback(), CSR_API(), DefaultProcessEntry(), DeletePartition(), DisplayApplet(), DnsIntCacheGetEntryByName(), DnsIntCacheRemoveEntryByName(), DnsIntFlushCacheEntry(), DoesPortExist(), DoParse(), CDeskLinkDropHandler::Drop(), ElfCreateEventLogHandle(), EnableVisualTheme(), EngpHasVgaDriver(), EnumerateConnections(), EnumerateDevices(), EnumerateReactOSEntries(), EnumerateSoundProfiles(), EnumFilesWorker(), EqualFamilyInfo(), FileCopyCallback(), FileOpCallback(), FileSystemToMBRPartitionType(), FileTableCompareWithSameAttributes(), FileTableCompareWithSubsetAttributes(), FillList(), FilterByString(), COpenWithList::Find(), find_actctx_dll(), FindCurrentDriver(), FindDatatype(), FindEnumOption(), FindExpectedFile(), FindFlag(), FindForm(), FindLabelContext(), FindLanguageIndex(), FindLanguageInList(), FindNetworkAdapter(), FindNetworkComponent(), FindOrAppendTheme(), FindPort(), FindPrintMonitor(), FindPrintProcessor(), FindSoundFileInList(), FindSoundProfile(), FindStyle(), FontLink_LoadDefaultCharset(), format_main(), FormatEx(), FormatFileSystem_UStr(), FormatPartition(), FreeLdrEnumerateBootEntries(), FreeLdrMigrateBootDrivePart(), FsGetVolumeSize(), GdipGetEncoderClsid(), get_mmioFromProfile(), get_type_from_name(), GetAdapterIndexFromNetCfgInstanceId(), GetArgument(), GetDefaultClusterSize(), GetEventSourceByName(), GetFileSystemByName(), GetFontFamilyInfoForSubstitutes(), GetFontPenalty(), GetFriendlyVerb(), CNetConnectionPropertyUi::GetINetCfgComponent(), GetInstallSourceWin32(), GetLargerTimeZoneEntry(), GetLayerInfo(), CWineTest::GetNextFile(), GetOptionType(), GetPrinterDataExA(), GetProcessID(), GetProfileSize(), GetProvider(), GetRootKeyByName(), GetSystemName(), HandleDesktopIniOp(), has_executable_extension(), help_main(), HelpCommand(), HelpCompare(), Imm32WriteImeLayout(), ImmInstallIMEW(), ImportRegistryFile(), ImportSoundLabel(), INetCfgClass_fnFindComponent(), INetCfgComponentBindings_fnIsBoundTo(), InferFileSystemWorker(), IniCacheFindKey(), IniCacheFindSection(), InitAudioDlg(), CLayerUIPropPage::InitFile(), CFontExt::Initialize(), COpenWithMenu::Initialize(), Initialize(), InitializeFileSystemList(), InitializeFormatDriveDlg(), InitializeGlobalJobList(), InputList_Compare(), InputList_FindPreloadKLID(), InsertDefaultClusterSizeForFs(), InstallBootManagerAndBootEntriesWorker(), InstallDriver(), InstallFatBootcodeToPartition(), InstallVBRToPartition(), InstallWindowsNt(), Int_EnumDependentServicesW(), IntAddNameFromFamInfo(), IntCheckForConsoleFileName(), IntConvertFontPaths(), IntDeleteRegFontEntries(), InterpretCmd(), InterpretCommand(), IntFontFamilyCompareEx(), IntGdiGetFontResourceInfo(), IntGdiRemoveFontResourceSingle(), IntGetIcdData(), IntTMWFixUp(), IsBinaryExt(), IsBuiltinLayer(), isCmd(), IsConsoleBoot(), IsConsoleShell(), IsFontDotExt(), IsGenericSystemName(), IsInternalCommand(), IsLanguageAvailable(), IsLiveCD(), IsRootDeviceInstanceID(), IsShortcut(), IsSupportedActivePartition(), KspAddObjectCreateItemToList(), KspCreateDeviceReference(), KsServiceBusEnumCreateRequest(), LangCountryEnumProc(), LangCountryEnumProcEx(), LanguageEnumProc(), LanguageEnumProcEx(), CNewMenu::LoadCachedItems(), LoadEventSources(), LoadSettings(), LoadSetupData(), LoadSetupInf(), LoadShellLinkConsoleInfo(), LocalmonOpenPort(), LogfListItemByName(), LogonPageProc(), LsapLookupAccountRightValue(), LsarpLookupPrivilegeDisplayName(), LsarpLookupPrivilegeValue(), MAIN_AutoStart(), MapVerbToCmdId(), CDefaultContextMenu::MapVerbToCmdId(), MatchVerb(), MMixerGetDataByDeviceName(), MMixerGetMixerByName(), MMSYS_InstallDevice(), MoveKey(), MsvpCheckWorkstations(), NetStatisticsGet(), NtfsDirFindFile(), NtfsGrabFCBFromTable(), NtUserMessageCall(), OnInitDialog(), CShellLink::OnNotify(), OpenConsoleW(), OpenPrintProcessor(), ParseArcName(), ParseCmdLine(), ParseCmdline(), ParseDay(), ParseHour(), ParseLogonHours(), ParseReasonCode(), ParseTime(), ParseUnattend(), PathIsEqual(), pBuildFileList(), PlaySound_GetMMIO(), PreprocessUnattend(), PrintGroupHelp(), PrintPartitionData(), ProcessCodePage(), ProcessCommandLine(), ProcessLangEntry(), ProcessPageCompareFunc(), ProcessUnattendSection(), RCreateServiceW(), ReadPortSettings(), RecycleBinGeneric_IsEqualFileIdentity(), RegConnectRegistryW(), RegFindRecurse(), RegFindWalk(), remove_main(), REnumServiceGroupW(), REnumServicesStatusExW(), RtlpHashAtomName(), RunningOnLiveMedium(), SaveColumnSettings(), SaveCustomPath(), ScLookupServiceByServiceName(), ScmCheckDriver(), ScmCreateManagerHandle(), ScmGetDriverStatus(), ScmGetServiceEntryByDisplayName(), ScmGetServiceEntryByName(), ScmGetServiceGroupByName(), ScmGetServiceImageByImagePath(), ScmIsLocalSystemAccount(), ScmIsSameServiceAccount(), ScmSetServiceGroup(), SdbFindFirstNamedTag(), SdbGetMatchingExe(), SdbpMatchFileAttributes(), SdbpMatchLayer(), SearchDriverRecursive(), SelectDisk(), SelectNode(), SetConsoleCodePage(), setid_main(), SetModeCommand(), SetupStartPage(), SetUserEnvironment(), SetUserEnvironmentVariable(), SetVolumeCallback(), SHELL32_GetDllFromRundll32CommandLine(), SHELL_FindExecutable(), ShowParallelStatus(), SIC_CompareEntries(), SmpConfigureEnvironment(), SmpConfigureKnownDlls(), SmpConfigureSubSystems(), SmpLoadSubSystemsForMuSession(), SndMixerGetLineByName(), SoundsDlgProc(), START_TEST(), StartDocDlgW(), strlist_find_i(), SubContextCompare(), SuggestKeys(), test_checklinkpath(), test_EnumDirFiles(), test_iconlocation(), test_match_ex(), Test_MetricKey(), Test_SPI_SETBEEP(), Test_SPI_SETMOUSEBUTTONSWAP(), test_stringtable(), test_tcp(), test_udp(), TestCommandLine(), TestInterfaceRegistry(), TestModuleRegistry(), TextFileCompare(), throw(), TranslateName(), ua_wcsicmp(), UniqueIdDisk(), UpdateAddress(), UpdateColumnDataHints(), UpdateDialogLineSliderControl(), UpdateDialogLineSwitchControl(), UpdateDriverForPlugAndPlayDevicesW(), UpdateRegistry(), User32DoImeHelp(), VerifyInteg(), W32TmServiceMain(), wcsicmp(), wmain(), and wWinMain().

◆ _wcsicmp_l()

int __cdecl _wcsicmp_l ( wchar_t const *const  lhs,
wchar_t const *const  rhs,
_locale_t const  plocinfo 
)

Definition at line 39 of file wcsicmp.cpp.

44{
45 /* validation section */
46 _VALIDATE_RETURN(lhs != nullptr, EINVAL, _NLSCMPERROR);
47 _VALIDATE_RETURN(rhs != nullptr, EINVAL, _NLSCMPERROR);
48
49 _LocaleUpdate _loc_update(plocinfo);
50
51 // This check is still worth doing for wide but not narrow because
52 // we need to consult the UTF-16 ctype map for towlower operations.
53 if (_loc_update.GetLocaleT()->locinfo->locale_name[LC_CTYPE] == nullptr)
54 {
55 return __ascii_wcsicmp(lhs, rhs);
56 }
57
58 unsigned short const * lhs_ptr = reinterpret_cast<unsigned short const *>(lhs);
59 unsigned short const * rhs_ptr = reinterpret_cast<unsigned short const *>(rhs);
60
61 int result;
62 int lhs_value;
63 int rhs_value;
64 do
65 {
66 lhs_value = _towlower_internal(*lhs_ptr++, _loc_update.GetLocaleT());
67 rhs_value = _towlower_internal(*rhs_ptr++, _loc_update.GetLocaleT());
68 result = lhs_value - rhs_value;
69 }
70 while (result == 0 && lhs_value != 0);
71
72 return result;
73}
_Check_return_ wint_t _towlower_internal(_In_ unsigned short const c, _In_ _locale_t const locale)
#define LC_CTYPE
Definition: locale.h:27
_locale_t plocinfo
Definition: ismbbyte.cpp:75

Referenced by _wcsicmp().