Skip to content

Latest commit

 

History

History
102 lines (75 loc) · 3.18 KB

nf-winbase-globalsize.md

File metadata and controls

102 lines (75 loc) · 3.18 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winbase.GlobalSize
GlobalSize function (winbase.h)
Retrieves the current size of the specified global memory object, in bytes.
GlobalSize
GlobalSize function
_win32_globalsize
base.globalsize
winbase/GlobalSize
base\globalsize.htm
base
9fd01460-d6fc-41f4-9e0c-209a3d1844c1
12/05/2018
GlobalSize, GlobalSize function, _win32_globalsize, base.globalsize, winbase/GlobalSize
winbase.h
Windows.h
Windows
Windows XP [desktop apps \| UWP apps]
Windows Server 2003 [desktop apps \| UWP apps]
Kernel32.lib
Kernel32.dll
Windows
19H1
GlobalSize
winbase/GlobalSize
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-Heap-Obsolete-l1-1-0.dll
kernel32legacy.dll
API-MS-Win-DownLevel-Kernel32-l2-1-0.dll
GlobalSize

GlobalSize function

-description

Retrieves the current size of the specified global memory object, in bytes.

Note  The global functions have greater overhead and provide fewer features than other memory management functions. New applications should use the heap functions unless documentation states that a global function should be used. For more information, see Global and Local Functions.
 

-parameters

-param hMem [in]

A handle to the global memory object. This handle is returned by either the GlobalAlloc or GlobalReAlloc function.

-returns

If the function succeeds, the return value is the size of the specified global memory object, in bytes.

If the specified handle is not valid or if the object has been discarded, the return value is zero. To get extended error information, call GetLastError.

-remarks

The size of a memory block may be larger than the size requested when the memory was allocated.

To verify that the specified object's memory block has not been discarded, use the GlobalFlags function before calling GlobalSize.

-see-also

Global and Local Functions

GlobalAlloc

GlobalFlags

GlobalReAlloc

Memory Management Functions