CM_Set_Class_Registry_PropertyW函式 (cfgmgr32.h)

CM_Set_Class_Registry_Property函式會設定或刪除裝置安裝類別的屬性。

語法

CMAPI CONFIGRET CM_Set_Class_Registry_PropertyW(
  [in]           LPGUID   ClassGuid,
  [in]           ULONG    ulProperty,
  [in, optional] PCVOID   Buffer,
  [in]           ULONG    ulLength,
  [in]           ULONG    ulFlags,
  [in, optional] HMACHINE hMachine
);

參數

[in] ClassGuid

GUID 的指標,表示要設定屬性的裝置安裝類別。

[in] ulProperty

ULONG 類型的值,可識別要設定的屬性。 此值必須是 CM_Get_Class_Registry_Property 函式之 ulProperty 參數所描述的其中一個CM_CRP_Xxx 值。

[in, optional] Buffer

緩衝區的指標,其中包含屬性數據。 這個參數是選擇性的,而且可以設定為 NULL。 For more information about setting this parameter and the corresponding ulLength parameter, see the following Remarks section.

[in] ulLength

ULONG 類型的值,指定屬性數據的大小,以位元組為單位。

[in] ulFlags

已保留供內部使用。 必須設定為零。

[in, optional] hMachine

用來設定指定 裝置安裝類別屬性之遠端電腦的句柄。 這是選擇性參數。 如果設定為 NULL,則會在本機電腦上設定 屬性。

傳回值

如果作業成功, CM_Set_Class_Registry_Property 會傳回CR_SUCCESS。 否則,函式會傳回 Cfgmgr32.h 中定義的另一個CR_Xxx 狀態代碼。

備註

如果 BufferNULL,ulLength 必須設定為零。

如果 ulLength 設定為零,函式會刪除 屬性。

如果 Buffer 未設定為 NULLulLength 未設定為零,則提供的值必須是 ulProperty 中所指定屬性之REG_Xxx 數據類型的正確大小。

規格需求

需求
最低支援的用戶端 可在 Microsoft Windows 2000 和更新版本的 Windows 中使用。
目標平台 Universal
標頭 cfgmgr32.h (包含 Cfgmgr32.h)
程式庫 Cfgmgr32.lib

另請參閱

CM_Get_Class_Registry_Property

SetupDiGetClassRegistryProperty

SetupDiSetClassRegistryProperty