#include <Windows.h>
#include <shlobj.h>
#include "hyport.h"
#include "portpriv.h"
#include "portnls.h"
#include "ut_hyprt.h"
#include "hyshmem.h"
Functions | |
IDATA VMCALL | hyshmem_open (struct HyPortLibrary *portLibrary, struct hyshmem_handle **handle, const char *rootname, I_32 size, I_32 perm) |
Creates/open a shared memory region. | |
void *VMCALL | hyshmem_attach (struct HyPortLibrary *portLibrary, struct hyshmem_handle *handle) |
Attaches the shared memory represented by the handle. | |
IDATA VMCALL | hyshmem_detach (struct HyPortLibrary *portLibrary, struct hyshmem_handle **handle) |
Detaches the shared memory region from the caller's process address space Use hyshmem_destroy to actually remove the memory region from the Operating system. | |
IDATA VMCALL | hyshmem_destroy (struct HyPortLibrary *portLibrary, struct hyshmem_handle **handle) |
Destroy and removes the shared memory region from OS. | |
void VMCALL | hyshmem_shutdown (struct HyPortLibrary *portLibrary) |
PortLibrary shutdown. | |
I_32 VMCALL | hyshmem_startup (struct HyPortLibrary *portLibrary) |
PortLibrary startup. | |
void VMCALL | hyshmem_close (struct HyPortLibrary *portLibrary, struct hyshmem_handle **handle) |
Detach, Close and remove the shared memory handle. | |
void VMCALL | hyshmem_findclose (struct HyPortLibrary *portLibrary, UDATA findhandle) |
Close the handle returned from hyshmem_findfirst. | |
UDATA VMCALL | hyshmem_findfirst (struct HyPortLibrary *portLibrary, char *resultbuf) |
Find the name of a shared memory region on the system. | |
I_32 VMCALL | hyshmem_findnext (struct HyPortLibrary *portLibrary, UDATA findHandle, char *resultbuf) |
Find the name of the next shared memory region. | |
UDATA VMCALL | hyshmem_stat (struct HyPortLibrary *portLibrary, const char *name, struct HyPortShmemStatistic *statbuf) |
Return the statistic for a shared memory region. |
void* VMCALL hyshmem_attach | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshmem_handle * | handle | |||
) |
Attaches the shared memory represented by the handle.
[in] | portLibrary | The port Library |
[in] | handle | A valid shared memory handle |
void VMCALL hyshmem_close | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshmem_handle ** | handle | |||
) |
Detach, Close and remove the shared memory handle.
[in] | portLibrary | The port Library |
[in] | handle | Pointer to a valid shared memory handle |
IDATA VMCALL hyshmem_destroy | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshmem_handle ** | handle | |||
) |
Destroy and removes the shared memory region from OS.
The timing of which OS removes the memory is OS dependent. However when you make a call you can considered that you can no longer access the region through the handle. Memory allocated for handle structure is freed as well.
[in] | portLibrary | The port Library |
[in] | handle | Pointer to a valid shared memory handle |
IDATA VMCALL hyshmem_detach | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshmem_handle ** | handle | |||
) |
Detaches the shared memory region from the caller's process address space Use hyshmem_destroy to actually remove the memory region from the Operating system.
[in] | portLibrary | the Port Library. |
[in] | handle | Pointer to the shared memory region. |
void VMCALL hyshmem_findclose | ( | struct HyPortLibrary * | portLibrary, | |
UDATA | findhandle | |||
) |
Close the handle returned from hyshmem_findfirst.
[in] | portLibrary | The port library |
[in] | findhandle | Handle returned from hyshmem_findfirst. |
UDATA VMCALL hyshmem_findfirst | ( | struct HyPortLibrary * | portLibrary, | |
char * | resultbuf | |||
) |
Find the name of a shared memory region on the system.
Answers a handle to be used in subsequent calls to hyshmem_findnext and hyshmem_findclose.
[in] | portLibrary | The port library |
[out] | resultbuf | filename and path matching path. |
I_32 VMCALL hyshmem_findnext | ( | struct HyPortLibrary * | portLibrary, | |
UDATA | findHandle, | |||
char * | resultbuf | |||
) |
Find the name of the next shared memory region.
[in] | portLibrary | The port library |
[in] | findHandle | handle returned from hyshmem_findfirst. |
[out] | resultbuf | next filename and path matching findhandle. |
IDATA VMCALL hyshmem_open | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshmem_handle ** | handle, | |||
const char * | rootname, | |||
I_32 | size, | |||
I_32 | perm | |||
) |
Creates/open a shared memory region.
The rootname will uniquely identify the shared memory region, and is valid across different JVM instance.
The shared memory region should persist across process, until OS reboots or destroy call is being made.
[in] | portLibrary | The port Library |
[out] | handle | This handle is required for further attach/destroy of the memory region |
[in] | rootname | Shared name for the region, which used to identify the region. |
[in] | size | Size of the region in bytes |
[in] | perm | permission for the region. |
void VMCALL hyshmem_shutdown | ( | struct HyPortLibrary * | portLibrary | ) |
PortLibrary shutdown.
This function is called during shutdown of the portLibrary. Any resources that were created by hyshsem_startup should be destroyed here.
[in] | portLibrary | The port library. |
I_32 VMCALL hyshmem_startup | ( | struct HyPortLibrary * | portLibrary | ) |
PortLibrary startup.
This function is called during startup of the portLibrary. Any resources that are required for the file operations may be created here. All resources created here should be destroyed in hyshsem_shutdown.
[in] | portLibrary | The port library. |
UDATA VMCALL hyshmem_stat | ( | struct HyPortLibrary * | portLibrary, | |
const char * | name, | |||
struct HyPortShmemStatistic * | statbuf | |||
) |
Return the statistic for a shared memory region.
[in] | portLibrary | The port library |
[in] | name | The name of the shared memory area. |
[out] | statbuf | the statistics returns by the operating system |
Genereated on Tue Dec 9 14:12:59 2008 by Doxygen.
(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.