This topic has not yet been rated - Rate this topic

SHAllocShared function

[SHAllocShared is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

Applies to: desktop apps only

Allocates a handle in a specified process to a copy of a specified memory block in the calling process.

Syntax

HANDLE SHAllocShared(
  __in_opt  const void *pvData,
  __in      DWORD dwSize,
  __in      DWORD dwDestinationProcessId
);

Parameters

pvData [in, optional]

Type: const void*

A pointer to the memory block in the calling process that is to be copied. You can set this parameter to NULL if you want to share a block of memory without copying any data to it.

dwSize [in]

Type: DWORD

The size, in bytes, of the memory block pointed to by pvData.

dwDestinationProcessId [in]

Type: DWORD

The process ID of the process that will share memory block specified by pvData.

Return value

Type: HANDLE

Returns a handle to the shared memory for the process specified by dwDestinationProcessId. Returns NULL if unsuccessful.

Remarks

Use SHFreeShared to free the handle when you are finished.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

End of client support

Windows XP with SP2

End of server support

Windows Server 2003

Header

Shlwapi.h

DLL

Shlwapi.dll

See also

SHLockShared
SHFreeShared
SHUnlockShared

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