mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
ku: kernel-mode testing and fixes
This commit is contained in:
parent
ebb9b8b799
commit
757e23ded6
@ -170,7 +170,7 @@ static inline int FspKuWideCharToMultiByte(
|
||||
NTSTATUS Result;
|
||||
ULONG ByteCount;
|
||||
if (-1 == cchWideChar)
|
||||
cchWideChar = (int)wcslen(lpWideCharStr);
|
||||
cchWideChar = (int)wcslen(lpWideCharStr) + 1;
|
||||
Result = RtlUnicodeToUTF8N(
|
||||
lpMultiByteStr, cbMultiByte, &ByteCount,
|
||||
lpWideCharStr, cchWideChar * sizeof(WCHAR));
|
||||
@ -195,7 +195,7 @@ static inline int FspKuMultiByteToWideChar(
|
||||
NTSTATUS Result;
|
||||
ULONG ByteCount;
|
||||
if (-1 == cbMultiByte)
|
||||
cbMultiByte = (int)strlen(lpMultiByteStr);
|
||||
cbMultiByte = (int)strlen(lpMultiByteStr) + 1;
|
||||
Result = RtlUTF8ToUnicodeN(
|
||||
lpWideCharStr, cchWideChar * sizeof(WCHAR), &ByteCount,
|
||||
lpMultiByteStr, cbMultiByte);
|
||||
|
@ -200,22 +200,22 @@ ULONG NTAPI FspPosixInitialize(
|
||||
ULONG Length;
|
||||
NTSTATUS Result;
|
||||
|
||||
RtlInitUnicodeString(&Path, L"\\Machine\\SECURITY\\Policy\\PolAcDmS");
|
||||
RtlInitUnicodeString(&Path, L"\\Registry\\Machine\\SECURITY\\Policy\\PolAcDmS");
|
||||
RtlZeroMemory(&Name, sizeof Name);
|
||||
Length = sizeof Value;
|
||||
Result = FspRegistryGetValue(&Path, &Name, &Value.V, &Length);
|
||||
if (STATUS_SUCCESS == Result /*!NT_SUCCESS*/ && REG_NONE == Value.V.Type &&
|
||||
if (NT_SUCCESS(Result) && REG_NONE == Value.V.Type &&
|
||||
sizeof(SID) <= Value.V.DataLength && RtlValidSid((PSID)&Value.V.Data))
|
||||
{
|
||||
RtlCopyMemory(&FspAccountDomainSidBuf.V, &Value.V.Data, Value.V.DataLength);
|
||||
FspAccountDomainSid = &FspAccountDomainSidBuf.V;
|
||||
}
|
||||
|
||||
RtlInitUnicodeString(&Path, L"\\Machine\\SECURITY\\Policy\\PolPrDmS");
|
||||
RtlInitUnicodeString(&Path, L"\\Registry\\Machine\\SECURITY\\Policy\\PolPrDmS");
|
||||
RtlZeroMemory(&Name, sizeof Name);
|
||||
Length = sizeof Value;
|
||||
Result = FspRegistryGetValue(&Path, &Name, &Value.V, &Length);
|
||||
if (STATUS_SUCCESS == Result /*!NT_SUCCESS*/ && REG_NONE == Value.V.Type &&
|
||||
if (NT_SUCCESS(Result) && REG_NONE == Value.V.Type &&
|
||||
sizeof(SID) <= Value.V.DataLength && RtlValidSid((PSID)&Value.V.Data))
|
||||
{
|
||||
RtlCopyMemory(&FspPrimaryDomainSidBuf.V, &Value.V.Data, Value.V.DataLength);
|
||||
|
Loading…
x
Reference in New Issue
Block a user