mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 17:03:12 -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;
|
NTSTATUS Result;
|
||||||
ULONG ByteCount;
|
ULONG ByteCount;
|
||||||
if (-1 == cchWideChar)
|
if (-1 == cchWideChar)
|
||||||
cchWideChar = (int)wcslen(lpWideCharStr);
|
cchWideChar = (int)wcslen(lpWideCharStr) + 1;
|
||||||
Result = RtlUnicodeToUTF8N(
|
Result = RtlUnicodeToUTF8N(
|
||||||
lpMultiByteStr, cbMultiByte, &ByteCount,
|
lpMultiByteStr, cbMultiByte, &ByteCount,
|
||||||
lpWideCharStr, cchWideChar * sizeof(WCHAR));
|
lpWideCharStr, cchWideChar * sizeof(WCHAR));
|
||||||
@ -195,7 +195,7 @@ static inline int FspKuMultiByteToWideChar(
|
|||||||
NTSTATUS Result;
|
NTSTATUS Result;
|
||||||
ULONG ByteCount;
|
ULONG ByteCount;
|
||||||
if (-1 == cbMultiByte)
|
if (-1 == cbMultiByte)
|
||||||
cbMultiByte = (int)strlen(lpMultiByteStr);
|
cbMultiByte = (int)strlen(lpMultiByteStr) + 1;
|
||||||
Result = RtlUTF8ToUnicodeN(
|
Result = RtlUTF8ToUnicodeN(
|
||||||
lpWideCharStr, cchWideChar * sizeof(WCHAR), &ByteCount,
|
lpWideCharStr, cchWideChar * sizeof(WCHAR), &ByteCount,
|
||||||
lpMultiByteStr, cbMultiByte);
|
lpMultiByteStr, cbMultiByte);
|
||||||
|
@ -200,22 +200,22 @@ ULONG NTAPI FspPosixInitialize(
|
|||||||
ULONG Length;
|
ULONG Length;
|
||||||
NTSTATUS Result;
|
NTSTATUS Result;
|
||||||
|
|
||||||
RtlInitUnicodeString(&Path, L"\\Machine\\SECURITY\\Policy\\PolAcDmS");
|
RtlInitUnicodeString(&Path, L"\\Registry\\Machine\\SECURITY\\Policy\\PolAcDmS");
|
||||||
RtlZeroMemory(&Name, sizeof Name);
|
RtlZeroMemory(&Name, sizeof Name);
|
||||||
Length = sizeof Value;
|
Length = sizeof Value;
|
||||||
Result = FspRegistryGetValue(&Path, &Name, &Value.V, &Length);
|
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))
|
sizeof(SID) <= Value.V.DataLength && RtlValidSid((PSID)&Value.V.Data))
|
||||||
{
|
{
|
||||||
RtlCopyMemory(&FspAccountDomainSidBuf.V, &Value.V.Data, Value.V.DataLength);
|
RtlCopyMemory(&FspAccountDomainSidBuf.V, &Value.V.Data, Value.V.DataLength);
|
||||||
FspAccountDomainSid = &FspAccountDomainSidBuf.V;
|
FspAccountDomainSid = &FspAccountDomainSidBuf.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlInitUnicodeString(&Path, L"\\Machine\\SECURITY\\Policy\\PolPrDmS");
|
RtlInitUnicodeString(&Path, L"\\Registry\\Machine\\SECURITY\\Policy\\PolPrDmS");
|
||||||
RtlZeroMemory(&Name, sizeof Name);
|
RtlZeroMemory(&Name, sizeof Name);
|
||||||
Length = sizeof Value;
|
Length = sizeof Value;
|
||||||
Result = FspRegistryGetValue(&Path, &Name, &Value.V, &Length);
|
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))
|
sizeof(SID) <= Value.V.DataLength && RtlValidSid((PSID)&Value.V.Data))
|
||||||
{
|
{
|
||||||
RtlCopyMemory(&FspPrimaryDomainSidBuf.V, &Value.V.Data, Value.V.DataLength);
|
RtlCopyMemory(&FspPrimaryDomainSidBuf.V, &Value.V.Data, Value.V.DataLength);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user