Contents

These functions provide access to the shells task allocator

SHAlloc
SHFree

These functions allocate memory on the shells shared heap

ILGlobalClone
ILGlobalFree
SHAllocShared
SHFreeShared
SHLockShared
SHUnlockShared

These functions help with manipulating ItemIDs and IDLists

ILClone
ILFree
ILGlobalClone
ILGlobalFree


ILClone

Makes a copy of an Itemidlist.

LPITEMIDLIST ILClone(
  LPCITEMIDLIST pidl
)

Parameters

pidl
[in] Pointer to the Item Id List to be copied.

Return Value

If the function succeeds, the return value is a pointer to the new Itemidlist.

If the function fails, the return value is zero.

Remarks

The ITEMIDLIST should be freed using ILFree.

Information

Module shell32.dll
Ordinal 18
Platform Available on NT/2000 and 95/98

ILGlobalClone

Makes a copy of an Itemidlist in the shells global heap.

LPITEMIDLIST ILGlobalClone(
  LPCITEMIDLIST pidl
)

Parameters

pidl
[in] Pointer to the Item Id List to be duplicated in the global heap.

Return Value

If the function succeeds, the return value is a pointer to the new Itemidlist.

If the function fails, the return value is NULL.

Remarks

The ITEMIDLIST should be freed using ILGlobalFree.

This function operates diffrently on Windows NT and Windows 95/98:

On Windows 95/98 this function allocates the ITEMIDLIST on a special heap the shell keeps that is shared to all processes. Pointers to objects in this heap can be directly passed to other processes.

Windows NT does not implement the same shared heap, and the ILGlobal* functions act exactly like their non-global counterparts. To allocate ITEMIDLISTs that can be passed to other processes on Windows NT/2000 use the SHAllocShared API.

Information

Module shell32.dll
Ordinal 20
Platform Implemented differently on NT/2000 and 95/98

ILFree

Frees memory allocated using the shells task allocator

BOOL ILFree(
  LPITEMIDLIST pidl
)

Parameters

pidl
[in] Pointer to the Item Id List to be freed.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

This function is a simple wrapper around SHFree.

Information

Module shell32.dll
Ordinal 155
Platform Available on NT/2000 and 95/98

ILGlobalFree

Frees memory allocated using ILGlobalAlloc

BOOL ILGlobalFree(
  LPITEMIDLIST pidl
)

Parameters

pidl
[in] Pointer to the ITEMIDLIST to be freed.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

See the remarks for ILGlobalClone.

Information

Module shell32.dll
Ordinal 156
Platform Implemented diffrently on NT/2000 and 95/98

SHFree

Frees memory allocated using the shells task allocator

BOOL SHFree(
  LPVOID pv
)

Parameters

pv
[in] Pointer to the buffer to be freed.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Information

Module shell32.dll
Ordinal 195
Platform Available on NT/2000 and 95/98

SHAlloc

Allocates memory using the shell allocator

LPVOID SHAlloc(
  ULONG cb
)

Parameters

cb
[in] The number of bytes to allocate.

Return Value

If successfull, SHAlloc returns a pointer to the allocated memory block.

If the request cannot be satisfied, SHAlloc return NULL.

Remarks

This provides quicker access to the task allocator obtained by calling SHGetMalloc.

Information

Module shell32.dll
Ordinal 196
Platform Available on NT/2000 and 95/98

SHAllocShared

Allocates memory in the shells shared memory pool.

HANDLE SHAllocShared(
  LPVOID pvInit,
  ULONG cb,
  DWORD dwProcessId
)

Parameters

pvInit
[in] A pointer to a block of memory that will be used to initialize the newly allocated block.
cb
[in] The number of bytes to allocate.
dwProcessId
[in] The current process Id.

Return Value

If successfull, SHAllocShared returns a handle to the allocated memory block.

If the request cannot be satisfied, SHAllocShared return NULL.

Remarks

The shared pool is a pool of memory available to the shell in every process. When passing IDLists via DDE or on the command line, the shell allocates the memory in the shared pool.

Information

Module shell32.dll
Ordinal 520
Platform Available on NT/2000

SHLockShared

Obtains a pointer to allocated using SHAllocShared.

LPVOID SHLockShared(
  HANDLE hShared,
  DWORD dwProcessId
)

Parameters

hShared
[in] The handle to the shared memory.
dwProcessId
[in] The process id passed when allocating the shared memory.

Return Value

If the function succeeds, the return value is a pointer to the memory block.

Information

Module shell32.dll
Ordinal 521
Platform Available only on NT/2000

SHUnlockShared

Frees a pointer to allocated using SHLockShared.

BOOL SHUnlockShared(
  LPVOID pv
)

Parameters

pv
[in] The pointer to the locked memory to unlock.

Return Value

If the function succeeds, the return value is nonzero.

Information

Module shell32.dll
Ordinal 522
Platform Available only on NT/2000

SHFreeShared

Frees memory allocated using SHAllocShared.

BOOL SHFreeShared(
  HANDLE hShared,
  DWORD dwProcessId
)

Parameters

hShared
[in] The handle to the shared memory.
dwProcessId
[in] The process id passed when allocating the shared memory.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The shared memory must be locked when SHFreeShared is called.

Information

Module shell32.dll
Ordinal 523
Platform Available only on NT/2000