IHolder::AllocResource method (comsvcs.h)
Allocates a resource from the inventory.
HRESULT AllocResource(
[in] const RESTYPID __MIDL__IHolder0000,
[out] RESID *__MIDL__IHolder0001
);
[in] __MIDL__IHolder0000
The type of resource to be allocated.
[out] __MIDL__IHolder0001
A pointer to the location where the handle of the allocated resource is returned.
This method can return the following values.
Return code | Description |
---|---|
|
The method completed successfully. |
|
ResTypId is NULL or an empty string, or the Resource Dispenser's IDispenserDriver::CreateResource method generated an empty or duplicate RESID. |
|
The method failed. The pResId parameter has not been set. The likely cause is that the caller's transaction is aborting. |
The Dispenser Manager takes the following steps to locate a resource:
- Searches the pool for a free resource of this RESTYPID, which is already enlisted in the caller's current transaction.
- Searches the pool for a free unenlisted resource of this RESTYPID, and then enlists it in the caller's current transaction.
- Creates the resource by calling back to the Resource Dispenser's IDispenserDriver::CreateResource method, and then enlists it.
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | comsvcs.h |