IHolder::AllocResource method
Allocates a resource from the inventory.
Syntax
HRESULT AllocResource( [in] const RESTYPID ResTypId, [out] RESID *pResId );
Parameters
- ResTypId [in]
-
The type of resource to be allocated.
- pResId [out]
-
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.
If the caller does not have a current transaction, the enlistment is skipped. Or if the Resource Dispenser rejects the enlistment (meaning the resource is not transaction capable), the enlistment is skipped.
Requirements
|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server | Windows 2000 Server [desktop apps only] |
|
Header |
|
See also