Export (0) Print
Expand All
Expand Minimize

CreatePrivateNamespace function

Creates a private namespace.

Syntax


HANDLE WINAPI CreatePrivateNamespace(
  _In_opt_  LPSECURITY_ATTRIBUTES lpPrivateNamespaceAttributes,
  _In_      LPVOID lpBoundaryDescriptor,
  _In_      LPCTSTR lpAliasPrefix
);

Parameters

lpPrivateNamespaceAttributes [in, optional]

A pointer to a SECURITY_ATTRIBUTES structure that specifies the security attributes of the namespace object.

lpBoundaryDescriptor [in]

A descriptor that defines how the namespace is to be isolated. The caller must be within this boundary. The CreateBoundaryDescriptor function creates a boundary descriptor.

lpAliasPrefix [in]

The prefix for the namespace. To create an object in this namespace, specify the object name as prefix\objectname.

The system supports multiple private namespaces with the same name, as long as they define different boundaries.

Return value

If the function succeeds, it returns a handle to the new namespace.

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

Remarks

Other applications can access the namespace using the OpenPrivateNamespace function.

The application that created the namespace can use the ClosePrivateNamespace function to close the handle to the namespace. The handle is also closed when the creating process terminates. After the namespace handle is closed, subsequent calls to OpenPrivateNamespace fail, but all operations on objects in the namespace succeed.

To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

Unicode and ANSI names

CreatePrivateNamespaceW (Unicode) and CreatePrivateNamespaceA (ANSI)

See also

ClosePrivateNamespace
Object Namespaces
OpenPrivateNamespace

 

 

Community Additions

ADD
Show:
© 2014 Microsoft