mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-07 20:42:09 -05:00
launcher, launchctl: refactoring
This commit is contained in:
parent
2c51251cb7
commit
8ccd44a1f7
@ -78,16 +78,15 @@ static int call_pipe_and_report(PWSTR PipeBuf, ULONG SendSize, ULONG RecvSize)
|
|||||||
info("OK");
|
info("OK");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
ULONG Count = 0;
|
||||||
|
|
||||||
for (PWSTR P = PipeBuf, PipeBufEnd = P + BytesTransferred / sizeof(WCHAR);
|
for (PWSTR P = PipeBuf, PipeBufEnd = P + BytesTransferred / sizeof(WCHAR);
|
||||||
PipeBufEnd > P; P++)
|
PipeBufEnd > P; P++)
|
||||||
switch (*P)
|
if (L'\0' == *P)
|
||||||
{
|
{
|
||||||
case L'\0':
|
/* print a newline every 2 nulls; this works for both list and info */
|
||||||
*P = L'\n';
|
*P = 1 == Count % 2 ? L'\n' : L' ';
|
||||||
break;
|
Count++;
|
||||||
case L'\1':
|
|
||||||
*P = L' ';
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BytesTransferred < RecvSize)
|
if (BytesTransferred < RecvSize)
|
||||||
|
@ -443,9 +443,7 @@ NTSTATUS SvcInstanceGetNameList(HANDLE ClientToken,
|
|||||||
if (BufferEnd < P + ClassNameSize + InstanceNameSize)
|
if (BufferEnd < P + ClassNameSize + InstanceNameSize)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ClassNameSize--;
|
|
||||||
memcpy(P, SvcInstance->ClassName, ClassNameSize * sizeof(WCHAR)); P += ClassNameSize;
|
memcpy(P, SvcInstance->ClassName, ClassNameSize * sizeof(WCHAR)); P += ClassNameSize;
|
||||||
*Buffer++ = L'\1';
|
|
||||||
memcpy(P, SvcInstance->InstanceName, InstanceNameSize * sizeof(WCHAR)); P += InstanceNameSize;
|
memcpy(P, SvcInstance->InstanceName, InstanceNameSize * sizeof(WCHAR)); P += InstanceNameSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user