All Products
Search
Document Center

Elastic Desktop Service:Windows plugin-based connection management SDK

Last Updated:Apr 01, 2026

The WUYING Workspace Plug-in Connection Manager SDK (WYSDK) lets you embed cloud computer and cloud application sessions directly into your Windows application. Your app loads WYSDK.dll, initializes the SDK, and controls the full session lifecycle — connect, monitor status, and disconnect — through a small C API.

Download the sample project: WYSDKDemo.zip

Prerequisites

Before you begin, make sure you have:

  • A Windows machine with the WUYING Workspace application installed (64-bit)

  • WYSDK.dll present in the WUYING Workspace installation directory

  • A server-side integration that can log on and obtain a connection ticket — see List of operations by function

Supported features

FeatureSupported
Open a cloud computerYes
Disconnect from a cloud computerYes
Open a cloud applicationYes
Close a cloud applicationYes
Set the display language (Chinese/English)Yes. Configure after connecting.
Set the zoom factor (dots per inch)Yes. Configure after connecting.
Hide DesktopAssistantYes. Configure after connecting.
Full-screen modeYes. Configure after connecting.
Query the device UUIDYes
Query the SDK versionYes
Query cloud computer informationYes
Listen for SDK errorsYes
Listen for connection status changesYes
Trigger the feedback pageYes
Trigger the version update pageYes

How it works

All operations use one of three core functions exported from WYSDK.dll:

  • WYSyncRequest — synchronous call; blocks until complete and returns a WYResponse

  • WYAsyncRequest — asynchronous call; returns immediately and invokes a callback

  • WYFreeResponse — releases the memory allocated for a WYResponse

Each operation is identified by a string key. Pass the key and a JSON parameter string to WYSyncRequest or WYAsyncRequest. After processing the response, call WYFreeResponse to release its memory.

The required call sequence is:

  1. Load WYSDK.dll and resolve the three function pointers

  2. Initialize the SDK (WYInitialize)

  3. Run the SDK (WYRun)

  4. Register listeners as needed (WYRegisterListener)

  5. Connect to cloud computers or applications (WYCreateConnect)

  6. Disconnect (WYDisconnect) and deregister listeners (WYUnregisterListener)

  7. Destroy the SDK (WYUninitialize)

Load WYSDK.dll

Find the installation path

Read the InstallLocation value from the WUYING Workspace uninstall registry key to get the installation directory:

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{D19D277C-E465-4F61-A725-231B7DB9255D}_is1

The following function reads this value and appends \bin to form the directory containing WYSDK.dll:

std::string getDicOfSDK() {
    HKEY hkey = nullptr;
    std::string sub_key = "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{D19D277C-E465-4F61-A725-231B7DB9255D}_is1";
    LSTATUS res = ::RegOpenKeyExA(HKEY_LOCAL_MACHINE, sub_key.c_str(), 0, KEY_READ, &hkey);
    if (res != ERROR_SUCCESS) {
        printf("RegOpenKeyExA status:%d failed: %d\n", res, GetLastError());
        return "";
    }
    std::string valueName = std::string("InstallLocation");
    DWORD dwType = REG_SZ;
    DWORD dwSize = 0;
    LSTATUS ret = RegQueryValueExA(hkey, valueName.c_str(), NULL, &dwType, nullptr, &dwSize);
    if (ret != ERROR_SUCCESS || dwSize <= 0) {
        printf("RegQueryValueExA status:%d size:%d valueName:%s failed: %d\n", ret, dwSize, valueName.c_str(), GetLastError());
        RegCloseKey(hkey);
        return "";
    }

    std::vector<BYTE> value_data(dwSize);
    ret = RegQueryValueExA(hkey, valueName.c_str(), NULL, &dwType, value_data.data(), &dwSize);
    if (ret != ERROR_SUCCESS) {
        printf("RegQueryValueExA status:%d valueName:%s failed: %d\n", ret, valueName.c_str(), GetLastError());
        RegCloseKey(hkey);
        return "";
    }

    RegCloseKey(hkey);
    std::string path(value_data.begin(), value_data.end());
    if (path.back() == '\0') {
        path.pop_back();
    }
    path.append(std::string("bin"));

    printf("RegQueryValueExA11 valueName:%s res: %s\n", valueName.c_str(), path.c_str());
    return path;
}

