chore(docs): update readme and docs, add RE doc

This commit is contained in:
Nguyen Duy
2026-05-15 12:45:09 +07:00
parent 765806b7ec
commit 525773f449
4 changed files with 400 additions and 56 deletions
+27 -14
View File
@@ -1,6 +1,10 @@
# C/C++ API Usage
This document describes how to use the Parsec Virtual Display Driver (VDD) C/C++ API, as defined in `core/parsec-vdd.h`. For full project details, see the [README](../README.md) and [PARSEC_VDD_SPECS.md](./PARSEC_VDD_SPECS.md). For code example, see `core/vdd-demo.cc`.
This document describes the legacy single-header C/C++ API at
[`core/parsec-vdd.h`](../core/parsec-vdd.h). It's intentionally minimal — just
enough to add/remove monitors and keep them alive. For project context, see
the [README](../README.md). For supported display modes, see
[PARSEC_VDD_SPECS.md](./PARSEC_VDD_SPECS.md).
---
@@ -8,7 +12,7 @@ This document describes how to use the Parsec Virtual Display Driver (VDD) C/C++
Parsec VDD enables creation and management of virtual displays on Windows 10+ systems. The C/C++ API allows direct control over the driver, including querying status, adding/removing displays, and updating device state.
- Up to **8 virtual displays** per adapter (default).
- Up to **16 virtual displays** per adapter (the legacy header caps at 8 to avoid plugging lag — adjust if needed).
- Supports high resolutions and refresh rates (see the [specs](./PARSEC_VDD_SPECS.md)).
- Can be used independently of the Parsec app.
@@ -41,6 +45,7 @@ enum DeviceStatus {
```c
DeviceStatus QueryDeviceStatus(const GUID *classGuid, const char *deviceId);
```
- Checks the status of a device by class GUID and hardware ID.
- Returns a `DeviceStatus` value.
@@ -51,6 +56,7 @@ DeviceStatus QueryDeviceStatus(const GUID *classGuid, const char *deviceId);
```c
HANDLE OpenDeviceHandle(const GUID *interfaceGuid);
```
- Opens a handle to the device interface.
- Returns `INVALID_HANDLE_VALUE` or a valid handle.
@@ -59,20 +65,21 @@ HANDLE OpenDeviceHandle(const GUID *interfaceGuid);
```c
void CloseDeviceHandle(HANDLE handle);
```
- Closes a previously opened device handle.
### VDD Core Operations
#### Constants
| Constant | Value | Description |
|---------------------|-----------------------------------------|----------------------------|
| `VDD_DISPLAY_ID` | `"PSCCDD0"` | Display device ID |
| `VDD_DISPLAY_NAME` | `"ParsecVDA"` | Display name |
| `VDD_ADAPTER_GUID` | `{00b41627-04c4-429e-a26e-0265cf50c8fa}`| Adapter GUID |
| `VDD_CLASS_GUID` | `{4d36e968-e325-11ce-bfc1-08002be10318}`| Device class GUID |
| `VDD_HARDWARE_ID` | `"Root\\Parsec\\VDA"` | Hardware ID |
| `VDD_MAX_DISPLAYS` | `8` | Maximum virtual displays |
| Constant | Value | Description |
| ------------------ | ---------------------------------------- | ------------------------ |
| `VDD_DISPLAY_ID` | `"PSCCDD0"` | Display device ID |
| `VDD_DISPLAY_NAME` | `"ParsecVDA"` | Display name |
| `VDD_ADAPTER_GUID` | `{00b41627-04c4-429e-a26e-0265cf50c8fa}` | Adapter GUID |
| `VDD_CLASS_GUID` | `{4d36e968-e325-11ce-bfc1-08002be10318}` | Device class GUID |
| `VDD_HARDWARE_ID` | `"Root\\Parsec\\VDA"` | Hardware ID |
| `VDD_MAX_DISPLAYS` | `8` | Maximum virtual displays |
#### IOCTL Codes
@@ -91,6 +98,7 @@ enum VddCtlCode {
```c
DWORD VddIoControl(HANDLE vdd, VddCtlCode code, const void *data, size_t size);
```
- Sends an IOCTL to the VDD device.
#### Query Driver Version
@@ -98,6 +106,7 @@ DWORD VddIoControl(HANDLE vdd, VddCtlCode code, const void *data, size_t size);
```c
int VddVersion(HANDLE vdd);
```
- Returns the minor version of the VDD driver.
#### Update/Ping VDD
@@ -105,13 +114,15 @@ int VddVersion(HANDLE vdd);
```c
void VddUpdate(HANDLE vdd);
```
- Should be called periodically (<100ms) to keep displays alive.
- **Must** be called every ~100 ms (no longer than ~200 ms apart) to keep displays alive. If pings stop for ~1 second the driver **removes all virtual monitors** — this is its built-in watchdog for crashed hosts. Either run a dedicated thread or schedule a timer.
#### Add Virtual Display
```c
int VddAddDisplay(HANDLE vdd);
```
- Adds a new virtual display.
- Returns the index of the added display.
@@ -120,13 +131,14 @@ int VddAddDisplay(HANDLE vdd);
```c
void VddRemoveDisplay(HANDLE vdd, int index);
```
- Removes the display at the given index.
---
## Example Usage
Check out [core/vdd-demo.cc](/core/vdd-demo.cc).
- Minimal demo using the legacy single-header API: [`core/vdd-demo.cc`](../core/vdd-demo.cc).
---
@@ -136,7 +148,8 @@ See [PARSEC_VDD_SPECS.md](./PARSEC_VDD_SPECS.md) for supported resolutions and r
## Further Reading
- [README.md](../README.md): Project overview, app features, and installation.
- [PARSEC_VDD_SPECS.md](./PARSEC_VDD_SPECS.md): Supported display modes and technical specs.
- [README.md](../README.md): project overview, app features, lifecycle diagram.
- [PARSEC_VDD_SPECS.md](./PARSEC_VDD_SPECS.md): supported display modes and technical specs.
- [PARSEC_VDD_RE.md](../docs/PARSEC_VDD_RE.md): full reverse-engineered IOCTL reference — struct layouts, lifecycle, status codes.
---