Platform SDK: Removable Storage Manager |
The CreateNtmsMediaPool function creates a new application media pool.
DWORD WINAPI CreateNtmsMediaPool( HANDLE hSession, LPCTSTR lpPoolName, LPNTMS_GUID lpMediaType, DWORD dwAction, LPSECURITY_ATTRIBUTES lpSecurityAttributes, LPNTMS_GUID lpPoolId );
Value | Meaning |
---|---|
NTMS_OPEN_EXISTING | Opens an existing media pool by name. Returns ERROR_INVALID_PARAMETER if the pool does not exist. |
NTMS_OPEN_ALWAYS | Opens an existing media pool or creates the pool if it does not exist. |
NTMS_CREATE_NEW | Creates a new media pool. Returns ERROR_ALREADY_EXISTS if the pool exists. |
Value | Meaning |
---|---|
ERROR_ACCESS_DENIED | NTMS_MODIFY_ACCESS to the parent media pool is denied while trying to create a new media pool. |
ERROR_ALREADY_EXISTS | Unable to create a new media pool because one already exists with this name. |
ERROR_DATABASE_FAILURE | The database is inaccessible or damaged. |
ERROR_DATABASE_FULL | The database is full. Other security errors are also possible, but they would indicate a security subsystem error. |
ERROR_INVALID_HANDLE | The session handle is invalid or missing. |
ERROR_INVALID_MEDIA | The selected media type is not valid. |
ERROR_INVALID_NAME | The pool name syntax is invalid. (The name is too long.) |
ERROR_INVALID_PARAMETER | The media pool name or media pool ID pointer is missing. |
ERROR_OBJECT_NOT_FOUND | Unable to open existing media pool. |
ERROR_SUCCESS | The function was successful. |
Free, Unrecognized, and Import media pools are created by RSM and cannot be created with the CreateNtmsMediaPool function.
RSM media pools are organized as a hierarchy separated by the "\" character. Application, Free, Unrecognized, and Import media pools exist at the root of the hierarchy. RSM creates and manages the Free, Unrecognized, and Import pools. RSM creates a Free media pool for each media type available.
Application-specific media pools are created by applications. Applications create media pools for their own use under the root application pool. These media pools have file system-like names. Only the end-point of the name contains media and policy. An application can define pools such as \MyApp\Pool1 and \MyApp\Pool2. This conveys the hierarchy to the user interface and avoids duplicate names. Each pool level must be created individually; first MyApp and then Pool1 and Pool2, much like folders and files.
Windows NT/2000: Requires Windows 2000.
Header: Declared in Ntmsapi.h.
Library: Use Ntmsapi.lib.
Media Services Functions, AllocateNtmsMedia, DeleteNtmsMediaPool, GetNtmsObjectSecurity, SetNtmsObjectSecurity