mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-10-29 19:18:39 -05:00 
			
		
		
		
	launcher: check Credentials registry value during svc instance creation
This commit is contained in:
		| @@ -411,7 +411,7 @@ NTSTATUS SvcInstanceCreate(HANDLE ClientToken, | |||||||
|     DWORD ClassNameSize, InstanceNameSize; |     DWORD ClassNameSize, InstanceNameSize; | ||||||
|     WCHAR Executable[MAX_PATH], CommandLineBuf[512], SecurityBuf[512]; |     WCHAR Executable[MAX_PATH], CommandLineBuf[512], SecurityBuf[512]; | ||||||
|     PWSTR CommandLine, Security; |     PWSTR CommandLine, Security; | ||||||
|     DWORD JobControl; |     DWORD JobControl, Credentials; | ||||||
|     PSECURITY_DESCRIPTOR SecurityDescriptor = 0; |     PSECURITY_DESCRIPTOR SecurityDescriptor = 0; | ||||||
|     PWSTR Argv[10]; |     PWSTR Argv[10]; | ||||||
|     PROCESS_INFORMATION ProcessInfo; |     PROCESS_INFORMATION ProcessInfo; | ||||||
| @@ -445,6 +445,22 @@ NTSTATUS SvcInstanceCreate(HANDLE ClientToken, | |||||||
|         goto exit; |         goto exit; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     RegSize = sizeof Credentials; | ||||||
|  |     Credentials = 0; | ||||||
|  |     RegResult = RegGetValueW(RegKey, ClassName, L"Credentials", RRF_RT_REG_DWORD, 0, | ||||||
|  |         &Credentials, &RegSize); | ||||||
|  |     if (ERROR_SUCCESS != RegResult && ERROR_FILE_NOT_FOUND != RegResult) | ||||||
|  |     { | ||||||
|  |         Result = FspNtStatusFromWin32(RegResult); | ||||||
|  |         goto exit; | ||||||
|  |     } | ||||||
|  |     if ((!RedirectStdio && 0 != Credentials) || | ||||||
|  |         ( RedirectStdio && 0 == Credentials)) | ||||||
|  |     { | ||||||
|  |         Result = STATUS_DEVICE_CONFIGURATION_ERROR; | ||||||
|  |         goto exit; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     RegSize = sizeof Executable; |     RegSize = sizeof Executable; | ||||||
|     Executable[0] = L'\0'; |     Executable[0] = L'\0'; | ||||||
|     RegResult = RegGetValueW(RegKey, ClassName, L"Executable", RRF_RT_REG_SZ, 0, |     RegResult = RegGetValueW(RegKey, ClassName, L"Executable", RRF_RT_REG_SZ, 0, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user