RmAcquire (Compact 7)
3/12/2014
This function opens a resource of the type specified by pResId. Once opened, Connection Manager will receive resource-wide asynchronous notifications on the state of the resource.
Syntax
RM_RESULT RmAcquire(
__in HANDLE hId,
__in const RM_RESOURCE_ID* pResId,
DWORD dwPriority,
__out RM_RESOURCE_HANDLE* phAcquired
);
Parameters
- [in] hId
[in] An RM_RESOURCE_HANDLE returned by RmInitialize.
- [in] pResId
[in] An RM_RESOURCE_ID identifying the type of resource to acquire.
[in] dwPriority
Priority value used by the Resource Manager to separate tasks within an application and determine whether the resource will be used for user interactive or background activity. The priority scheme is notably different from that described in CM_PRIORITY:- Background sessions: 0 to (2^16) - 1
- User Interactive sessions: 2^16 to (2^32) - 1
[in,out] phAcquired
[in] Pointer to a storage area to place the output.[out] Pointer to an RM_RESOURCE_HANDLE for the acquired resource. This is used in calls to RmRelease, RmAddToResource and RmRemoveFromResource.
Return Value
The function returns the following values:
Value | Description |
---|---|
RMRE_SUCCESS |
The call succeeded. |
RMRE_CONFLICT |
The resource is in use by a higher priority application. |
RMRE_EXTERNAL_CONFLICT |
A resource is not available due to an external condition. For example, a data call was requested and no data network is available. |
RMRE_INVALID_PARAMETER |
One of the input parameters is invalid. |
RMRE_NOT_INITIALIZED |
The hId parameter cannot be matched to an initialized resource. |
RMRE_UNEXPECTED |
An unexpected failure occurred. |
Remarks
Resource-wide notifications include availability, network type, roaming status and bandwidth.
Requirements
Header |
rmnet.h |
Library |
rmnet.lib |
See Also
Reference
Resource Manager Functions
RM_RESOURCE_HANDLE
RM_RESOURCE_ID
RmInitialize
RmRelease
RmAddToResource
RmRemoveFromResource
Resource Manager Service Provider Reference