Resolve function pointers

Load WYSDK.dll with LoadLibrary and resolve the three exported functions:

// The DLL lifecycle matches your process lifecycle — do not unload it early.
HMODULE hModule = LoadLibrary(L"WYSDK.dll");
if (hModule == NULL) {
    std::cout << "Failed to load DLL: " << GetLastError() << std::endl;
    return 1;
}

SyncRequest  = (WYSyncRequest)GetProcAddress(hModule, "WYSyncRequest");
AsyncRequest = (WYAsyncRequest)GetProcAddress(hModule, "WYAsyncRequest");
FreeResponse = (WYFreeResponse)GetProcAddress(hModule, "WYFreeResponse");

if (!SyncRequest || !AsyncRequest || !FreeResponse) {
    printf("Failed to resolve functions\n");
    return 1;
}

The type definitions for these functions are:

struct WYResponse {
    int         code;           // 0 = success; any other value = failure
    const char* content;        // response payload
    const char* requestKey;     // echoes back the key you passed in
    const char* requestParams;  // echoes back the params you passed in
};

typedef WYResponse (*WYSyncRequest)(const char* key, const char* params);
typedef void       (*WYAsyncRequest)(const char* key, const char* params, void (*callback)(WYResponse));
typedef void       (*WYFreeResponse)(WYResponse& response);

API reference

Core functions

WYSyncRequest

Executes a request synchronously and returns the result.

Signature

WYResponse WYSyncRequest(const char* key, const char* params);

Parameters

ParameterDirectionTypeDescription
key[in]const char*The operation key (for example, "WYInitialize")
params[in]const char*JSON-encoded parameters, or NULL if none

Return value

A WYResponse struct. code == 0 means success; any other value means failure. Call WYFreeResponse to release the response after use.

WYAsyncRequest

Executes a request asynchronously and invokes the callback when complete.

Signature

void WYAsyncRequest(const char* key, const char* params, void (*callback)(WYResponse));

Parameters

ParameterDirectionTypeDescription
key[in]const char*The operation key
params[in]const char*JSON-encoded parameters, or NULL if none
callback[in]function pointerInvoked when the operation completes or when a registered listener fires

Remarks

WYAsyncRequest supports all keys that WYSyncRequest supports. Use it for listener registration so the callback receives events without blocking your thread.

WYFreeResponse

Releases the memory allocated for a WYResponse.

Signature

void WYFreeResponse(WYResponse& response);

Parameters

ParameterDirectionTypeDescription
response[in/out]WYResponse&The response object to release

Remarks

Call this after every WYSyncRequest call and after processing each response in an async callback.

SDK lifecycle operations

Initialize the SDK — WYInitialize

Call time: Before any other SDK operations.

Parameters (JSON)

FieldTypeRequiredDescriptionExample
partnerInfo.partnerStringYesYour company name"Acme Corp"
partnerInfo.partnerAppStringYesYour application name"AcmeDesktop"
launcherPathStringYesAbsolute path to stream_launcher.exe"C:\\Program Files\\...\\bin\\stream_launcher.exe"

Example

std::string directory = getDicOfSDK();
std::string config = "{\"partnerInfo\":{\"partner\":\"<your-company>\",\"partnerApp\":\"<your-app>\"}, \"launcherPath\":\"";
config.append(directory);
config.append("\\stream_launcher.exe\"}");

WYResponse value = SyncRequest("WYInitialize", config.c_str());
FreeResponse(value);
// value.code == 0 means initialization succeeded

Run the SDK — WYRun

Call time: After WYInitialize, before connecting to any cloud resource.

