共用方式為


Function Calls to Avoid in Resource DLLs

Function calls involving the following functions or control codes can cause deadlock when made from resource DLLs. The following table lists these functions along with a usage code. A subsequent table describes the usage codes.

API element Usage code
AddClusterResourceDependency Do not use.
AddClusterResourceNode Worker thread only.
CanResourceBeDependent Worker thread only.
ChangeClusterResourceGroup Do not use.
CLUSCTL_GROUP_ENUM_COMMON_PROPERTIES Worker thread only.
CLUSCTL_GROUP_ENUM_PRIVATE_PROPERTIES Worker thread only.
CLUSCTL_GROUP_GET_CHARACTERISTICS Worker thread only.
CLUSCTL_GROUP_GET_COMMON_PROPERTIES Worker thread only.
CLUSCTL_GROUP_GET_COMMON_PROPERTY_FMTS Worker thread only.
CLUSCTL_GROUP_GET_FLAGS Worker thread only.
CLUSCTL_GROUP_GET_ID Worker thread only.
CLUSCTL_GROUP_GET_NAME Worker thread only.
CLUSCTL_GROUP_GET_PRIVATE_PROPERTIES Worker thread only.
CLUSCTL_GROUP_GET_PRIVATE_PROPERTY_FMTS Worker thread only.
CLUSCTL_GROUP_GET_RO_COMMON_PROPERTIES Worker thread only.
CLUSCTL_GROUP_GET_RO_PRIVATE_PROPERTIES Worker thread only.
CLUSCTL_GROUP_QUERY_DELETE Worker thread only.
CLUSCTL_GROUP_SET_COMMON_PROPERTIES Worker thread only.
CLUSCTL_GROUP_SET_PRIVATE_PROPERTIES Worker thread only.
CLUSCTL_GROUP_UNKNOWN Worker thread only.
CLUSCTL_GROUP_VALIDATE_COMMON_PROPERTIES Worker thread only.
CLUSCTL_GROUP_VALIDATE_PRIVATE_PROPERTIES Worker thread only.
CLUSCTL_RESOURCE_ADD_DEPENDENCY Worker thread only.
CLUSCTL_RESOURCE_ADD_OWNER Worker thread only.
CLUSCTL_RESOURCE_CLUSTER_NAME_CHANGED Worker thread only.
CLUSCTL_RESOURCE_CLUSTER_VERSION_CHANGED Worker thread only.
CLUSCTL_RESOURCE_DELETE Worker thread only.
CLUSCTL_RESOURCE_ENUM_COMMON_PROPERTIES Worker thread only.
CLUSCTL_RESOURCE_ENUM_PRIVATE_PROPERTIES Worker thread only.
CLUSCTL_RESOURCE_EVICT_NODE Worker thread only.
CLUSCTL_RESOURCE_GET_CHARACTERISTICS Worker thread only.
CLUSCTL_RESOURCE_GET_CLASS_INFO Worker thread only.
CLUSCTL_RESOURCE_GET_COMMON_PROPERTIES Worker thread only.
CLUSCTL_RESOURCE_GET_FLAGS Worker thread only.
CLUSCTL_RESOURCE_GET_ID Worker thread only.
CLUSCTL_RESOURCE_GET_NAME Worker thread only.
CLUSCTL_RESOURCE_GET_NETWORK_NAME Worker thread only.
CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTIES Worker thread only.
CLUSCTL_RESOURCE_GET_REQUIRED_DEPENDENCIES Worker thread only.
CLUSCTL_RESOURCE_GET_RESOURCE_TYPE Worker thread only.
CLUSCTL_RESOURCE_GET_RO_COMMON_PROPERTIES Worker thread only.
CLUSCTL_RESOURCE_GET_RO_PRIVATE_PROPERTIES Worker thread only.
CLUSCTL_RESOURCE_INSTALL_NODE Worker thread only.
CLUSCTL_RESOURCE_REMOVE_DEPENDENCY Worker thread only.
CLUSCTL_RESOURCE_REMOVE_OWNER Worker thread only.
CLUSCTL_RESOURCE_SET_COMMON_PROPERTIES Worker thread only.
CLUSCTL_RESOURCE_SET_NAME Worker thread only.
CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES Worker thread only.
CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO Worker thread only.
CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO_EX Worker thread only.
CLUSCTL_RESOURCE_STORAGE_GET_MOUNTPOINTS Worker thread only.
CLUSCTL_RESOURCE_STORAGE_IS_PATH_VALID Worker thread only.
CLUSCTL_RESOURCE_UNKNOWN Worker thread only.
CLUSCTL_RESOURCE_VALIDATE_COMMON_PROPERTIES Worker thread only.
CLUSCTL_RESOURCE_VALIDATE_PRIVATE_PROPERTIES Worker thread only.
ClusterGroupEnum Worker thread only.
ClusterGroupOpenEnum Worker thread only.
ClusterRegCreateKey Some entry points okay.
ClusterRegDeleteKey Some entry points okay.
ClusterRegDeleteValue Some entry points okay.
ClusterRegSetKeySecurity Some entry points okay.
ClusterRegSetValue Some entry points okay.
ClusterResourceEnum Worker thread only.
ClusterResourceOpenEnum Worker thread only.
CreateClusterGroup Do not use.
CreateClusterResource Do not use.
DeleteClusterGroup Do not use.
DeleteClusterResource Do not use.
DestroyClusterGroup Do not use.
FailClusterResource Do not use.
GetClusterGroupState Worker thread only.
GetClusterResourceNetworkName Worker thread only.
GetClusterResourceState Worker thread only.
MoveClusterGroup Do not use.
OfflineClusterGroup Do not use.
OfflineClusterResource Do not use.
OnlineClusterGroup Do not use.
OnlineClusterResource Do not use.
RemoveClusterResourceDependency Do not use.
RemoveClusterResourceNode Do not use.
ResUtilFindDependentDiskResourceDriveLetter Do not use.
ResUtilGetResourceDependentIPAddressProps Worker thread only.
ResUtilGetEnvironmentWithNetName Worker thread only.
ResUtilGetResourceDependency Worker thread only.
ResUtilGetResourceDependencyByClass Worker thread only.
ResUtilGetResourceDependencyByName Worker thread only.
ResUtilGetResourceNameDependency Worker thread only.
ResUtilSetBinaryValue Some entry points okay.
ResUtilSetDwordValue Some entry points okay.
ResUtilSetExpandSzValue Some entry points okay.
ResUtilSetMultiSzValue Some entry points okay.
ResUtilSetPrivatePropertyList Some entry points okay.
ResUtilSetPropertyParameterBlock Some entry points okay.
ResUtilSetPropertyParameterBlockEx Some entry points okay.
ResUtilSetPropertyTable Some entry points okay.
ResUtilSetPropertyTableEx Some entry points okay.
ResUtilSetResourceServiceEnvironment Worker thread only.
ResUtilSetSzValue Some entry points okay.
ResUtilSetUnknownProperties Some entry points okay.
SetClusterGroupName Do not use.
SetClusterGroupNodeList Do not use.
SetClusterName Do not use.
SetClusterQuorumResource Do not use.
SetClusterResourceName Do not use.
SetClusterServiceAccountPassword Do not use.

 

The following table describes the usage codes presented in the previous table.

Usage code Usage notes
Some entry points okay. Do not call these functions from the following resource DLL entry point functions: Close, Offline, Online, Open, Terminate. These functions can be safely called from any other resource DLL entry point function or from a worker thread.
Worker thread only. These functions should be called only from a worker thread (see ClusWorkerCreate, ClusWorkerCheckTerminate, and ClusWorkerTerminate).
Do not use. Do not call any of these functions from a resource DLL. Functions in this category modify dependency relationships, add or remove resources from groups, create or delete groups or resources, cause resource or group state changes, or change the node lists of groups or resources.