mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-10-30 19:48:38 -05:00 
			
		
		
		
	launcher, launchctl: refactoring
This commit is contained in:
		| @@ -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; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user