Parameters: None

Example

WYResponse value = SyncRequest("WYRun", NULL);
int runCode = value.code;
FreeResponse(value);
// runCode == 0 means the SDK is running

Destroy the SDK — WYUninitialize

Call time: When shutting down; after disconnecting all sessions and deregistering all listeners.

Parameters: None

Example

WYResponse value = SyncRequest("WYUninitialize", NULL);
FreeResponse(value);

Connection operations

Connect to a cloud computer or application — WYCreateConnect

Call time: After WYRun.

Parameters (JSON)

ParameterTypeRequiredDescriptionExample
operationStringYes"openDesktop" to open a cloud computer; "openApp" to open a cloud application"openDesktop"
bizParam.ticketStringYesConnection ticket from GetConnectionTicket
bizParam.desktopIdStringYesThe cloud computer ID, returned by GetConnectionTicket"ecd-7nvbz4ccjly95xxxx"
bizParam.desktopNameStringYesThe cloud computer display name, returned by GetConnectionTicket"Alice's cloud computer"
bizParam.osTypeStringYesThe operating system type, returned by GetConnectionTicket"windows"
partnerInfo.partnerStringYesYour company name"Acme Corp"
partnerInfo.partnerAppStringYesYour application name"AcmeDesktop"
extInfo.languageStringNoDisplay language. Default: Chinese."zh" (Chinese), "en" (English)
extInfo.cloudDpiintNoDefault dots per inch (DPI) scaling percentage on startup. Windows cloud computers only. Integer from 100 to 200 (for example, 150 = 150%).150
extInfo.fullscreenboolNoOpen the session in a full-screen window.true
extInfo.isVpcboolNoRoute the connection through a virtual private cloud (VPC).false
extInfo.hideFloatingBallboolNoHide DesktopAssistant in the session window.false
proxy.typeStringNoProxy type. Valid values: "system", "socket", "HTTP"."system"
proxy.hostStringNoThe proxy host address."127.0.0.1"
proxy.portintNoThe proxy port.50550
proxy.accountStringNoThe proxy account.
proxy.passwordStringNoThe proxy password.

Example — open a cloud computer

{
  "operation": "openDesktop",
  "bizParam": {
    "ticket": "<connection-ticket>",
    "desktopId": "ecd-7nvbz4ccjly95xxxx",
    "desktopName": "Alice's cloud computer",
    "osType": "windows"
  },
  "partnerInfo": {
    "partner": "<your-company>",
    "partnerApp": "<your-app>"
  },
  "extInfo": {
    "language": "zh",
    "cloudDpi": 150,
    "fullscreen": true,
    "isVpc": true,
    "hideFloatingBall": true,
    "proxy": {
      "type": "system",
      "host": "127.x.x.x",
      "port": 50550,
      "account": "",
      "password": ""
    }
  }
}
WYResponse value = SyncRequest("WYCreateConnect", connectParams.c_str());
FreeResponse(value);

Example — open a cloud application

std::string params = "{\"operation\":\"openApp\","
    "\"bizParam\":{\"ticket\":\"<ticket>\","
    "\"appInstanceGroupId\":\"<group-id>\","
    "\"appName\":\"<app-name>\","
    "\"osType\":\"Windows\"}}";

WYResponse value = SyncRequest("WYCreateConnect", params.c_str());
FreeResponse(value);

Disconnect — WYDisconnect

Call time: After the session is established, when you want to close it.

Parameters (JSON)

ParameterTypeRequiredDescription
connectIdStringYesThe ID of the cloud computer or application to disconnect

Example

std::string params = "{\"connectId\":\"<desktop-id>\"}";
WYResponse value = SyncRequest("WYDisconnect", params.c_str());
FreeResponse(value);

Listener operations

Register a listener — WYRegisterListener

Call time: After WYRun.

Register callbacks to receive SDK logs, errors, and connection status events.

