NTSTATUS FileObjectContext::Create() { TRACE_FUNCTION_ENTRY(LEVEL_VERBOSE); NTSTATUS status; UNICODE_STRING* fileObjectName = WdfFileObjectGetFileName(_FileObject); if (CSTR_EQUAL == CompareStringOrdinal(fileObjectName->Buffer, fileObjectName->Length / sizeof(WCHAR), L"\\" FILE_NAMESPACE_NCI_SIMULATOR, int(wcslen(L"\\" FILE_NAMESPACE_NCI_SIMULATOR)), /*IgnoreCase*/ TRUE)) { _Type = Type::NciSim; } else { status = STATUS_OBJECT_NAME_NOT_FOUND; TRACE_LINE(LEVEL_ERROR, "Unknown file namespace: %S. %!STATUS!", fileObjectName->Buffer, status); return status; } status = _DeviceContext->ClientConnected(this); if (!NT_SUCCESS(status)) { TRACE_LINE(LEVEL_ERROR, "DeviceContext::ClientConnected failed. %!STATUS!", status); return status; } TRACE_FUNCTION_SUCCESS(LEVEL_VERBOSE); return STATUS_SUCCESS; }
/*********************************************************************** * WindowsCompareStringOrdinal (combase.@) */ HRESULT WINAPI WindowsCompareStringOrdinal(HSTRING str1, HSTRING str2, INT32 *res) { struct hstring_private *priv1 = impl_from_HSTRING(str1); struct hstring_private *priv2 = impl_from_HSTRING(str2); const WCHAR *buf1 = empty, *buf2 = empty; UINT32 len1 = 0, len2 = 0; TRACE("(%p, %p, %p)\n", str1, str2, res); if (res == NULL) return E_INVALIDARG; if (str1 == str2) { *res = 0; return S_OK; } if (str1) { buf1 = priv1->buffer; len1 = priv1->length; } if (str2) { buf2 = priv2->buffer; len2 = priv2->length; } *res = CompareStringOrdinal(buf1, len1, buf2, len2, FALSE) - CSTR_EQUAL; return S_OK; }
void onSettingsChange(LPARAM lParam) { if (lParam != 0) { PCWSTR message = reinterpret_cast<PCWSTR>(lParam); if (CSTR_EQUAL == CompareStringOrdinal(message, -1, TEXT("UserInteractionMode"), -1, TRUE)) { //Check registry to see if we're in tablet mode //It can take up to 200ms for the registry entry on tablet mode to change in atom tablets checkTabletMode(queryDelay); } } }