IHolder::AllocResource method (comsvcs.h)
Allocates a resource from the inventory.
Syntax
HRESULT AllocResource(
[in] const RESTYPID __MIDL__IHolder0000,
[out] RESID *__MIDL__IHolder0001
);
Parameters
[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.
Return value
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. |
Remarks
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.
Requirements
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 |