diff --git a/winpr/libwinpr/pipe/pipe.c b/winpr/libwinpr/pipe/pipe.c index f1f76cb2e..c4857a1fb 100644 --- a/winpr/libwinpr/pipe/pipe.c +++ b/winpr/libwinpr/pipe/pipe.c @@ -332,7 +332,12 @@ BOOL NamedPipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, /* synchronous behavior */ lpOverlapped->Internal = 0; lpOverlapped->InternalHigh = (ULONG_PTR)nNumberOfBytesToRead; - lpOverlapped->DUMMYUNIONNAME.Pointer = (PVOID)lpBuffer; +#if defined(NONAMELESSUNION) + lpOverlapped->DUMMYUNIONNAME.Pointer +#else + lpOverlapped->Pointer +#endif + = (PVOID)lpBuffer; (void)SetEvent(lpOverlapped->hEvent); #endif } @@ -426,7 +431,12 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, PVOID pv; } cnv; cnv.cpv = lpBuffer; - lpOverlapped->DUMMYUNIONNAME.Pointer = cnv.pv; +#if defined(NONAMELESSUNION) + lpOverlapped->DUMMYUNIONNAME.Pointer +#else + lpOverlapped->Pointer +#endif + = cnv.pv; } (void)SetEvent(lpOverlapped->hEvent); #endif @@ -782,7 +792,12 @@ BOOL ConnectNamedPipe(HANDLE hNamedPipe, LPOVERLAPPED lpOverlapped) /* synchronous behavior */ lpOverlapped->Internal = 2; lpOverlapped->InternalHigh = (ULONG_PTR)0; - lpOverlapped->DUMMYUNIONNAME.Pointer = (PVOID)NULL; +#if defined(NONAMELESSUNION) + lpOverlapped->DUMMYUNIONNAME.Pointer +#else + lpOverlapped->Pointer +#endif + = (PVOID)NULL; (void)SetEvent(lpOverlapped->hEvent); } diff --git a/winpr/libwinpr/sysinfo/sysinfo.c b/winpr/libwinpr/sysinfo/sysinfo.c index b918c504b..7f0d585fc 100644 --- a/winpr/libwinpr/sysinfo/sysinfo.c +++ b/winpr/libwinpr/sysinfo/sysinfo.c @@ -231,7 +231,11 @@ void GetSystemInfo(LPSYSTEM_INFO lpSystemInfo) WINPR_ASSERT(lpSystemInfo); *lpSystemInfo = empty; +#if defined(NONAMELESSUNION) lpSystemInfo->DUMMYUNIONNAME.DUMMYSTRUCTNAME.wProcessorArchitecture = +#else + lpSystemInfo->wProcessorArchitecture = +#endif GetProcessorArchitecture(); lpSystemInfo->dwPageSize = GetSystemPageSize(); lpSystemInfo->dwNumberOfProcessors = GetNumberOfProcessors(); diff --git a/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c b/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c index 91440fe16..a2c955d76 100644 --- a/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c +++ b/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c @@ -11,10 +11,17 @@ int TestGetNativeSystemInfo(int argc, char* argv[]) GetNativeSystemInfo(&sysinfo); +#if defined(NONAMELESSUNION) + const UINT16 wProcessorArchitecture = + sysinfo.DUMMYUNIONNAME.DUMMYSTRUCTNAME.wProcessorArchitecture; + const UINT16 wReserved = sysinfo.DUMMYUNIONNAME.DUMMYSTRUCTNAME.wReserved; +#else + const UINT16 wProcessorArchitecture = sysinfo.wProcessorArchitecture; + const UINT16 wReserved = sysinfo.wReserved; +#endif printf("SystemInfo:\n"); - printf("\twProcessorArchitecture: %" PRIu16 "\n", - sysinfo.DUMMYUNIONNAME.DUMMYSTRUCTNAME.wProcessorArchitecture); - printf("\twReserved: %" PRIu16 "\n", sysinfo.DUMMYUNIONNAME.DUMMYSTRUCTNAME.wReserved); + printf("\twProcessorArchitecture: %" PRIu16 "\n", wProcessorArchitecture); + printf("\twReserved: %" PRIu16 "\n", wReserved); printf("\tdwPageSize: 0x%08" PRIX32 "\n", sysinfo.dwPageSize); printf("\tlpMinimumApplicationAddress: %p\n", sysinfo.lpMinimumApplicationAddress); printf("\tlpMaximumApplicationAddress: %p\n", sysinfo.lpMaximumApplicationAddress); diff --git a/winpr/libwinpr/wtsapi/wtsapi_win32.c b/winpr/libwinpr/wtsapi/wtsapi_win32.c index 835d8c8e0..41a8e132c 100644 --- a/winpr/libwinpr/wtsapi/wtsapi_win32.c +++ b/winpr/libwinpr/wtsapi/wtsapi_win32.c @@ -663,7 +663,7 @@ BOOL Win32_WTSVirtualChannelPurge_Internal(HANDLE hChannelHandle, ULONG IoContro return FALSE; } - const NTSTATUS ntstatus = + NTSTATUS ntstatus = NtDeviceIoControlFile(pChannel->hFile, 0, 0, 0, &ioStatusBlock, IoControlCode, 0, 0, 0, 0); if (ntstatus == STATUS_PENDING) @@ -671,7 +671,13 @@ BOOL Win32_WTSVirtualChannelPurge_Internal(HANDLE hChannelHandle, ULONG IoContro ntstatus = NtWaitForSingleObject(pChannel->hFile, 0, 0); if (ntstatus >= 0) + { +#if defined(NONAMELESSUNION) ntstatus = ioStatusBlock.DUMMYUNIONNAME.Status; +#else + ntstatus = ioStatusBlock.Status; +#endif + } } if (ntstatus == STATUS_BUFFER_OVERFLOW)