Share via


LockResource (Windows CE 5.0)

Send Feedback

This function locks the specified resource in memory.

LPVOID LockResource(HGLOBALhResData);

Parameters

  • hResData
    [in] Handle to the resource to be locked. The LoadResource function returns this handle. This parameter is listed as an HGLOBAL variable only for backwards compatibility. Do not pass any value as a parameter other than a successful return value from the LoadResource function.

Return Values

If the loaded resource is locked, the return value is a pointer to the first byte of the resource; otherwise, it is NULL.

Remarks

The pointer returned by LockResource is valid until the module containing the resource is unloaded. It is not necessary to unlock resources because the system automatically deletes them when the process that created them terminates.

Do not try to lock a resource by using the handle returned by the FindResource function. Such a handle points to random data.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winbase.h.
Link Library: Coredll.lib, Nk.lib

See Also

FindResource | LoadLibrary | FreeLibrary | FindResource | Using Resources

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.