NTMSAPI.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:59k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved
  3. Module Name:
  4.     ntmsapi.h
  5. Abstract:
  6.     This module contains the RSM API prototypes
  7.     and public definitions supported in the API
  8.     The RSM API provides a "C" interface to RSM
  9.     This file can be included in C and C++ code
  10.     This file's  name is historical.  RSM began
  11.     life as NTMS
  12. --*/
  13. #ifndef _INCL_NTMSAPI_H_
  14. #define _INCL_NTMSAPI_H_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #pragma pack(8)
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. typedef GUID  NTMS_GUID;
  23. typedef GUID* LPNTMS_GUID;
  24. #define NTMS_NULLGUID  {0,0,0,{0,0,0,0,0,0,0,0}}
  25. #define NTMS_IS_NULLGUID(id) ((id.Data1==0)&&(id.Data2==0)&&(id.Data3==0)&&
  26.                                                           (id.Data4[0]==0)&&(id.Data4[1]==0)&&(id.Data4[2]==0)&&
  27.                                                           (id.Data4[3]==0)&&(id.Data4[4]==0)&&(id.Data4[5]==0)&&
  28.                                                           (id.Data4[6]==0)&&(id.Data4[7]==0))
  29. //
  30. // Define unicode/ascii specific functions
  31. // This include functions that get strings
  32. //
  33. #ifdef UNICODE
  34. #define OpenNtmsSession OpenNtmsSessionW
  35. #define GetNtmsDeviceName GetNtmsDeviceNameW
  36. #define GetNtmsObjectInformation GetNtmsObjectInformationW
  37. #define SetNtmsObjectInformation SetNtmsObjectInformationW
  38. #define CreateNtmsMediaPool CreateNtmsMediaPoolW
  39. #define GetNtmsMediaPoolName GetNtmsMediaPoolNameW
  40. #define GetNtmsObjectAttribute GetNtmsObjectAttributeW
  41. #define SetNtmsObjectAttribute SetNtmsObjectAttributeW
  42. #define GetNtmsUIOptions GetNtmsUIOptionsW
  43. #define SetNtmsUIOptions SetNtmsUIOptionsW
  44. #define SubmitNtmsOperatorRequest SubmitNtmsOperatorRequestW
  45. #define CreateNtmsMedia CreateNtmsMediaW
  46. #define EjectDiskFromSADrive EjectDiskFromSADriveW
  47. #define GetVolumesFromDrive GetVolumesFromDriveW
  48. #else
  49. #define OpenNtmsSession OpenNtmsSessionA
  50. #define GetNtmsDeviceName GetNtmsDeviceNameA
  51. #define GetNtmsObjectInformation GetNtmsObjectInformationA
  52. #define SetNtmsObjectInformation SetNtmsObjectInformationA
  53. #define CreateNtmsMediaPool CreateNtmsMediaPoolA
  54. #define GetNtmsMediaPoolName GetNtmsMediaPoolNameA
  55. #define GetNtmsObjectAttribute GetNtmsObjectAttributeA
  56. #define SetNtmsObjectAttribute SetNtmsObjectAttributeA
  57. #define GetNtmsUIOptions GetNtmsUIOptionsA
  58. #define SetNtmsUIOptions SetNtmsUIOptionsA
  59. #define SubmitNtmsOperatorRequest SubmitNtmsOperatorRequestA
  60. #define CreateNtmsMedia CreateNtmsMediaA
  61. #define EjectDiskFromSADrive EjectDiskFromSADriveA
  62. #define GetVolumesFromDrive GetVolumesFromDriveA
  63. #endif
  64. #ifndef NTMS_NOREDEF
  65. // WARNING : The object types are provided as an ordered list of NTMS
  66. // database objects.  Do NOT modify without also modifying the object
  67. // metadata table in dbobmeta.cpp
  68. enum NtmsObjectsTypes {
  69.     NTMS_UNKNOWN                    = 0,
  70.     NTMS_OBJECT,
  71.     NTMS_CHANGER,
  72.     NTMS_CHANGER_TYPE,
  73.     NTMS_COMPUTER,
  74.     NTMS_DRIVE,
  75.     NTMS_DRIVE_TYPE,
  76.     NTMS_IEDOOR,
  77.     NTMS_IEPORT,
  78.     NTMS_LIBRARY,
  79.     NTMS_LIBREQUEST,
  80.     NTMS_LOGICAL_MEDIA,
  81.     NTMS_MEDIA_POOL,
  82.     NTMS_MEDIA_TYPE,
  83.     NTMS_PARTITION,
  84.     NTMS_PHYSICAL_MEDIA,
  85.     NTMS_STORAGESLOT,
  86.     NTMS_OPREQUEST,
  87.     NTMS_UI_DESTINATION,
  88.     NTMS_NUMBER_OF_OBJECT_TYPES
  89. };
  90. // async i/o defined for future implementation
  91. typedef struct _NTMS_ASYNC_IO {
  92.     NTMS_GUID   OperationId;                // reserved - do not use
  93.     NTMS_GUID   EventId;                    // reserved - do not use
  94.     DWORD       dwOperationType;            // reserved - do not use
  95.     DWORD       dwResult;                   // completion status
  96.     DWORD       dwAsyncState;               // current state of request
  97. #ifdef MIDL_PASS
  98.     NTMS_HANDLE hEvent;
  99. #else
  100.     HANDLE      hEvent;                     // event handle to signal on status change
  101. #endif                                      // or request completion
  102.     BOOL        bOnStateChange;             // indicate to signal on status change also
  103. } NTMS_ASYNC_IO, *LPNTMS_ASYNC_IO;
  104. enum NtmsAsyncStatus {
  105.     NTMS_ASYNCSTATE_QUEUED          = 0,    // initial state is queued
  106.     NTMS_ASYNCSTATE_WAIT_RESOURCE,
  107.     NTMS_ASYNCSTATE_WAIT_OPERATOR,
  108.     NTMS_ASYNCSTATE_INPROCESS,
  109.     NTMS_ASYNCSTATE_COMPLETE                // complete, check result code
  110. };
  111. enum NtmsAsyncOperations {
  112.     NTMS_ASYNCOP_MOUNT              = 1     // mount operation
  113. };
  114. #endif  // NTMS_NOREDEF
  115. //=======================================================================
  116. // SESSION ESTABLISHMENT
  117. //=======================================================================
  118. #ifndef MIDL_PASS
  119. enum NtmsSessionOptions {
  120.     NTMS_SESSION_QUERYEXPEDITE      = 0x1
  121. };
  122. HANDLE WINAPI OpenNtmsSessionW(
  123.     LPCWSTR lpServer,
  124.     LPCWSTR lpApplication,
  125.     DWORD   dwOptions
  126.     );
  127. HANDLE WINAPI OpenNtmsSessionA(
  128.     LPCSTR lpServer,
  129.     LPCSTR lpApplication,
  130.     DWORD   dwOptions
  131.     );
  132. DWORD WINAPI CloseNtmsSession(
  133.     HANDLE hSession
  134.     );
  135. #endif  // MIDL_PASS
  136. #ifndef NTMS_NOREDEF
  137. //=======================================================================
  138. // MOUNT DEFINITIONS
  139. //=======================================================================
  140. enum NtmsMountOptions {
  141.     NTMS_MOUNT_READ                 = 0x0001,
  142.     NTMS_MOUNT_WRITE                = 0x0002,
  143.     NTMS_MOUNT_ERROR_NOT_AVAILABLE  = 0x0004,
  144.     NTMS_MOUNT_ERROR_IF_UNAVAILABLE = 0x0004,
  145.     NTMS_MOUNT_ERROR_OFFLINE        = 0x0008,
  146.     NTMS_MOUNT_ERROR_IF_OFFLINE     = 0x0008,
  147.     NTMS_MOUNT_SPECIFIC_DRIVE       = 0x0010,
  148.     NTMS_MOUNT_NOWAIT               = 0x0020
  149. };
  150. enum NtmsDismountOptions {
  151.     NTMS_DISMOUNT_DEFERRED          = 0x0001,
  152.     NTMS_DISMOUNT_IMMEDIATE         = 0x0002
  153. };
  154. enum NtmsMountPriority {
  155.     NTMS_PRIORITY_DEFAULT           = 0,
  156.     NTMS_PRIORITY_HIGHEST           = 15,
  157.     NTMS_PRIORITY_HIGH              = 7,
  158.     NTMS_PRIORITY_NORMAL            = 0,
  159.     NTMS_PRIORITY_LOW               = -7,
  160.     NTMS_PRIORITY_LOWEST            = -15
  161. };
  162. typedef struct _NTMS_MOUNT_INFORMATION
  163. {
  164.     DWORD  dwSize;                  // size of structure
  165. #ifdef MIDL_PASS
  166.     [ptr]  LPNTMS_ASYNC_IO lpReserved;
  167. #else
  168.     LPVOID lpReserved;
  169. #endif
  170. } NTMS_MOUNT_INFORMATION, *LPNTMS_MOUNT_INFORMATION;
  171. #endif  // NTMS_NOREDEF
  172. //=======================================================================
  173. // MOUNT AND DISMOUNT APIS
  174. //=======================================================================
  175. #ifndef MIDL_PASS
  176. DWORD WINAPI MountNtmsMedia(
  177.     HANDLE hSession,
  178.     LPNTMS_GUID lpMediaId,
  179.     LPNTMS_GUID lpDriveId,
  180.     DWORD dwCount,
  181.     DWORD dwOptions,
  182.     int   dwPriority,
  183.     DWORD dwTimeout,
  184.     LPNTMS_MOUNT_INFORMATION lpMountInformation
  185.     );
  186. DWORD WINAPI DismountNtmsMedia(
  187.     HANDLE hSession,
  188.     LPNTMS_GUID lpMediaId,
  189.     DWORD dwCount,
  190.     DWORD dwOptions
  191.     );
  192. #endif  // MIDL_PASS
  193. #ifndef NTMS_NOREDEF
  194. //=======================================================================
  195. // ALLOCATE DEFINITIONS
  196. //=======================================================================
  197. enum NtmsAllocateOptions {
  198.     NTMS_ALLOCATE_NEW               = 0x0001,
  199.     NTMS_ALLOCATE_NEXT              = 0x0002,
  200.     NTMS_ALLOCATE_ERROR_IF_UNAVAILABLE = 0x0004
  201. };
  202. typedef struct _NTMS_ALLOCATION_INFORMATION
  203. {
  204.     DWORD  dwSize;                      // size of structure
  205. #ifdef MIDL_PASS
  206.     [ptr]  LPNTMS_ASYNC_IO lpReserved;  // future async io control
  207. #else
  208.     LPVOID lpReserved;
  209. #endif
  210.     NTMS_GUID AllocatedFrom;            // original source of media (scratch pool, app pool, import etc).
  211. } NTMS_ALLOCATION_INFORMATION, *LPNTMS_ALLOCATION_INFORMATION;
  212. #endif
  213. //=======================================================================
  214. // ALLOCATE AND DEALLOCATE APIS
  215. //=======================================================================
  216. #ifndef MIDL_PASS
  217. DWORD WINAPI AllocateNtmsMedia(
  218.     HANDLE hSession,
  219.     LPNTMS_GUID lpMediaPool,
  220.     LPNTMS_GUID lpPartition,        // optional
  221.     LPNTMS_GUID lpMediaId,          // OUTPUT, media id or operator request id
  222.     DWORD dwOptions,
  223.     DWORD dwTimeout,
  224.     LPNTMS_ALLOCATION_INFORMATION lpAllocateInformation
  225.     );
  226. DWORD WINAPI DeallocateNtmsMedia(
  227.     HANDLE hSession,
  228.     LPNTMS_GUID lpMediaId,
  229.     DWORD dwOptions
  230.     );
  231. DWORD WINAPI SwapNtmsMedia(
  232.     HANDLE hSession,
  233.     LPNTMS_GUID lpMediaId1,
  234.     LPNTMS_GUID lpMediaId2
  235.     );
  236. DWORD WINAPI AddNtmsMediaType(
  237.     HANDLE hSession,
  238.     LPNTMS_GUID lpMediaTypeId,
  239.     LPNTMS_GUID lpLibId
  240.     );
  241. DWORD WINAPI DeleteNtmsMediaType(
  242.     HANDLE hSession,
  243.     LPNTMS_GUID lpMediaTypeId,
  244.     LPNTMS_GUID lpLibId
  245.     );
  246. DWORD WINAPI ChangeNtmsMediaType(
  247.     HANDLE hSession,
  248.     LPNTMS_GUID lpMediaId,
  249.     LPNTMS_GUID lpPoolId
  250.     );
  251. //=======================================================================
  252. // MEDIA STATES
  253. //=======================================================================
  254. DWORD WINAPI DecommissionNtmsMedia(
  255.     HANDLE hSession,
  256.     LPNTMS_GUID lpMediaId
  257.     );
  258. DWORD WINAPI SetNtmsMediaComplete(
  259.     HANDLE hSession,
  260.     LPNTMS_GUID lpMediaId
  261.     );
  262. DWORD WINAPI DeleteNtmsMedia(
  263.     HANDLE hSession,
  264.     LPNTMS_GUID lpMediaId
  265.     );
  266. #endif  // MIDL_PASS
  267. #ifndef NTMS_NOREDEF
  268. //=======================================================================
  269. // MEDIA POOLS
  270. //=======================================================================
  271. enum NtmsCreateOptions {
  272.     NTMS_OPEN_EXISTING              = 0x0001,
  273.     NTMS_CREATE_NEW                 = 0x0002,
  274.     NTMS_OPEN_ALWAYS                = 0x0003
  275. };
  276. #endif  // NTMS_NOREDEF
  277. #ifndef MIDL_PASS
  278. #ifdef PRE_SEVIL
  279. DWORD WINAPI CreateNtmsMediaPool(
  280.     HANDLE hSession,
  281.     LPCTSTR lpPoolName,
  282.     LPNTMS_GUID lpMediaType,
  283.     DWORD dwAction,
  284.     LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  285.     LPNTMS_GUID lpPoolId            // OUT
  286.     );
  287. #endif
  288. // SEVILIA
  289. DWORD WINAPI CreateNtmsMediaPoolA(
  290.     HANDLE hSession,
  291.     LPCSTR lpPoolName,
  292.     LPNTMS_GUID lpMediaType,
  293.     DWORD dwAction,
  294.     LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  295.     LPNTMS_GUID lpPoolId            // OUT
  296.     );
  297. DWORD WINAPI CreateNtmsMediaPoolW(
  298.     HANDLE hSession,
  299.     LPCWSTR lpPoolName,
  300.     LPNTMS_GUID lpMediaType,
  301.     DWORD dwAction,
  302.     LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  303.     LPNTMS_GUID lpPoolId            // OUT
  304.     );
  305. DWORD WINAPI GetNtmsMediaPoolNameA(
  306.     HANDLE hSession,
  307.     LPNTMS_GUID lpPoolId,
  308.     LPSTR lpBufName,
  309.     LPDWORD lpdwNameSize
  310.     );
  311. DWORD WINAPI GetNtmsMediaPoolNameW(
  312.     HANDLE hSession,
  313.     LPNTMS_GUID lpPoolId,
  314.     LPWSTR lpBufName,
  315.     LPDWORD lpdwNameSize
  316.     );
  317. DWORD WINAPI MoveToNtmsMediaPool(
  318.     HANDLE hSession,
  319.     LPNTMS_GUID lpMediaId,
  320.     LPNTMS_GUID lpPoolId
  321.     );
  322. DWORD WINAPI DeleteNtmsMediaPool(
  323.     HANDLE hSession,
  324.     LPNTMS_GUID lpPoolId
  325.     );
  326. DWORD WINAPI DeleteNtmsLibrary(
  327.     HANDLE hSession,
  328.     LPNTMS_GUID lpLibraryId
  329.     );
  330. DWORD WINAPI DeleteNtmsDrive(
  331.     HANDLE hSession,
  332.     LPNTMS_GUID lpDriveId
  333.     );
  334. #endif  // MIDL_PASS
  335. #define NTMS_OBJECTNAME_LENGTH      64
  336. #define NTMS_DESCRIPTION_LENGTH     127
  337. #define NTMS_DEVICENAME_LENGTH      64
  338. #define NTMS_SERIALNUMBER_LENGTH    32
  339. #define NTMS_REVISION_LENGTH        32
  340. #define NTMS_BARCODE_LENGTH         64
  341. #define NTMS_SEQUENCE_LENGTH        32
  342. #define NTMS_VENDORNAME_LENGTH      128
  343. #define NTMS_PRODUCTNAME_LENGTH     128
  344. #define NTMS_USERNAME_LENGTH        64
  345. #define NTMS_APPLICATIONNAME_LENGTH 64
  346. #define NTMS_COMPUTERNAME_LENGTH    64
  347. #define NTMS_I1_MESSAGE_LENGTH      127
  348. #define NTMS_MESSAGE_LENGTH         256
  349. #define NTMS_POOLHIERARCHY_LENGTH   512
  350. #define NTMS_OMIDLABELID_LENGTH     255
  351. #define NTMS_OMIDLABELTYPE_LENGTH   64
  352. #define NTMS_OMIDLABELINFO_LENGTH   256
  353. #ifndef NTMS_NOREDEF
  354. //======================================================================
  355. // OBJECT INFORMATION STRUCTURES
  356. //======================================================================
  357. enum NtmsDriveState {
  358.     NTMS_DRIVESTATE_DISMOUNTED      = 0,
  359.     NTMS_DRIVESTATE_MOUNTED         = 1,
  360.     NTMS_DRIVESTATE_LOADED          = 2,
  361.     NTMS_DRIVESTATE_UNLOADED        = 5,
  362.     NTMS_DRIVESTATE_BEING_CLEANED   = 6,
  363.     NTMS_DRIVESTATE_DISMOUNTABLE    = 7
  364. };
  365. #ifdef UNICODE
  366. #define _NTMS_DRIVEINFORMATION _NTMS_DRIVEINFORMATIONW
  367. #define NTMS_DRIVEINFORMATION NTMS_DRIVEINFORMATIONW
  368. #else
  369. #define _NTMS_DRIVEINFORMATION _NTMS_DRIVEINFORMATIONA
  370. #define NTMS_DRIVEINFORMATION NTMS_DRIVEINFORMATIONA
  371. #endif
  372. typedef struct _NTMS_DRIVEINFORMATIONA {
  373.     DWORD       Number;
  374.     DWORD       State;
  375.     NTMS_GUID   DriveType;
  376.     CHAR        szDeviceName[NTMS_DEVICENAME_LENGTH];
  377.     CHAR        szSerialNumber[NTMS_SERIALNUMBER_LENGTH];
  378.     CHAR        szRevision[NTMS_REVISION_LENGTH];
  379.     WORD        ScsiPort;
  380.     WORD        ScsiBus;
  381.     WORD        ScsiTarget;
  382.     WORD        ScsiLun;
  383.     DWORD       dwMountCount;
  384.     SYSTEMTIME  LastCleanedTs;
  385.     NTMS_GUID   SavedPartitionId;
  386.     NTMS_GUID   Library;
  387.     GUID        Reserved;
  388.     DWORD       dwDeferDismountDelay;
  389. } NTMS_DRIVEINFORMATIONA;
  390. typedef struct _NTMS_DRIVEINFORMATIONW {
  391.     DWORD       Number;
  392.     DWORD       State;
  393.     NTMS_GUID   DriveType;
  394.     WCHAR       szDeviceName[NTMS_DEVICENAME_LENGTH];
  395.     WCHAR       szSerialNumber[NTMS_SERIALNUMBER_LENGTH];
  396.     WCHAR       szRevision[NTMS_REVISION_LENGTH];
  397.     WORD        ScsiPort;
  398.     WORD        ScsiBus;
  399.     WORD        ScsiTarget;
  400.     WORD        ScsiLun;
  401.     DWORD       dwMountCount;
  402.     SYSTEMTIME  LastCleanedTs;
  403.     NTMS_GUID   SavedPartitionId;
  404.     NTMS_GUID   Library;
  405.     GUID        Reserved;
  406.     DWORD       dwDeferDismountDelay;
  407. } NTMS_DRIVEINFORMATIONW;
  408. enum NtmsLibraryType {
  409.     NTMS_LIBRARYTYPE_UNKNOWN        = 0,
  410.     NTMS_LIBRARYTYPE_OFFLINE        = 1,
  411.     NTMS_LIBRARYTYPE_ONLINE         = 2,
  412.     NTMS_LIBRARYTYPE_STANDALONE     = 3
  413. };
  414. // library flags
  415. enum NtmsLibraryFlags {
  416.     NTMS_LIBRARYFLAG_FIXEDOFFLINE     = 0x01,
  417.     NTMS_LIBRARYFLAG_CLEANERPRESENT   = 0x02,
  418.     NTMS_LIBRARYFLAG_AUTODETECTCHANGE = 0x04
  419. };
  420. enum NtmsInventoryMethod {
  421.     NTMS_INVENTORY_NONE             = 0,
  422.     NTMS_INVENTORY_FAST             = 1,
  423.     NTMS_INVENTORY_OMID             = 2,
  424.     NTMS_INVENTORY_DEFAULT          = 3,
  425.     NTMS_INVENTORY_SLOT             = 4,
  426.     NTMS_INVENTORY_STOP             = 5,
  427.     NTMS_INVENTORY_MAX
  428. };
  429. typedef struct _NTMS_LIBRARYINFORMATION {
  430.     DWORD       LibraryType;
  431.     NTMS_GUID   CleanerSlot;
  432.     NTMS_GUID   CleanerSlotDefault;
  433.     BOOL        LibrarySupportsDriveCleaning;
  434.     BOOL        BarCodeReaderInstalled;
  435.     DWORD       InventoryMethod;
  436.     DWORD       dwCleanerUsesRemaining;
  437.     DWORD       FirstDriveNumber;
  438.     DWORD       dwNumberOfDrives;
  439.     DWORD       FirstSlotNumber;
  440.     DWORD       dwNumberOfSlots;
  441.     DWORD       FirstDoorNumber;
  442.     DWORD       dwNumberOfDoors;
  443.     DWORD       FirstPortNumber;
  444.     DWORD       dwNumberOfPorts;
  445.     DWORD       FirstChangerNumber;
  446.     DWORD       dwNumberOfChangers;
  447.     DWORD       dwNumberOfMedia;
  448.     DWORD       dwNumberOfMediaTypes;
  449.     DWORD       dwNumberOfLibRequests;
  450.     GUID        Reserved;
  451.     BOOL        AutoRecovery;
  452.     DWORD       dwFlags;
  453. } NTMS_LIBRARYINFORMATION;
  454. #ifdef UNICODE
  455. #define _NTMS_CHANGERINFORMATION _NTMS_CHANGERINFORMATIONW
  456. #define NTMS_CHANGERINFORMATION NTMS_CHANGERINFORMATIONW
  457. #else
  458. #define _NTMS_CHANGERINFORMATION _NTMS_CHANGERINFORMATIONA
  459. #define NTMS_CHANGERINFORMATION NTMS_CHANGERINFORMATIONA
  460. #endif
  461. typedef struct _NTMS_CHANGERINFORMATIONA {
  462.     DWORD       Number;
  463.     NTMS_GUID   ChangerType;
  464.     CHAR        szSerialNumber[NTMS_SERIALNUMBER_LENGTH];
  465.     CHAR        szRevision[NTMS_REVISION_LENGTH];
  466.     CHAR        szDeviceName[NTMS_DEVICENAME_LENGTH];
  467.     WORD        ScsiPort;
  468.     WORD        ScsiBus;
  469.     WORD        ScsiTarget;
  470.     WORD        ScsiLun;
  471.     NTMS_GUID   Library;
  472. } NTMS_CHANGERINFORMATIONA;
  473. typedef struct _NTMS_CHANGERINFORMATIONW {
  474.     DWORD       Number;
  475.     NTMS_GUID   ChangerType;
  476.     WCHAR       szSerialNumber[NTMS_SERIALNUMBER_LENGTH];
  477.     WCHAR       szRevision[NTMS_REVISION_LENGTH];
  478.     WCHAR       szDeviceName[NTMS_DEVICENAME_LENGTH];
  479.     WORD        ScsiPort;
  480.     WORD        ScsiBus;
  481.     WORD        ScsiTarget;
  482.     WORD        ScsiLun;
  483.     NTMS_GUID   Library;
  484. } NTMS_CHANGERINFORMATIONW;
  485. enum NtmsSlotState {
  486.     NTMS_SLOTSTATE_UNKNOWN          = 0,
  487.     NTMS_SLOTSTATE_FULL             = 1,
  488.     NTMS_SLOTSTATE_EMPTY            = 2,
  489.     NTMS_SLOTSTATE_NOTPRESENT       = 3,
  490.     NTMS_SLOTSTATE_NEEDSINVENTORY   = 4
  491. };
  492. typedef struct _NTMS_STORAGESLOTINFORMATION {
  493.     DWORD       Number;
  494.     DWORD       State;
  495.     NTMS_GUID   Library;
  496. } NTMS_STORAGESLOTINFORMATION;
  497. enum NtmsDoorState {
  498.     NTMS_DOORSTATE_UNKNOWN          = 0,
  499.     NTMS_DOORSTATE_CLOSED           = 1,
  500.     NTMS_DOORSTATE_OPEN             = 2
  501. };
  502. typedef struct _NTMS_IEDOORINFORMATION {
  503.     DWORD       Number;
  504.     DWORD       State;
  505.     WORD        MaxOpenSecs;
  506.     NTMS_GUID   Library;
  507. } NTMS_IEDOORINFORMATION;
  508. enum NtmsPortPosition {
  509.     NTMS_PORTPOSITION_UNKNOWN       = 0,
  510.     NTMS_PORTPOSITION_EXTENDED      = 1,
  511.     NTMS_PORTPOSITION_RETRACTED     = 2
  512. };
  513. enum NtmsPortContent {
  514.     NTMS_PORTCONTENT_UNKNOWN        = 0,
  515.     NTMS_PORTCONTENT_FULL           = 1,
  516.     NTMS_PORTCONTENT_EMPTY          = 2
  517. };
  518. typedef struct _NTMS_IEPORTINFORMATION {
  519.     DWORD       Number;
  520.     DWORD       Content;
  521.     DWORD       Position;
  522.     WORD        MaxExtendSecs;
  523.     NTMS_GUID   Library;
  524. } NTMS_IEPORTINFORMATION;
  525. enum NtmsBarCodeState {
  526.     NTMS_BARCODESTATE_OK            = 1,
  527.     NTMS_BARCODESTATE_UNREADABLE    = 2
  528. };
  529. enum NtmsMediaState {
  530.     NTMS_MEDIASTATE_IDLE            = 0,
  531.     NTMS_MEDIASTATE_INUSE           = 1,
  532.     NTMS_MEDIASTATE_MOUNTED         = 2,
  533.     NTMS_MEDIASTATE_LOADED          = 3,
  534.     NTMS_MEDIASTATE_UNLOADED        = 4,
  535.     NTMS_MEDIASTATE_OPERROR         = 5,
  536.     // media is waiting for operator request servicing
  537.     NTMS_MEDIASTATE_OPREQ           = 6
  538. };
  539. #ifdef UNICODE
  540. #define _NTMS_PMIDINFORMATION _NTMS_PMIDINFORMATIONW
  541. #define NTMS_PMIDINFORMATION NTMS_PMIDINFORMATIONW
  542. #else
  543. #define _NTMS_PMIDINFORMATION _NTMS_PMIDINFORMATIONA
  544. #define NTMS_PMIDINFORMATION NTMS_PMIDINFORMATIONA
  545. #endif
  546. typedef struct _NTMS_PMIDINFORMATIONA {
  547.     NTMS_GUID   CurrentLibrary;                 // the current library
  548.     NTMS_GUID   MediaPool;                      // media pool that the media belongs to
  549.     NTMS_GUID   Location;                       // actual location of the media
  550.     DWORD       LocationType;
  551.     NTMS_GUID   MediaType;
  552.     NTMS_GUID   HomeSlot;                       // home slot for online media
  553.     CHAR        szBarCode[NTMS_BARCODE_LENGTH]; // bar code string
  554.     DWORD       BarCodeState;                   // current state of the bar code
  555.     CHAR        szSequenceNumber[NTMS_SEQUENCE_LENGTH];
  556.     DWORD       MediaState;                     // current media state
  557.     DWORD       dwNumberOfPartitions;
  558.     DWORD       dwMediaTypeCode;
  559.     DWORD       dwDensityCode;
  560.     NTMS_GUID   MountedPartition;
  561. } NTMS_PMIDINFORMATIONA;
  562. typedef struct _NTMS_PMIDINFORMATIONW {
  563.     NTMS_GUID   CurrentLibrary;                 // the current library
  564.     NTMS_GUID   MediaPool;                      // media pool that the media belongs to
  565.     NTMS_GUID   Location;                       // actual location of the media
  566.     DWORD       LocationType;
  567.     NTMS_GUID   MediaType;
  568.     NTMS_GUID   HomeSlot;                       // home slot for online media
  569.     WCHAR       szBarCode[NTMS_BARCODE_LENGTH]; // bar code string
  570.     DWORD       BarCodeState;                   // current state of the bar code
  571.     WCHAR       szSequenceNumber[NTMS_SEQUENCE_LENGTH];
  572.     DWORD       MediaState;                     // current media state
  573.     DWORD       dwNumberOfPartitions;
  574.     DWORD       dwMediaTypeCode;
  575.     DWORD       dwDensityCode;
  576.     NTMS_GUID   MountedPartition;
  577. } NTMS_PMIDINFORMATIONW;
  578. typedef struct _NTMS_LMIDINFORMATION {
  579.     NTMS_GUID   MediaPool;
  580.     DWORD       dwNumberOfPartitions;
  581. } NTMS_LMIDINFORMATION;
  582. enum NtmsPartitionState {
  583.     NTMS_PARTSTATE_UNKNOWN          = 0,
  584.     NTMS_PARTSTATE_UNPREPARED       = 1,
  585.     NTMS_PARTSTATE_INCOMPATIBLE     = 2,
  586.     NTMS_PARTSTATE_DECOMMISSIONED   = 3,
  587.     NTMS_PARTSTATE_AVAILABLE        = 4,
  588.     NTMS_PARTSTATE_ALLOCATED        = 5,
  589.     NTMS_PARTSTATE_COMPLETE         = 6,
  590.     NTMS_PARTSTATE_FOREIGN          = 7,
  591.     NTMS_PARTSTATE_IMPORT           = 8,
  592.     NTMS_PARTSTATE_RESERVED         = 9
  593. };
  594. // define the new state as the unknown state for now.
  595. #define NTMS_PARTSTATE_NEW NTMS_PARTSTATE_UNKNOWN
  596. #ifdef UNICODE
  597. #define _NTMS_PARTITIONINFORMATION _NTMS_PARTITIONINFORMATIONW
  598. #define NTMS_PARTITIONINFORMATION NTMS_PARTITIONINFORMATIONW
  599. #else
  600. #define _NTMS_PARTITIONINFORMATION _NTMS_PARTITIONINFORMATIONA
  601. #define NTMS_PARTITIONINFORMATION NTMS_PARTITIONINFORMATIONA
  602. #endif
  603. typedef struct _NTMS_PARTITIONINFORMATIONA {
  604.     NTMS_GUID   PhysicalMedia;
  605.     NTMS_GUID   LogicalMedia;
  606.     DWORD       State;
  607.     WORD        Side;
  608.     DWORD       dwOmidLabelIdLength;    // binary id
  609.     BYTE        OmidLabelId[NTMS_OMIDLABELID_LENGTH];
  610.     CHAR        szOmidLabelType[NTMS_OMIDLABELTYPE_LENGTH];     // type string
  611.     CHAR        szOmidLabelInfo[NTMS_OMIDLABELINFO_LENGTH];     // info string
  612.     DWORD       dwMountCount;
  613.     DWORD       dwAllocateCount;
  614.     LARGE_INTEGER Capacity;
  615. } NTMS_PARTITIONINFORMATIONA;
  616. typedef struct _NTMS_PARTITIONINFORMATIONW {
  617.     NTMS_GUID   PhysicalMedia;
  618.     NTMS_GUID   LogicalMedia;
  619.     DWORD       State;
  620.     WORD        Side;
  621.     DWORD       dwOmidLabelIdLength;    // binary id
  622.     BYTE        OmidLabelId[NTMS_OMIDLABELID_LENGTH];
  623.     WCHAR       szOmidLabelType[NTMS_OMIDLABELTYPE_LENGTH];     // type string
  624.     WCHAR       szOmidLabelInfo[NTMS_OMIDLABELINFO_LENGTH];     // info string
  625.     DWORD       dwMountCount;
  626.     DWORD       dwAllocateCount;
  627.     LARGE_INTEGER Capacity;
  628. } NTMS_PARTITIONINFORMATIONW;
  629. enum NtmsPoolType {
  630.     NTMS_POOLTYPE_UNKNOWN           = 0,
  631.     NTMS_POOLTYPE_SCRATCH           = 1,
  632.     NTMS_POOLTYPE_FOREIGN           = 2,
  633.     NTMS_POOLTYPE_IMPORT            = 3,
  634.     NTMS_POOLTYPE_APPLICATION       = 1000
  635. };
  636. enum NtmsAllocationPolicy {
  637.     NTMS_ALLOCATE_FROMSCRATCH       = 1
  638. };
  639. enum NtmsDeallocationPolicy {
  640.     NTMS_DEALLOCATE_TOSCRATCH       = 1
  641. };
  642. typedef struct _NTMS_MEDIAPOOLINFORMATION {
  643.      DWORD      PoolType;
  644.      NTMS_GUID  MediaType;
  645.      NTMS_GUID  Parent;
  646.      DWORD      AllocationPolicy;
  647.      DWORD      DeallocationPolicy;
  648.      DWORD      dwMaxAllocates;
  649.      DWORD      dwNumberOfPhysicalMedia;
  650.      DWORD      dwNumberOfLogicalMedia;
  651.      DWORD      dwNumberOfMediaPools;
  652. } NTMS_MEDIAPOOLINFORMATION;
  653. enum NtmsReadWriteCharacteristics {
  654.     NTMS_MEDIARW_UNKNOWN            = 0,
  655.     NTMS_MEDIARW_REWRITABLE         = 1,
  656.     NTMS_MEDIARW_WRITEONCE          = 2,
  657.     NTMS_MEDIARW_READONLY           = 3
  658. };
  659. typedef struct _NTMS_MEDIATYPEINFORMATION {
  660.     DWORD       MediaType;      // MediaTypeCodes
  661.     DWORD       NumberOfSides;
  662.     DWORD       ReadWriteCharacteristics;
  663.     DWORD       DeviceType;
  664. } NTMS_MEDIATYPEINFORMATION;
  665. #ifdef UNICODE
  666. #define _NTMS_DRIVETYPEINFORMATION _NTMS_DRIVETYPEINFORMATIONW
  667. #define NTMS_DRIVETYPEINFORMATION NTMS_DRIVETYPEINFORMATIONW
  668. #else
  669. #define _NTMS_DRIVETYPEINFORMATION _NTMS_DRIVETYPEINFORMATIONA
  670. #define NTMS_DRIVETYPEINFORMATION NTMS_DRIVETYPEINFORMATIONA
  671. #endif
  672. typedef struct _NTMS_DRIVETYPEINFORMATIONA {
  673.     CHAR        szVendor[NTMS_VENDORNAME_LENGTH];
  674.     CHAR        szProduct[NTMS_PRODUCTNAME_LENGTH];
  675.     DWORD       NumberOfHeads;
  676.     DWORD       DeviceType;
  677. } NTMS_DRIVETYPEINFORMATIONA;
  678. typedef struct _NTMS_DRIVETYPEINFORMATIONW {
  679.     WCHAR       szVendor[NTMS_VENDORNAME_LENGTH];
  680.     WCHAR       szProduct[NTMS_PRODUCTNAME_LENGTH];
  681.     DWORD       NumberOfHeads;
  682.     DWORD       DeviceType;
  683. } NTMS_DRIVETYPEINFORMATIONW;
  684. #ifdef UNICODE
  685. #define _NTMS_CHANGERTYPEINFORMATION _NTMS_CHANGERTYPEINFORMATIONW
  686. #define NTMS_CHANGERTYPEINFORMATION NTMS_CHANGERTYPEINFORMATIONW
  687. #else
  688. #define _NTMS_CHANGERTYPEINFORMATION _NTMS_CHANGERTYPEINFORMATIONA
  689. #define NTMS_CHANGERTYPEINFORMATION NTMS_CHANGERTYPEINFORMATIONA
  690. #endif
  691. typedef struct _NTMS_CHANGERTYPEINFORMATIONA {
  692.     CHAR        szVendor[NTMS_VENDORNAME_LENGTH];
  693.     CHAR        szProduct[NTMS_PRODUCTNAME_LENGTH];
  694.     DWORD       DeviceType;
  695. } NTMS_CHANGERTYPEINFORMATIONA;
  696. typedef struct _NTMS_CHANGERTYPEINFORMATIONW {
  697.     WCHAR       szVendor[NTMS_VENDORNAME_LENGTH];
  698.     WCHAR       szProduct[NTMS_PRODUCTNAME_LENGTH];
  699.     DWORD       DeviceType;
  700. } NTMS_CHANGERTYPEINFORMATIONW;
  701. //
  702. // Support both CHANGER & LIBRARY for (Dis/Enable) - backwards compatibility
  703. //
  704. enum NtmsLmOperation {
  705.     NTMS_LM_REMOVE                  = 0,
  706.     NTMS_LM_DISABLECHANGER          = 1,
  707.     NTMS_LM_DISABLELIBRARY          = 1,
  708.     NTMS_LM_ENABLECHANGER           = 2,
  709.     NTMS_LM_ENABLELIBRARY           = 2,
  710.     NTMS_LM_DISABLEDRIVE            = 3,
  711.     NTMS_LM_ENABLEDRIVE             = 4,
  712.     NTMS_LM_DISABLEMEDIA            = 5,
  713.     NTMS_LM_ENABLEMEDIA             = 6,
  714.     NTMS_LM_UPDATEOMID              = 7,
  715.     NTMS_LM_INVENTORY               = 8,
  716.     NTMS_LM_DOORACCESS              = 9,
  717.     NTMS_LM_EJECT                   = 10,
  718.     NTMS_LM_EJECTCLEANER            = 11,
  719.     NTMS_LM_INJECT                  = 12,
  720.     NTMS_LM_INJECTCLEANER           = 13,
  721.     NTMS_LM_PROCESSOMID             = 14,
  722.     NTMS_LM_CLEANDRIVE              = 15,
  723.     NTMS_LM_DISMOUNT                = 16,
  724.     NTMS_LM_MOUNT                   = 17,
  725.     NTMS_LM_WRITESCRATCH            = 18,
  726.     NTMS_LM_CLASSIFY                = 19,
  727.     NTMS_LM_RESERVECLEANER          = 20,
  728.     NTMS_LM_RELEASECLEANER          = 21,
  729.     NTMS_LM_MAXWORKITEM
  730. };
  731. enum NtmsLmState {
  732.     NTMS_LM_QUEUED                  = 0,
  733.     NTMS_LM_INPROCESS               = 1,
  734.     NTMS_LM_PASSED                  = 2,
  735.     NTMS_LM_FAILED                  = 3,
  736.     NTMS_LM_INVALID                 = 4,
  737.     NTMS_LM_WAITING                 = 5,
  738.     NTMS_LM_DEFERRED                = 6,
  739.     NTMS_LM_DEFFERED                = 6,  // DO NOT USE.  Maintained for backward compatiblity
  740.     NTMS_LM_CANCELLED               = 7,
  741.     NTMS_LM_STOPPED                 = 8
  742. };
  743. #ifdef UNICODE
  744. #define _NTMS_LIBREQUESTINFORMATION _NTMS_LIBREQUESTINFORMATIONW
  745. #define NTMS_LIBREQUESTINFORMATION NTMS_LIBREQUESTINFORMATIONW
  746. #else
  747. #define _NTMS_LIBREQUESTINFORMATION _NTMS_LIBREQUESTINFORMATIONA
  748. #define NTMS_LIBREQUESTINFORMATION NTMS_LIBREQUESTINFORMATIONA
  749. #endif
  750. typedef struct _NTMS_LIBREQUESTINFORMATIONA {
  751.     DWORD       OperationCode;
  752.     DWORD       OperationOption;
  753.     DWORD       State;
  754.     NTMS_GUID   PartitionId;
  755.     NTMS_GUID   DriveId;
  756.     NTMS_GUID   PhysMediaId;
  757.     NTMS_GUID   Library;
  758.     NTMS_GUID   SlotId;
  759.     SYSTEMTIME  TimeQueued;
  760.     SYSTEMTIME  TimeCompleted;
  761.     CHAR        szApplication[NTMS_APPLICATIONNAME_LENGTH];
  762.     CHAR        szUser[NTMS_USERNAME_LENGTH];
  763.     CHAR        szComputer[NTMS_COMPUTERNAME_LENGTH];
  764.     DWORD       dwErrorCode;                    // error value if state = FAILED
  765.     NTMS_GUID   WorkItemId;                     // work item id for cancel and other requests that
  766.     DWORD       dwPriority;                     // require and associated work item
  767. } NTMS_LIBREQUESTINFORMATIONA;
  768. typedef struct _NTMS_LIBREQUESTINFORMATIONW {
  769.     DWORD       OperationCode;
  770.     DWORD       OperationOption;
  771.     DWORD       State;
  772.     NTMS_GUID   PartitionId;
  773.     NTMS_GUID   DriveId;
  774.     NTMS_GUID   PhysMediaId;
  775.     NTMS_GUID   Library;
  776.     NTMS_GUID   SlotId;
  777.     SYSTEMTIME  TimeQueued;
  778.     SYSTEMTIME  TimeCompleted;
  779.     WCHAR       szApplication[NTMS_APPLICATIONNAME_LENGTH];
  780.     WCHAR       szUser[NTMS_USERNAME_LENGTH];
  781.     WCHAR       szComputer[NTMS_COMPUTERNAME_LENGTH];
  782.     DWORD       dwErrorCode;                    // error value if state = FAILED
  783.     NTMS_GUID   WorkItemId;                     // work item id for cancel and other requests that
  784.     DWORD       dwPriority;                     // require and associated work item
  785. } NTMS_LIBREQUESTINFORMATIONW;
  786. enum NtmsOpreqCommand {
  787.     NTMS_OPREQ_UNKNOWN              = 0,
  788.     NTMS_OPREQ_NEWMEDIA             = 1,
  789.     NTMS_OPREQ_CLEANER              = 2,
  790.     NTMS_OPREQ_DEVICESERVICE        = 3,
  791.     NTMS_OPREQ_MOVEMEDIA            = 4,
  792.     NTMS_OPREQ_MESSAGE              = 5
  793. };
  794. enum NtmsOpreqState {
  795.     NTMS_OPSTATE_UNKNOWN            = 0,
  796.     NTMS_OPSTATE_SUBMITTED          = 1,
  797.     NTMS_OPSTATE_ACTIVE             = 2,
  798.     NTMS_OPSTATE_INPROGRESS         = 3,
  799.     NTMS_OPSTATE_REFUSED            = 4,
  800.     NTMS_OPSTATE_COMPLETE           = 5
  801. };
  802. #ifdef UNICODE
  803. #define _NTMS_OPREQUESTINFORMATION _NTMS_OPREQUESTINFORMATIONW
  804. #define NTMS_OPREQUESTINFORMATION NTMS_OPREQUESTINFORMATIONW
  805. #else
  806. #define _NTMS_OPREQUESTINFORMATION _NTMS_OPREQUESTINFORMATIONA
  807. #define NTMS_OPREQUESTINFORMATION NTMS_OPREQUESTINFORMATIONA
  808. #endif
  809. typedef struct _NTMS_OPREQUESTINFORMATIONA {
  810.     DWORD       Request;
  811.     SYSTEMTIME  Submitted;
  812.     DWORD       State;
  813.     CHAR        szMessage[NTMS_MESSAGE_LENGTH];
  814.     DWORD       Arg1Type;
  815.     NTMS_GUID   Arg1;
  816.     DWORD       Arg2Type;
  817.     NTMS_GUID   Arg2;
  818.     CHAR        szApplication[NTMS_APPLICATIONNAME_LENGTH];
  819.     CHAR        szUser[NTMS_USERNAME_LENGTH];
  820.     CHAR        szComputer[NTMS_COMPUTERNAME_LENGTH];
  821. } NTMS_OPREQUESTINFORMATIONA;
  822. typedef struct _NTMS_OPREQUESTINFORMATIONW {
  823.     DWORD       Request;
  824.     SYSTEMTIME  Submitted;
  825.     DWORD       State;
  826.     WCHAR       szMessage[NTMS_MESSAGE_LENGTH];
  827.     DWORD       Arg1Type;
  828.     NTMS_GUID   Arg1;
  829.     DWORD       Arg2Type;
  830.     NTMS_GUID   Arg2;
  831.     WCHAR       szApplication[NTMS_APPLICATIONNAME_LENGTH];
  832.     WCHAR       szUser[NTMS_USERNAME_LENGTH];
  833.     WCHAR       szComputer[NTMS_COMPUTERNAME_LENGTH];
  834. } NTMS_OPREQUESTINFORMATIONW;
  835. typedef struct _NTMS_COMPUTERINFORMATION {
  836.     DWORD       dwLibRequestPurgeTime;
  837.     DWORD       dwOpRequestPurgeTime;
  838.     DWORD       dwLibRequestFlags;
  839.     DWORD       dwOpRequestFlags;
  840.     DWORD       dwMediaPoolPolicy;
  841. } NTMS_COMPUTERINFORMATION;
  842. // library request option flags
  843. enum NtmsLibRequestFlags {
  844.     NTMS_LIBREQFLAGS_NOAUTOPURGE    = 0x01,
  845.     NTMS_LIBREQFLAGS_NOFAILEDPURGE  = 0x02
  846. };
  847. // operator request option flags
  848. enum NtmsOpRequestFlags {
  849.     NTMS_OPREQFLAGS_NOAUTOPURGE     = 0x01,
  850.     NTMS_OPREQFLAGS_NOFAILEDPURGE   = 0x02,
  851.     NTMS_OPREQFLAGS_NOALERTS        = 0x10,
  852.     NTMS_OPREQFLAGS_NOTRAYICON      = 0x20
  853. };
  854. // media pool policy flags
  855. enum NtmsMediaPoolPolicy {
  856.     // purge offline scratch media.  By default we keep offline scratch media
  857.     // in the fixed offline media pool
  858.     NTMS_POOLPOLICY_PURGEOFFLINESCRATCH = 0x01,
  859.     NTMS_POOLPOLICY_KEEPOFFLINEIMPORT   = 0x02
  860. };
  861. #ifdef UNICODE
  862. #define _NTMS_OBJECTINFORMATION _NTMS_OBJECTINFORMATIONW
  863. #define NTMS_OBJECTINFORMATION NTMS_OBJECTINFORMATIONW
  864. #define LPNTMS_OBJECTINFORMATION LPNTMS_OBJECTINFORMATIONW
  865. #else
  866. #define _NTMS_OBJECTINFORMATION _NTMS_OBJECTINFORMATIONA
  867. #define NTMS_OBJECTINFORMATION NTMS_OBJECTINFORMATIONA
  868. #define LPNTMS_OBJECTINFORMATION LPNTMS_OBJECTINFORMATIONA
  869. #endif
  870. enum NtmsOperationalState {
  871.     NTMS_READY                      = 0,
  872.     NTMS_INITIALIZING               = 10,
  873.     NTMS_NEEDS_SERVICE              = 20,
  874.     NTMS_NOT_PRESENT                = 21
  875. };
  876. typedef struct _NTMS_OBJECTINFORMATIONA {
  877.     DWORD       dwSize;
  878.     DWORD       dwType;
  879.     SYSTEMTIME  Created;
  880.     SYSTEMTIME  Modified;
  881.     NTMS_GUID   ObjectGuid;
  882.     BOOL        Enabled;
  883.     DWORD       dwOperationalState;
  884.     CHAR        szName[NTMS_OBJECTNAME_LENGTH];
  885.     CHAR        szDescription[NTMS_DESCRIPTION_LENGTH];
  886. #ifdef MIDL_PASS
  887.     [switch_is(dwType)] union {
  888.         [case(NTMS_DRIVE)]              NTMS_DRIVEINFORMATIONA Drive;
  889.         [case(NTMS_DRIVE_TYPE)]         NTMS_DRIVETYPEINFORMATIONA DriveType;
  890.         [case(NTMS_LIBRARY)]            NTMS_LIBRARYINFORMATION Library;
  891.         [case(NTMS_CHANGER)]            NTMS_CHANGERINFORMATIONA Changer;
  892.         [case(NTMS_CHANGER_TYPE)]       NTMS_CHANGERTYPEINFORMATIONA ChangerType;
  893.         [case(NTMS_STORAGESLOT)]        NTMS_STORAGESLOTINFORMATION StorageSlot;
  894.         [case(NTMS_IEDOOR)]             NTMS_IEDOORINFORMATION IEDoor;
  895.         [case(NTMS_IEPORT)]             NTMS_IEPORTINFORMATION IEPort;
  896.         [case(NTMS_PHYSICAL_MEDIA)]     NTMS_PMIDINFORMATIONA PhysicalMedia;
  897.         [case(NTMS_LOGICAL_MEDIA)]      NTMS_LMIDINFORMATION LogicalMedia;
  898.         [case(NTMS_PARTITION)]          NTMS_PARTITIONINFORMATIONA Partition;
  899.         [case(NTMS_MEDIA_POOL)]         NTMS_MEDIAPOOLINFORMATION MediaPool;
  900.         [case(NTMS_MEDIA_TYPE)]         NTMS_MEDIATYPEINFORMATION MediaType;
  901.         [case(NTMS_LIBREQUEST)]         NTMS_LIBREQUESTINFORMATIONA LibRequest;
  902.         [case(NTMS_OPREQUEST)]          NTMS_OPREQUESTINFORMATIONA OpRequest;
  903.         [case(NTMS_COMPUTER)]           NTMS_COMPUTERINFORMATION Computer;
  904.         [default]                                       ;
  905.     } Info;
  906. #else
  907.     union {
  908.         NTMS_DRIVEINFORMATIONA      Drive;
  909.         NTMS_DRIVETYPEINFORMATIONA  DriveType;
  910.         NTMS_LIBRARYINFORMATION     Library;
  911.         NTMS_CHANGERINFORMATIONA    Changer;
  912.         NTMS_CHANGERTYPEINFORMATIONA ChangerType;
  913.         NTMS_STORAGESLOTINFORMATION StorageSlot;
  914.         NTMS_IEDOORINFORMATION      IEDoor;
  915.         NTMS_IEPORTINFORMATION      IEPort;
  916.         NTMS_PMIDINFORMATIONA       PhysicalMedia;
  917.         NTMS_LMIDINFORMATION        LogicalMedia;
  918.         NTMS_PARTITIONINFORMATIONA  Partition;
  919.         NTMS_MEDIAPOOLINFORMATION   MediaPool;
  920.         NTMS_MEDIATYPEINFORMATION   MediaType;
  921.         NTMS_LIBREQUESTINFORMATIONA LibRequest;
  922.         NTMS_OPREQUESTINFORMATIONA  OpRequest;
  923.         NTMS_COMPUTERINFORMATION    Computer;
  924.     } Info;
  925. #endif  // MIDL_PASS
  926. } NTMS_OBJECTINFORMATIONA, *LPNTMS_OBJECTINFORMATIONA;
  927. typedef struct _NTMS_OBJECTINFORMATIONW {
  928.     DWORD       dwSize;
  929.     DWORD       dwType;
  930.     SYSTEMTIME  Created;
  931.     SYSTEMTIME  Modified;
  932.     NTMS_GUID   ObjectGuid;
  933.     BOOL        Enabled;
  934.     DWORD       dwOperationalState;
  935.     WCHAR       szName[NTMS_OBJECTNAME_LENGTH];
  936.     WCHAR       szDescription[NTMS_DESCRIPTION_LENGTH];
  937. #ifdef MIDL_PASS
  938.     [switch_is(dwType)] union {
  939.         [case(NTMS_DRIVE)]              NTMS_DRIVEINFORMATIONW Drive;
  940.         [case(NTMS_DRIVE_TYPE)]         NTMS_DRIVETYPEINFORMATIONW DriveType;
  941.         [case(NTMS_LIBRARY)]            NTMS_LIBRARYINFORMATION Library;
  942.         [case(NTMS_CHANGER)]            NTMS_CHANGERINFORMATIONW Changer;
  943.         [case(NTMS_CHANGER_TYPE)]       NTMS_CHANGERTYPEINFORMATIONW ChangerType;
  944.         [case(NTMS_STORAGESLOT)]        NTMS_STORAGESLOTINFORMATION StorageSlot;
  945.         [case(NTMS_IEDOOR)]             NTMS_IEDOORINFORMATION IEDoor;
  946.         [case(NTMS_IEPORT)]             NTMS_IEPORTINFORMATION IEPort;
  947.         [case(NTMS_PHYSICAL_MEDIA)]     NTMS_PMIDINFORMATIONW PhysicalMedia;
  948.         [case(NTMS_LOGICAL_MEDIA)]      NTMS_LMIDINFORMATION LogicalMedia;
  949.         [case(NTMS_PARTITION)]          NTMS_PARTITIONINFORMATIONW Partition;
  950.         [case(NTMS_MEDIA_POOL)]         NTMS_MEDIAPOOLINFORMATION MediaPool;
  951.         [case(NTMS_MEDIA_TYPE)]         NTMS_MEDIATYPEINFORMATION MediaType;
  952.         [case(NTMS_LIBREQUEST)]         NTMS_LIBREQUESTINFORMATIONW LibRequest;
  953.         [case(NTMS_OPREQUEST)]          NTMS_OPREQUESTINFORMATIONW OpRequest;
  954.         [case(NTMS_COMPUTER)]           NTMS_COMPUTERINFORMATION Computer;
  955.         [default]                                       ;
  956.     } Info;
  957. #else
  958.     union {
  959.         NTMS_DRIVEINFORMATIONW Drive;
  960.         NTMS_DRIVETYPEINFORMATIONW DriveType;
  961.         NTMS_LIBRARYINFORMATION Library;
  962.         NTMS_CHANGERINFORMATIONW Changer;
  963.         NTMS_CHANGERTYPEINFORMATIONW ChangerType;
  964.         NTMS_STORAGESLOTINFORMATION StorageSlot;
  965.         NTMS_IEDOORINFORMATION IEDoor;
  966.         NTMS_IEPORTINFORMATION IEPort;
  967.         NTMS_PMIDINFORMATIONW PhysicalMedia;
  968.         NTMS_LMIDINFORMATION LogicalMedia;
  969.         NTMS_PARTITIONINFORMATIONW Partition;
  970.         NTMS_MEDIAPOOLINFORMATION MediaPool;
  971.         NTMS_MEDIATYPEINFORMATION MediaType;
  972.         NTMS_LIBREQUESTINFORMATIONW LibRequest;
  973.         NTMS_OPREQUESTINFORMATIONW OpRequest;
  974.         NTMS_COMPUTERINFORMATION Computer;
  975.     } Info;
  976. #endif  // MIDL_PASS
  977. } NTMS_OBJECTINFORMATIONW, *LPNTMS_OBJECTINFORMATIONW;
  978. //********************************************************************************
  979. // NT 5.0 BETA1 variations of object information.  Required to keep here for
  980. // backward compatibility in DCOM interface.
  981. // Different data structures add the _I1_ to the structure name, denoting
  982. // used for Interface 1 only.
  983. // DO NOT MODIFY IN FUTURE VERSIONS !!
  984. //********************************************************************************
  985. #ifdef UNICODE
  986. #define NTMS_I1_LIBREQUESTINFORMATION   NTMS_I1_LIBREQUESTINFORMATIONW
  987. #define NTMS_I1_PARTITIONINFORMATION    NTMS_I1_PARTITIONINFORMATIONW
  988. #define NTMS_I1_PMIDINFORMATION         NTMS_I1_PMIDINFORMATIONW
  989. #define NTMS_I1_OPREQUESTINFORMATION    NTMS_I1_OPREQUESTINFORMATIONW
  990. #define NTMS_I1_OBJECTINFORMATION       NTMS_I1_OBJECTINFORMATIONW
  991. #else
  992. #define NTMS_I1_LIBREQUESTINFORMATION   NTMS_I1_LIBREQUESTINFORMATIONA
  993. #define NTMS_I1_PARTITIONINFORMATION    NTMS_I1_PARTITIONINFORMATIONA
  994. #define NTMS_I1_PMIDINFORMATION         NTMS_I1_PMIDINFORMATIONA
  995. #define NTMS_I1_OPREQUESTINFORMATION    NTMS_I1_OPREQUESTINFORMATIONA
  996. #define NTMS_I1_OBJECTINFORMATION       NTMS_I1_OBJECTINFORMATIONA
  997. #endif
  998. typedef struct _NTMS_I1_LIBRARYINFORMATION {
  999.     DWORD       LibraryType;
  1000.     NTMS_GUID   CleanerSlot;
  1001.     NTMS_GUID   CleanerSlotDefault;
  1002.     BOOL        LibrarySupportsDriveCleaning;
  1003.     BOOL        BarCodeReaderInstalled;
  1004.     DWORD       InventoryMethod;
  1005.     DWORD       dwCleanerUsesRemaining;
  1006.     DWORD       FirstDriveNumber;
  1007.     DWORD       dwNumberOfDrives;
  1008.     DWORD       FirstSlotNumber;
  1009.     DWORD       dwNumberOfSlots;
  1010.     DWORD       FirstDoorNumber;
  1011.     DWORD       dwNumberOfDoors;
  1012.     DWORD       FirstPortNumber;
  1013.     DWORD       dwNumberOfPorts;
  1014.     DWORD       FirstChangerNumber;
  1015.     DWORD       dwNumberOfChangers;
  1016.     DWORD       dwNumberOfMedia;
  1017.     DWORD       dwNumberOfMediaTypes;
  1018.     DWORD       dwNumberOfLibRequests;
  1019.     GUID        Reserved;
  1020. } NTMS_I1_LIBRARYINFORMATION;
  1021. typedef struct _NTMS_I1_LIBREQUESTINFORMATIONA {
  1022.     DWORD       OperationCode;
  1023.     DWORD       OperationOption;
  1024.     DWORD       State;
  1025.     NTMS_GUID   PartitionId;
  1026.     NTMS_GUID   DriveId;
  1027.     NTMS_GUID   PhysMediaId;
  1028.     NTMS_GUID   Library;
  1029.     NTMS_GUID   SlotId;
  1030.     SYSTEMTIME  TimeQueued;
  1031.     SYSTEMTIME  TimeCompleted;
  1032.     CHAR        szApplication[NTMS_APPLICATIONNAME_LENGTH];
  1033.     CHAR        szUser[NTMS_USERNAME_LENGTH];
  1034.     CHAR        szComputer[NTMS_COMPUTERNAME_LENGTH];
  1035. } NTMS_I1_LIBREQUESTINFORMATIONA;
  1036. typedef struct _NTMS_I1_LIBREQUESTINFORMATIONW {
  1037.     DWORD       OperationCode;
  1038.     DWORD       OperationOption;
  1039.     DWORD       State;
  1040.     NTMS_GUID   PartitionId;
  1041.     NTMS_GUID   DriveId;
  1042.     NTMS_GUID   PhysMediaId;
  1043.     NTMS_GUID   Library;
  1044.     NTMS_GUID   SlotId;
  1045.     SYSTEMTIME  TimeQueued;
  1046.     SYSTEMTIME  TimeCompleted;
  1047.     WCHAR       szApplication[NTMS_APPLICATIONNAME_LENGTH];
  1048.     WCHAR       szUser[NTMS_USERNAME_LENGTH];
  1049.     WCHAR       szComputer[NTMS_COMPUTERNAME_LENGTH];
  1050. } NTMS_I1_LIBREQUESTINFORMATIONW;
  1051. typedef struct _NTMS_I1_PMIDINFORMATIONA {
  1052.     NTMS_GUID   CurrentLibrary;                 // the current library
  1053.     NTMS_GUID   MediaPool;                      // media pool that the media belongs to
  1054.     NTMS_GUID   Location;                       // actual location of the media
  1055.     DWORD       LocationType;
  1056.     NTMS_GUID   MediaType;
  1057.     NTMS_GUID   HomeSlot;                       // home slot for online media
  1058.     CHAR        szBarCode[NTMS_BARCODE_LENGTH]; // bar code string
  1059.     DWORD       BarCodeState;                   // current state of the bar code
  1060.     CHAR        szSequenceNumber[NTMS_SEQUENCE_LENGTH];
  1061.     DWORD       MediaState;                     // current media state
  1062.     DWORD       dwNumberOfPartitions;
  1063. } NTMS_I1_PMIDINFORMATIONA;
  1064. typedef struct _NTMS_I1_PMIDINFORMATIONW {
  1065.     NTMS_GUID   CurrentLibrary;                 // the current library
  1066.     NTMS_GUID   MediaPool;                      // media pool that the media belongs to
  1067.     NTMS_GUID   Location;                       // actual location of the media
  1068.     DWORD       LocationType;
  1069.     NTMS_GUID   MediaType;
  1070.     NTMS_GUID   HomeSlot;                       // home slot for online media
  1071.     WCHAR       szBarCode[NTMS_BARCODE_LENGTH]; // bar code string
  1072.     DWORD       BarCodeState;                   // current state of the bar code
  1073.     WCHAR       szSequenceNumber[NTMS_SEQUENCE_LENGTH];
  1074.     DWORD       MediaState;                     // current media state
  1075.     DWORD       dwNumberOfPartitions;
  1076. } NTMS_I1_PMIDINFORMATIONW;
  1077. typedef struct _NTMS_I1_PARTITIONINFORMATIONA {
  1078.     NTMS_GUID   PhysicalMedia;
  1079.     NTMS_GUID   LogicalMedia;
  1080.     DWORD       State;
  1081.     WORD        Side;
  1082.     DWORD       dwOmidLabelIdLength;    // binary id
  1083.     BYTE        OmidLabelId[255];
  1084.     CHAR        szOmidLabelType[64];    // type string
  1085.     CHAR        szOmidLabelInfo[256];   // info string
  1086.     DWORD       dwMountCount;
  1087.     DWORD       dwAllocateCount;
  1088. } NTMS_I1_PARTITIONINFORMATIONA;
  1089. typedef struct _NTMS_I1_PARTITIONINFORMATIONW {
  1090.     NTMS_GUID   PhysicalMedia;
  1091.     NTMS_GUID   LogicalMedia;
  1092.     DWORD       State;
  1093.     WORD        Side;
  1094.     DWORD       dwOmidLabelIdLength;    // binary id
  1095.     BYTE        OmidLabelId[255];
  1096.     WCHAR       szOmidLabelType[64];    // type string
  1097.     WCHAR       szOmidLabelInfo[256];   // info string
  1098.     DWORD       dwMountCount;
  1099.     DWORD       dwAllocateCount;
  1100. } NTMS_I1_PARTITIONINFORMATIONW;
  1101. typedef struct _NTMS_I1_OPREQUESTINFORMATIONA {
  1102.     DWORD       Request;
  1103.     SYSTEMTIME  Submitted;
  1104.     DWORD       State;
  1105.     CHAR        szMessage[NTMS_I1_MESSAGE_LENGTH];
  1106.     DWORD       Arg1Type;
  1107.     NTMS_GUID   Arg1;
  1108.     DWORD       Arg2Type;
  1109.     NTMS_GUID   Arg2;
  1110.     CHAR        szApplication[NTMS_APPLICATIONNAME_LENGTH];
  1111.     CHAR        szUser[NTMS_USERNAME_LENGTH];
  1112.     CHAR        szComputer[NTMS_COMPUTERNAME_LENGTH];
  1113. } NTMS_I1_OPREQUESTINFORMATIONA;
  1114. typedef struct _NTMS_I1_OPREQUESTINFORMATIONW {
  1115.     DWORD       Request;
  1116.     SYSTEMTIME  Submitted;
  1117.     DWORD       State;
  1118.     WCHAR       szMessage[NTMS_I1_MESSAGE_LENGTH];
  1119.     DWORD       Arg1Type;
  1120.     NTMS_GUID   Arg1;
  1121.     DWORD       Arg2Type;
  1122.     NTMS_GUID   Arg2;
  1123.     WCHAR       szApplication[NTMS_APPLICATIONNAME_LENGTH];
  1124.     WCHAR       szUser[NTMS_USERNAME_LENGTH];
  1125.     WCHAR       szComputer[NTMS_COMPUTERNAME_LENGTH];
  1126. } NTMS_I1_OPREQUESTINFORMATIONW;
  1127. typedef struct _NTMS_I1_OBJECTINFORMATIONA {
  1128.     DWORD       dwSize;
  1129.     DWORD       dwType;
  1130.     SYSTEMTIME  Created;
  1131.     SYSTEMTIME  Modified;
  1132.     NTMS_GUID   ObjectGuid;
  1133.     BOOL        Enabled;
  1134.     DWORD       dwOperationalState;
  1135.     CHAR        szName[NTMS_OBJECTNAME_LENGTH];
  1136.     CHAR        szDescription[NTMS_DESCRIPTION_LENGTH];
  1137. #ifdef MIDL_PASS
  1138.     [switch_is(dwType)] union {
  1139.         [case(NTMS_DRIVE)]              NTMS_DRIVEINFORMATIONA Drive;
  1140.         [case(NTMS_DRIVE_TYPE)]         NTMS_DRIVETYPEINFORMATIONA DriveType;
  1141.         [case(NTMS_LIBRARY)]            NTMS_I1_LIBRARYINFORMATION Library;
  1142.         [case(NTMS_CHANGER)]            NTMS_CHANGERINFORMATIONA Changer;
  1143.         [case(NTMS_CHANGER_TYPE)]       NTMS_CHANGERTYPEINFORMATIONA ChangerType;
  1144.         [case(NTMS_STORAGESLOT)]        NTMS_STORAGESLOTINFORMATION StorageSlot;
  1145.         [case(NTMS_IEDOOR)]             NTMS_IEDOORINFORMATION IEDoor;
  1146.         [case(NTMS_IEPORT)]             NTMS_IEPORTINFORMATION IEPort;
  1147.         [case(NTMS_PHYSICAL_MEDIA)]     NTMS_I1_PMIDINFORMATIONA PhysicalMedia;
  1148.         [case(NTMS_LOGICAL_MEDIA)]      NTMS_LMIDINFORMATION LogicalMedia;
  1149.         [case(NTMS_PARTITION)]          NTMS_I1_PARTITIONINFORMATIONA Partition;
  1150.         [case(NTMS_MEDIA_POOL)]         NTMS_MEDIAPOOLINFORMATION MediaPool;
  1151.         [case(NTMS_MEDIA_TYPE)]         NTMS_MEDIATYPEINFORMATION MediaType;
  1152.         [case(NTMS_LIBREQUEST)]         NTMS_I1_LIBREQUESTINFORMATIONA LibRequest;
  1153.         [case(NTMS_OPREQUEST)]          NTMS_I1_OPREQUESTINFORMATIONA OpRequest;
  1154.         [default]                                       ;
  1155.     } Info;
  1156. #else
  1157.     union {
  1158.         NTMS_DRIVEINFORMATIONA Drive;
  1159.         NTMS_DRIVETYPEINFORMATIONA DriveType;
  1160.         NTMS_I1_LIBRARYINFORMATION Library;
  1161.         NTMS_CHANGERINFORMATIONA Changer;
  1162.         NTMS_CHANGERTYPEINFORMATIONA ChangerType;
  1163.         NTMS_STORAGESLOTINFORMATION StorageSlot;
  1164.         NTMS_IEDOORINFORMATION IEDoor;
  1165.         NTMS_IEPORTINFORMATION IEPort;
  1166.         NTMS_I1_PMIDINFORMATIONA PhysicalMedia;
  1167.         NTMS_LMIDINFORMATION LogicalMedia;
  1168.         NTMS_I1_PARTITIONINFORMATIONA Partition;
  1169.         NTMS_MEDIAPOOLINFORMATION MediaPool;
  1170.         NTMS_MEDIATYPEINFORMATION MediaType;
  1171.         NTMS_I1_LIBREQUESTINFORMATIONA LibRequest;
  1172.         NTMS_I1_OPREQUESTINFORMATIONA OpRequest;
  1173.     } Info;
  1174. #endif  // MIDL_PASS
  1175. } NTMS_I1_OBJECTINFORMATIONA, *LPNTMS_I1_OBJECTINFORMATIONA;
  1176. typedef struct _NTMS_I1_OBJECTINFORMATIONW {
  1177.     DWORD       dwSize;
  1178.     DWORD       dwType;
  1179.     SYSTEMTIME  Created;
  1180.     SYSTEMTIME  Modified;
  1181.     NTMS_GUID   ObjectGuid;
  1182.     BOOL        Enabled;
  1183.     DWORD       dwOperationalState;
  1184.     WCHAR       szName[NTMS_OBJECTNAME_LENGTH];
  1185.     WCHAR       szDescription[NTMS_DESCRIPTION_LENGTH];
  1186. #ifdef MIDL_PASS
  1187.     [switch_is(dwType)] union {
  1188.         [case(NTMS_DRIVE)]              NTMS_DRIVEINFORMATIONW Drive;
  1189.         [case(NTMS_DRIVE_TYPE)]         NTMS_DRIVETYPEINFORMATIONW DriveType;
  1190.         [case(NTMS_LIBRARY)]            NTMS_I1_LIBRARYINFORMATION Library;
  1191.         [case(NTMS_CHANGER)]            NTMS_CHANGERINFORMATIONW Changer;
  1192.         [case(NTMS_CHANGER_TYPE)]       NTMS_CHANGERTYPEINFORMATIONW ChangerType;
  1193.         [case(NTMS_STORAGESLOT)]        NTMS_STORAGESLOTINFORMATION StorageSlot;
  1194.         [case(NTMS_IEDOOR)]             NTMS_IEDOORINFORMATION IEDoor;
  1195.         [case(NTMS_IEPORT)]             NTMS_IEPORTINFORMATION IEPort;
  1196.         [case(NTMS_PHYSICAL_MEDIA)]     NTMS_I1_PMIDINFORMATIONW PhysicalMedia;
  1197.         [case(NTMS_LOGICAL_MEDIA)]      NTMS_LMIDINFORMATION LogicalMedia;
  1198.         [case(NTMS_PARTITION)]          NTMS_I1_PARTITIONINFORMATIONW Partition;
  1199.         [case(NTMS_MEDIA_POOL)]         NTMS_MEDIAPOOLINFORMATION MediaPool;
  1200.         [case(NTMS_MEDIA_TYPE)]         NTMS_MEDIATYPEINFORMATION MediaType;
  1201.         [case(NTMS_LIBREQUEST)]         NTMS_I1_LIBREQUESTINFORMATIONW LibRequest;
  1202.         [case(NTMS_OPREQUEST)]          NTMS_I1_OPREQUESTINFORMATIONW OpRequest;
  1203.         [default]                                       ;
  1204.     } Info;
  1205. #else
  1206.     union {
  1207.         NTMS_DRIVEINFORMATIONW Drive;
  1208.         NTMS_DRIVETYPEINFORMATIONW DriveType;
  1209.         NTMS_I1_LIBRARYINFORMATION Library;
  1210.         NTMS_CHANGERINFORMATIONW Changer;
  1211.         NTMS_CHANGERTYPEINFORMATIONW ChangerType;
  1212.         NTMS_STORAGESLOTINFORMATION StorageSlot;
  1213.         NTMS_IEDOORINFORMATION IEDoor;
  1214.         NTMS_IEPORTINFORMATION IEPort;
  1215.         NTMS_I1_PMIDINFORMATIONW PhysicalMedia;
  1216.         NTMS_LMIDINFORMATION LogicalMedia;
  1217.         NTMS_I1_PARTITIONINFORMATIONW Partition;
  1218.         NTMS_MEDIAPOOLINFORMATION MediaPool;
  1219.         NTMS_MEDIATYPEINFORMATION MediaType;
  1220.         NTMS_I1_LIBREQUESTINFORMATIONW LibRequest;
  1221.         NTMS_I1_OPREQUESTINFORMATIONW OpRequest;
  1222.     } Info;
  1223. #endif  // MIDL_PASS
  1224. } NTMS_I1_OBJECTINFORMATIONW, *LPNTMS_I1_OBJECTINFORMATIONW;
  1225. #endif  // NTMS_NOREDEF
  1226. #ifndef NTMS_NOREDEF
  1227. //=======================================================================
  1228. // CREATENTMSMEDIA DEFINITIONS
  1229. //=======================================================================
  1230. enum NtmsCreateNtmsMediaOptions {
  1231.     NTMS_ERROR_ON_DUPLICATE         = 0x0001
  1232. };
  1233. #endif
  1234. #ifndef MIDL_PASS
  1235. //======================================================================
  1236. // OBJECT MANAGEMENT APIS
  1237. //======================================================================
  1238. #ifdef PRE_SEVIL
  1239. DWORD WINAPI GetNtmsObjectInformation(
  1240.     HANDLE hSession,
  1241.     LPNTMS_GUID lpObjectId,
  1242.     LPNTMS_OBJECTINFORMATION lpInfo
  1243.     );
  1244. DWORD WINAPI SetNtmsObjectInformation(
  1245.     HANDLE hSession,
  1246.     LPNTMS_GUID lpObjectId,
  1247.     LPNTMS_OBJECTINFORMATION lpInfo
  1248.     );
  1249. #endif
  1250. // Added by SEvilia
  1251. DWORD WINAPI GetNtmsObjectInformationA(
  1252.     HANDLE hSession,
  1253.     LPNTMS_GUID lpObjectId,
  1254.     LPNTMS_OBJECTINFORMATIONA lpInfo
  1255.     );
  1256. DWORD WINAPI GetNtmsObjectInformationW(
  1257.     HANDLE hSession,
  1258.     LPNTMS_GUID lpObjectId,
  1259.     LPNTMS_OBJECTINFORMATIONW lpInfo
  1260.     );
  1261. DWORD WINAPI SetNtmsObjectInformationA(
  1262.     HANDLE hSession,
  1263.     LPNTMS_GUID lpObjectId,
  1264.     LPNTMS_OBJECTINFORMATIONA lpInfo
  1265.     );
  1266. DWORD WINAPI SetNtmsObjectInformationW(
  1267.     HANDLE hSession,
  1268.     LPNTMS_GUID lpObjectId,
  1269.     LPNTMS_OBJECTINFORMATIONW lpInfo
  1270.     );
  1271. // END of SEVILIA
  1272. DWORD WINAPI CreateNtmsMediaA(
  1273.     HANDLE hSession,
  1274.     LPNTMS_OBJECTINFORMATIONA lpMedia,
  1275.     LPNTMS_OBJECTINFORMATIONA lpList,
  1276.     DWORD dwOptions
  1277.     ) ;
  1278. DWORD WINAPI CreateNtmsMediaW(
  1279.     HANDLE hSession,
  1280.     LPNTMS_OBJECTINFORMATIONW lpMedia,
  1281.     LPNTMS_OBJECTINFORMATIONW lpList,
  1282.     DWORD dwOptions
  1283.     ) ;
  1284. DWORD WINAPI EnumerateNtmsObject(
  1285.     HANDLE hSession,
  1286.     const LPNTMS_GUID lpContainerId,
  1287.     LPNTMS_GUID lpList,
  1288.     LPDWORD lpdwListSize,
  1289.     DWORD dwType,
  1290.     DWORD dwOptions
  1291.     );
  1292. DWORD WINAPI DisableNtmsObject(
  1293.     HANDLE hSession,
  1294.     DWORD dwType,
  1295.     LPNTMS_GUID lpObjectId
  1296.     );
  1297. DWORD WINAPI EnableNtmsObject(
  1298.     HANDLE hSession,
  1299.     DWORD dwType,
  1300.     LPNTMS_GUID lpObjectId
  1301.     );
  1302. enum NtmsEjectOperation {
  1303.     NTMS_EJECT_START                = 0,
  1304.     NTMS_EJECT_STOP                 = 1,
  1305.     NTMS_EJECT_QUEUE                = 2,
  1306.     NTMS_EJECT_FORCE                = 3,
  1307.     NTMS_EJECT_IMMEDIATE            = 4,
  1308.     NTMS_EJECT_ASK_USER             = 5
  1309. };
  1310. DWORD WINAPI EjectNtmsMedia(
  1311.     HANDLE hSession,
  1312.     LPNTMS_GUID lpMediaId,
  1313.     LPNTMS_GUID lpEjectOperation,
  1314.     DWORD dwAction
  1315.     );
  1316. enum NtmsInjectOperation {
  1317.     NTMS_INJECT_START               = 0,
  1318.     NTMS_INJECT_STOP                = 1,
  1319.     NTMS_INJECT_RETRACT             = 2,
  1320.     NTMS_INJECT_STARTMANY           = 3
  1321. };
  1322. DWORD WINAPI InjectNtmsMedia(
  1323.     HANDLE hSession,
  1324.     LPNTMS_GUID lpLibraryId,
  1325.     LPNTMS_GUID lpInjectOperation,
  1326.     DWORD dwAction
  1327.     );
  1328. DWORD WINAPI AccessNtmsLibraryDoor(
  1329.     HANDLE hSession,
  1330.     LPNTMS_GUID lpLibraryId,
  1331.     DWORD dwAction
  1332.     );
  1333. DWORD WINAPI CleanNtmsDrive(
  1334.     HANDLE hSession,
  1335.     LPNTMS_GUID lpDriveId
  1336.     );
  1337. DWORD WINAPI DismountNtmsDrive(
  1338.     HANDLE hSession,
  1339.     LPNTMS_GUID lpDriveId
  1340.     );
  1341. DWORD WINAPI InventoryNtmsLibrary(
  1342.     HANDLE hSession,
  1343.     LPNTMS_GUID lpLibraryId,
  1344.     DWORD dwAction
  1345.     );
  1346. DWORD WINAPI IdentifyNtmsSlot(
  1347.     HANDLE hSession,
  1348.     LPNTMS_GUID lpSlotId,
  1349.     DWORD dwOption
  1350.     );
  1351. // definitions for the UpdateNtmsOmidInfo ...
  1352. #define NTMS_OMID_TYPE_RAW_LABEL        0x01
  1353. #define NTMS_OMID_TYPE_FILESYSTEM_INFO  0x02
  1354. typedef struct
  1355. {
  1356.     WCHAR FileSystemType[64] ;
  1357.     WCHAR VolumeName[256] ;
  1358.     DWORD SerialNumber ;
  1359. } NTMS_FILESYSTEM_INFO ;
  1360. DWORD WINAPI UpdateNtmsOmidInfo(
  1361.     HANDLE hSession,
  1362.     LPNTMS_GUID lpMediaId,
  1363.     DWORD labelType,
  1364.     DWORD numberOfBytes,
  1365.     LPVOID lpBuffer
  1366.     );
  1367. DWORD WINAPI CancelNtmsLibraryRequest(
  1368.     HANDLE hSession,
  1369.     LPNTMS_GUID lpRequestId
  1370.     );
  1371. DWORD WINAPI GetNtmsRequestOrder(
  1372.     HANDLE hSession,
  1373.     LPNTMS_GUID lpRequestId,
  1374.     LPDWORD lpdwOrderNumber
  1375.     );
  1376. DWORD WINAPI SetNtmsRequestOrder(
  1377.     HANDLE hSession,
  1378.     LPNTMS_GUID lpRequestId,
  1379.     DWORD dwOrderNumber
  1380.     );
  1381. DWORD WINAPI DeleteNtmsRequests(
  1382.     HANDLE hSession,
  1383.     LPNTMS_GUID lpRequestId,
  1384.     DWORD dwType,
  1385.     DWORD dwCount
  1386.     );
  1387. DWORD WINAPI ReserveNtmsCleanerSlot (
  1388.     HANDLE hSession,
  1389.     LPNTMS_GUID lpLibrary,
  1390.     LPNTMS_GUID lpSlot
  1391.     );
  1392. DWORD WINAPI ReleaseNtmsCleanerSlot (
  1393.     HANDLE hSession,
  1394.     LPNTMS_GUID lpLibrary
  1395.     );
  1396. DWORD WINAPI InjectNtmsCleaner (
  1397.     HANDLE hSession,
  1398.     LPNTMS_GUID lpLibrary,
  1399.     LPNTMS_GUID lpInjectOperation,
  1400.     DWORD dwNumberOfCleansLeft,
  1401.     DWORD dwAction
  1402.     );
  1403. DWORD WINAPI EjectNtmsCleaner (
  1404.     HANDLE hSession,
  1405.     LPNTMS_GUID lpLibrary,
  1406.     LPNTMS_GUID lpEjectOperation,
  1407.     DWORD dwAction
  1408.     );
  1409. DWORD WINAPI BeginNtmsDeviceChangeDetection(
  1410.     HANDLE hSession,
  1411.     LPHANDLE lpDetectHandle
  1412.     );
  1413. DWORD WINAPI SetNtmsDeviceChangeDetection(
  1414.     HANDLE hSession,
  1415.     HANDLE DetectHandle,
  1416.     LPNTMS_GUID lpRequestId,
  1417.     DWORD dwType,
  1418.     DWORD dwCount
  1419.     );
  1420. DWORD WINAPI EndNtmsDeviceChangeDetection(
  1421.     HANDLE hSession,
  1422.     HANDLE DetectHandle
  1423.     );
  1424. #endif  // MIDL_PASS
  1425. #ifndef NTMS_NOREDEF
  1426. enum NtmsDriveType {
  1427.     NTMS_UNKNOWN_DRIVE              = 0
  1428. };
  1429. #endif  // NTMS_NOREDEF
  1430. #ifndef MIDL_PASS
  1431. // Security for NTMS API
  1432. DWORD WINAPI GetNtmsObjectSecurity(
  1433.     HANDLE hSession,
  1434.     LPNTMS_GUID lpObjectId,
  1435.     DWORD dwType,
  1436.     SECURITY_INFORMATION RequestedInformation,
  1437.     PSECURITY_DESCRIPTOR lpSecurityDescriptor,
  1438.     DWORD nLength,
  1439.     LPDWORD lpnLengthNeeded
  1440.     );
  1441. DWORD WINAPI SetNtmsObjectSecurity(
  1442.     HANDLE hSession,
  1443.     LPNTMS_GUID lpObjectId,
  1444.     DWORD dwType,
  1445.     SECURITY_INFORMATION SecurityInformation,
  1446.     PSECURITY_DESCRIPTOR lpSecurityDescriptor
  1447.     );
  1448. // Security Access Control Masks :
  1449. // NTMS_USE_ACCESS is required to use an NTMS object.  For example,
  1450. // you will need this access to a library in order to mount media
  1451. // within it.
  1452. // NTMS_MODIFY_ACCESS is required to make changes to an NTMS object.
  1453. // For example, you will need modify access in order to change the name
  1454. // of an object or change its attributes.
  1455. // NTMS_CONTROL_ACCESS is required to control an NTMS object.  For
  1456. // example, you will need control access to a library in order to
  1457. // inject media, eject media, clean or open the door.
  1458. //
  1459. enum NtmsAccessMask {
  1460.     NTMS_USE_ACCESS                 = 0x1,
  1461.     NTMS_MODIFY_ACCESS              = 0x2,
  1462.     NTMS_CONTROL_ACCESS             = 0x4
  1463. };
  1464. // Generic Mappings :
  1465. #define NTMS_GENERIC_READ           NTMS_USE_ACCESS
  1466. #define NTMS_GENERIC_WRITE          NTMS_USE_ACCESS | NTMS_MODIFY_ACCESS
  1467. #define NTMS_GENERIC_EXECUTE        NTMS_USE_ACCESS | NTMS_MODIFY_ACCESS | NTMS_CONTROL_ACCESS
  1468. #define NTMS_GENERIC_ALL            NTMS_USE_ACCESS | NTMS_MODIFY_ACCESS | NTMS_CONTROL_ACCESS
  1469. // Maximum attribute size for NTMS Object attribute API's
  1470. #define NTMS_MAXATTR_LENGTH         0x10000
  1471. // Maximum len of attribute name (# of chars.)
  1472. #define NTMS_MAXATTR_NAMELEN        32
  1473. // Object extensions for NTMS API
  1474. DWORD WINAPI GetNtmsObjectAttributeA(
  1475.     HANDLE hSession,
  1476.     LPNTMS_GUID lpObjectId,
  1477.     DWORD dwType,
  1478.     LPCSTR lpAttributeName,
  1479.     LPVOID lpAttributeData,
  1480.     LPDWORD lpAttributeSize
  1481.     );
  1482. DWORD WINAPI GetNtmsObjectAttributeW(
  1483.     HANDLE hSession,
  1484.     LPNTMS_GUID lpObjectId,
  1485.     DWORD dwType,
  1486.     LPCWSTR lpAttributeName,
  1487.     LPVOID lpAttributeData,
  1488.     LPDWORD lpAttributeSize
  1489.     );
  1490. DWORD WINAPI SetNtmsObjectAttributeA(
  1491.     HANDLE hSession,
  1492.     LPNTMS_GUID lpObjectId,
  1493.     DWORD dwType,
  1494.     LPCSTR lpAttributeName,
  1495.     LPVOID lpAttributeData,
  1496.     DWORD dwAttributeSize
  1497.     );
  1498. DWORD WINAPI SetNtmsObjectAttributeW(
  1499.     HANDLE hSession,
  1500.     LPNTMS_GUID lpObjectId,
  1501.     DWORD dwType,
  1502.     LPCWSTR lpAttributeName,
  1503.     LPVOID lpAttributeData,
  1504.     DWORD AttributeSize
  1505.     );
  1506. //UI Notification
  1507. enum NtmsUITypes {
  1508.     NTMS_UITYPE_INVALID             = 0,
  1509.     NTMS_UITYPE_INFO,
  1510.     NTMS_UITYPE_REQ,
  1511.     NTMS_UITYPE_ERR,
  1512.     NTMS_UITYPE_MAX
  1513. };
  1514. enum NtmsUIOperations {
  1515.     NTMS_UIDEST_ADD                 = 1,
  1516.     NTMS_UIDEST_DELETE,
  1517.     NTMS_UIDEST_DELETEALL,
  1518.     NTMS_UIOPERATION_MAX
  1519. };
  1520. DWORD WINAPI GetNtmsUIOptionsA(
  1521.     HANDLE hSession,
  1522.     const LPNTMS_GUID lpObjectId,
  1523.     DWORD dwType,
  1524.     LPSTR lpszDestination,
  1525.     LPDWORD lpAttributeSize
  1526.     );
  1527. DWORD WINAPI GetNtmsUIOptionsW(
  1528.     HANDLE hSession,
  1529.     const LPNTMS_GUID lpObjectId,
  1530.     DWORD dwType,
  1531.     LPWSTR lpszDestination,
  1532.     LPDWORD lpdwSize
  1533.     );
  1534. DWORD WINAPI SetNtmsUIOptionsA(
  1535.     HANDLE hSession,
  1536.     const LPNTMS_GUID lpObjectId,
  1537.     DWORD dwType,
  1538.     DWORD dwOperation,
  1539.     LPCSTR lpszDestination
  1540.     );
  1541. DWORD WINAPI SetNtmsUIOptionsW(
  1542.     HANDLE hSession,
  1543.     const LPNTMS_GUID lpObjectId,
  1544.     DWORD dwType,
  1545.     DWORD dwOperation,
  1546.     LPCWSTR lpszDestination
  1547.     );
  1548. // Operator Requests
  1549. DWORD WINAPI SubmitNtmsOperatorRequestW(
  1550.     HANDLE hSession,
  1551.     DWORD dwRequest,
  1552.     LPCWSTR lpMessage,
  1553.     LPNTMS_GUID lpArg1Id,
  1554.     LPNTMS_GUID lpArg2Id,
  1555.     LPNTMS_GUID lpRequestId
  1556.     );
  1557. DWORD WINAPI SubmitNtmsOperatorRequestA(
  1558.     HANDLE hSession,
  1559.     DWORD dwRequest,
  1560.     LPCSTR lpMessage,
  1561.     LPNTMS_GUID lpArg1Id,
  1562.     LPNTMS_GUID lpArg2Id,
  1563.     LPNTMS_GUID lpRequestId
  1564.     );
  1565. DWORD WINAPI WaitForNtmsOperatorRequest(
  1566.     HANDLE hSession,
  1567.     LPNTMS_GUID lpRequestId,
  1568.     DWORD dwTimeout
  1569.     );
  1570. DWORD WINAPI CancelNtmsOperatorRequest(
  1571.     HANDLE hSession,
  1572.     LPNTMS_GUID lpRequestId
  1573.     );
  1574. DWORD WINAPI SatisfyNtmsOperatorRequest(
  1575.     HANDLE hSession,
  1576.     LPNTMS_GUID lpRequestId
  1577.     );
  1578. #endif  // MIDL_PASS
  1579. #ifndef NTMS_NOREDEF
  1580. enum NtmsNotificationOperations {
  1581.     NTMS_OBJ_UPDATE                 = 1,
  1582.     NTMS_OBJ_INSERT                 = 2,
  1583.     NTMS_OBJ_DELETE                 = 3,
  1584.     NTMS_EVENT_SIGNAL               = 4,
  1585.     NTMS_EVENT_COMPLETE             = 5
  1586. };
  1587. // object notification
  1588. typedef struct _NTMS_NOTIFICATIONINFORMATION {
  1589.     DWORD dwOperation;
  1590.     NTMS_GUID ObjectId;
  1591. } NTMS_NOTIFICATIONINFORMATION, *LPNTMS_NOTIFICATIONINFORMATION;
  1592. #endif  // NTMS_NOREDEF
  1593. #ifndef MIDL_PASS
  1594. DWORD WINAPI ImportNtmsDatabase(
  1595.     HANDLE hSession
  1596.     );
  1597. DWORD WINAPI ExportNtmsDatabase(
  1598.     HANDLE hSession
  1599.     );
  1600. #endif  // MIDL_PASS
  1601. #ifndef MIDL_PASS
  1602. DWORD WINAPI ImportNtmsDatabase(
  1603.     HANDLE hSession
  1604.     );
  1605. DWORD WINAPI ExportNtmsDatabase(
  1606.     HANDLE hSession
  1607.     );
  1608. #endif  // MIDL_PASS
  1609. #ifndef MIDL_PASS
  1610. HANDLE WINAPI OpenNtmsNotification(
  1611.     HANDLE hSession,
  1612.     DWORD dwType
  1613.     );
  1614. DWORD WINAPI WaitForNtmsNotification(
  1615.     HANDLE hNotification,
  1616.     LPNTMS_NOTIFICATIONINFORMATION lpNotificationInformation,
  1617.     DWORD dwTimeout
  1618.     );
  1619. DWORD WINAPI CloseNtmsNotification(
  1620.     HANDLE hNotification
  1621.     );
  1622. #endif  // MIDL_PASS
  1623. #ifndef MIDL_PASS
  1624. DWORD WINAPI EjectDiskFromSADriveW(
  1625.     LPCWSTR lpComputerName,
  1626.     LPCWSTR lpAppName,
  1627.     LPCWSTR lpDeviceName,
  1628.     HWND hWnd,
  1629.     LPCWSTR lpTitle,
  1630.     LPCWSTR lpMessage,
  1631.     DWORD dwOptions
  1632.     );
  1633. DWORD WINAPI EjectDiskFromSADriveA(
  1634.     LPCSTR lpComputerName,
  1635.     LPCSTR lpAppName,
  1636.     LPCSTR lpDeviceName,
  1637.     HWND hWnd,
  1638.     LPCSTR lpTitle,
  1639.     LPCSTR lpMessage,
  1640.     DWORD dwOptions
  1641.     );
  1642. #endif
  1643. #ifndef MIDL_PASS
  1644. DWORD WINAPI GetVolumesFromDriveW(
  1645.     LPWSTR pszDriveName,
  1646.     LPWSTR *VolumeNameBufferPtr,
  1647.     LPWSTR *DriveLetterBufferPtr
  1648.     );
  1649. DWORD WINAPI GetVolumesFromDriveA(
  1650.     LPSTR pszDriveName,
  1651.     LPSTR* VolumeNameBufferPtr,
  1652.     LPSTR* DriveLetterBufferPtr
  1653.     );
  1654. #endif
  1655. #ifdef __cplusplus
  1656. } // end extern "C"
  1657. #endif
  1658. #pragma pack()
  1659. #endif // _INCL_NTMSAPI_H_