MR!3 patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is the patch for Merge Request 3 (MR!3).  The WebIDE must have changed the end-of-line sequence as I produced this with "git diff --ignore-all-space".

- jss

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 5fa9c9a..e73a4f9 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -189,7 +189,7 @@ NTSTATUS QxlDod::StartDevice(_In_  DXGK_START_INFO*   pDxgkStartInfo,
         return Status;
     }
 
-    Status = RegisterHWInfo(m_pHWDevice->GetId());
+    Status = RegisterHWInfo(m_pHWDevice->GetId(), m_DeviceInfo.SystemMemorySize);
     if (!NT_SUCCESS(Status))
     {
         QXL_LOG_ASSERTION1("RegisterHWInfo failed with status 0x%X\n",
@@ -1920,7 +1920,7 @@ NTSTATUS QxlDod::WriteHWInfoStr(_In_ HANDLE DevInstRegKeyHandle, _In_ PCWSTR psz
     return Status;
 }
 
-NTSTATUS QxlDod::RegisterHWInfo(_In_ ULONG Id)
+NTSTATUS QxlDod::RegisterHWInfo(_In_ ULONG Id, _In_ LARGE_INTEGER MemSize)
 {
     PAGED_CODE();
 
@@ -1965,9 +1965,17 @@ NTSTATUS QxlDod::RegisterHWInfo(_In_ ULONG Id)
     }
 
     // MemorySize is a ULONG, unlike the others which are all strings
+    //
+    // Microsoft documents the value as counting megabytes, but observation 
+    // suggests it counts bytes. For instance, to represent 512MB, set the 
+    // value to 0x20000000, not to 0x0200.
+    //
+    // A robust implementation would check that the size in bytes, given as 
+    // 64 bits, is not too big for representation as a DWORD!
+
     UNICODE_STRING ValueNameMemorySize;
     RtlInitUnicodeString(&ValueNameMemorySize, L"HardwareInformation.MemorySize");
-    DWORD MemorySize = 0; // BDD has no access to video memory
+    DWORD MemorySize = MemSize.LowPart;
     Status = ZwSetValueKey(DevInstRegKeyHandle,
                            &ValueNameMemorySize,
                            0,
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index 695b83a..dc3c9fc 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -837,7 +837,7 @@ private:
     QXL_NON_PAGED D3DDDI_VIDEO_PRESENT_SOURCE_ID FindSourceForTarget(D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId, BOOLEAN DefaultToZero);
     NTSTATUS IsVidPnSourceModeFieldsValid(CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMode) const;
     NTSTATUS IsVidPnPathFieldsValid(CONST D3DKMDT_VIDPN_PRESENT_PATH* pPath) const;
-    NTSTATUS RegisterHWInfo(_In_ ULONG Id);
+    NTSTATUS RegisterHWInfo(_In_ ULONG Id, _In_ LARGE_INTEGER MemSize);
     QXL_NON_PAGED VOID VsyncTimerProc();
     static QXL_NON_PAGED VOID VsyncTimerProcGate(_In_ _KDPC *dpc, _In_ PVOID context, _In_ PVOID arg1, _In_ PVOID arg2);
     QXL_NON_PAGED VOID IndicateVSyncInterrupt();
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]