TagTriggerKey fields in WYResponse
onOutputLogSDK log line emittedcontent — the log message
onErrorCodeSDK error occurredcode — the error code; requestParams — the listener tag
onStatusChangeConnection status changedcontent — status details

Example — listen for log output

AsyncRequest("WYRegisterListener", "{\"tag\": \"onOutputLog\"}", [](WYResponse value) {
    printf("%s\n", value.content);
});

Example — listen for errors

AsyncRequest("WYRegisterListener", "{\"tag\": \"onErrorCode\"}", [](WYResponse value) {
    int code = value.code;
    if (code == 200 || code == 201 || code == 202) {
        // The communication service has failed. Stop the process and restart it.
        // Alternatively, you can uninstall the SDK and reload it, but reloading WYSDK.dll
        // without restarting the process leaves static residuals.
    }
    printf("Error callback tag %s code %d\n", value.requestParams, code);
});

Example — listen for connection status changes

// Register before calling WYCreateConnect for the same connectId.
std::string params = "{\"tag\": \"onStatusChange\", \"connectId\":\"<desktop-id>\"}";
AsyncRequest("WYRegisterListener", params.c_str(), [](WYResponse value) {
    printf("Status changed: %s\n", value.content);
});

Deregister a listener — WYUnregisterListener

Use the same tag and connectId you passed to WYRegisterListener.

Example

std::string params = "{\"tag\": \"onStatusChange\", \"connectId\":\"<desktop-id>\"}";
WYResponse value = SyncRequest("WYUnregisterListener", params.c_str());
FreeResponse(value);

To deregister the log and error listeners (no connectId required):

WYResponse unLog   = SyncRequest("WYUnregisterListener", "{\"tag\": \"onOutputLog\"}");
FreeResponse(unLog);

WYResponse unError = SyncRequest("WYUnregisterListener", "{\"tag\": \"onErrorCode\"}");
FreeResponse(unError);

Query operations

Query cloud computer information — enumConnections

Returns a JSON array describing all active cloud computer and application connections.

WYResponse value = SyncRequest("enumConnections", NULL);
printf("Connections: %s\n", value.content);
FreeResponse(value);

Response format

{
    "connection":    "<connect-id>",
    "connectionPid": 27324,
    "partner":       "<your-company>",
    "partnerApp":    "<your-app>",
    "processId":     8696,
    "status":        "start"
}

status is either "start" (session active) or "exit" (session ended). connectionPid is the PID of the cloud computer process.

Get the device UUID — uuid

WYResponse value = SyncRequest("uuid", NULL);
printf("UUID: %s\n", value.content);
FreeResponse(value);

Get the SDK version — sdkVersion

WYResponse value = SyncRequest("sdkVersion", NULL);
printf("Version: %s\n", value.content);
FreeResponse(value);

UI trigger operations

Open the feedback page — feedback

WYResponse value = SyncRequest("feedback", NULL);
FreeResponse(value);

Open the version update page — upgrade

WYResponse value = SyncRequest("upgrade", NULL);
FreeResponse(value);

Error codes

CodeDescriptionAction
1SDK initialization failedCheck the WYInitialize configuration
2Partner information not found in SDK configurationVerify partnerInfo.partner and partnerInfo.partnerApp
100Launcher failed to startCheck that launcherPath points to a valid stream_launcher.exe
101Launcher initialization failedReinstall the WUYING Workspace application
200Communication service query failedStop the process and restart it, or uninstall the SDK and reload it. Note: reloading WYSDK.dll in-process leaves static residuals.
201Communication service interruptedStop the process and restart it, or uninstall the SDK and reload it. Note: reloading WYSDK.dll in-process leaves static residuals.
202Communication service creation failedStop the process and restart it, or uninstall the SDK and reload it. Note: reloading WYSDK.dll in-process leaves static residuals.
300Invalid connection parametersCheck that all required WYCreateConnect parameters are present and correctly formatted
301Connection to cloud computer or application failedVerify the ticket is valid and the server is reachable

What's next