Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1915 lines
59 KiB

  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. NTMS_LIBRARYFLAG_IGNORECLEANERUSESREMAINING = 0x08,
  420. NTMS_LIBRARYFLAG_RECOGNIZECLEANERBARCODE = 0x10
  421. };
  422. enum NtmsInventoryMethod {
  423. NTMS_INVENTORY_NONE = 0,
  424. NTMS_INVENTORY_FAST = 1,
  425. NTMS_INVENTORY_OMID = 2,
  426. NTMS_INVENTORY_DEFAULT = 3,
  427. NTMS_INVENTORY_SLOT = 4,
  428. NTMS_INVENTORY_STOP = 5,
  429. NTMS_INVENTORY_MAX
  430. };
  431. typedef struct _NTMS_LIBRARYINFORMATION {
  432. DWORD LibraryType;
  433. NTMS_GUID CleanerSlot;
  434. NTMS_GUID CleanerSlotDefault;
  435. BOOL LibrarySupportsDriveCleaning;
  436. BOOL BarCodeReaderInstalled;
  437. DWORD InventoryMethod;
  438. DWORD dwCleanerUsesRemaining;
  439. DWORD FirstDriveNumber;
  440. DWORD dwNumberOfDrives;
  441. DWORD FirstSlotNumber;
  442. DWORD dwNumberOfSlots;
  443. DWORD FirstDoorNumber;
  444. DWORD dwNumberOfDoors;
  445. DWORD FirstPortNumber;
  446. DWORD dwNumberOfPorts;
  447. DWORD FirstChangerNumber;
  448. DWORD dwNumberOfChangers;
  449. DWORD dwNumberOfMedia;
  450. DWORD dwNumberOfMediaTypes;
  451. DWORD dwNumberOfLibRequests;
  452. GUID Reserved;
  453. BOOL AutoRecovery;
  454. DWORD dwFlags;
  455. } NTMS_LIBRARYINFORMATION;
  456. #ifdef UNICODE
  457. #define _NTMS_CHANGERINFORMATION _NTMS_CHANGERINFORMATIONW
  458. #define NTMS_CHANGERINFORMATION NTMS_CHANGERINFORMATIONW
  459. #else
  460. #define _NTMS_CHANGERINFORMATION _NTMS_CHANGERINFORMATIONA
  461. #define NTMS_CHANGERINFORMATION NTMS_CHANGERINFORMATIONA
  462. #endif
  463. typedef struct _NTMS_CHANGERINFORMATIONA {
  464. DWORD Number;
  465. NTMS_GUID ChangerType;
  466. CHAR szSerialNumber[NTMS_SERIALNUMBER_LENGTH];
  467. CHAR szRevision[NTMS_REVISION_LENGTH];
  468. CHAR szDeviceName[NTMS_DEVICENAME_LENGTH];
  469. WORD ScsiPort;
  470. WORD ScsiBus;
  471. WORD ScsiTarget;
  472. WORD ScsiLun;
  473. NTMS_GUID Library;
  474. } NTMS_CHANGERINFORMATIONA;
  475. typedef struct _NTMS_CHANGERINFORMATIONW {
  476. DWORD Number;
  477. NTMS_GUID ChangerType;
  478. WCHAR szSerialNumber[NTMS_SERIALNUMBER_LENGTH];
  479. WCHAR szRevision[NTMS_REVISION_LENGTH];
  480. WCHAR szDeviceName[NTMS_DEVICENAME_LENGTH];
  481. WORD ScsiPort;
  482. WORD ScsiBus;
  483. WORD ScsiTarget;
  484. WORD ScsiLun;
  485. NTMS_GUID Library;
  486. } NTMS_CHANGERINFORMATIONW;
  487. enum NtmsSlotState {
  488. NTMS_SLOTSTATE_UNKNOWN = 0,
  489. NTMS_SLOTSTATE_FULL = 1,
  490. NTMS_SLOTSTATE_EMPTY = 2,
  491. NTMS_SLOTSTATE_NOTPRESENT = 3,
  492. NTMS_SLOTSTATE_NEEDSINVENTORY = 4
  493. };
  494. typedef struct _NTMS_STORAGESLOTINFORMATION {
  495. DWORD Number;
  496. DWORD State;
  497. NTMS_GUID Library;
  498. } NTMS_STORAGESLOTINFORMATION;
  499. enum NtmsDoorState {
  500. NTMS_DOORSTATE_UNKNOWN = 0,
  501. NTMS_DOORSTATE_CLOSED = 1,
  502. NTMS_DOORSTATE_OPEN = 2
  503. };
  504. typedef struct _NTMS_IEDOORINFORMATION {
  505. DWORD Number;
  506. DWORD State;
  507. WORD MaxOpenSecs;
  508. NTMS_GUID Library;
  509. } NTMS_IEDOORINFORMATION;
  510. enum NtmsPortPosition {
  511. NTMS_PORTPOSITION_UNKNOWN = 0,
  512. NTMS_PORTPOSITION_EXTENDED = 1,
  513. NTMS_PORTPOSITION_RETRACTED = 2
  514. };
  515. enum NtmsPortContent {
  516. NTMS_PORTCONTENT_UNKNOWN = 0,
  517. NTMS_PORTCONTENT_FULL = 1,
  518. NTMS_PORTCONTENT_EMPTY = 2
  519. };
  520. typedef struct _NTMS_IEPORTINFORMATION {
  521. DWORD Number;
  522. DWORD Content;
  523. DWORD Position;
  524. WORD MaxExtendSecs;
  525. NTMS_GUID Library;
  526. } NTMS_IEPORTINFORMATION;
  527. enum NtmsBarCodeState {
  528. NTMS_BARCODESTATE_OK = 1,
  529. NTMS_BARCODESTATE_UNREADABLE = 2
  530. };
  531. enum NtmsMediaState {
  532. NTMS_MEDIASTATE_IDLE = 0,
  533. NTMS_MEDIASTATE_INUSE = 1,
  534. NTMS_MEDIASTATE_MOUNTED = 2,
  535. NTMS_MEDIASTATE_LOADED = 3,
  536. NTMS_MEDIASTATE_UNLOADED = 4,
  537. NTMS_MEDIASTATE_OPERROR = 5,
  538. // media is waiting for operator request servicing
  539. NTMS_MEDIASTATE_OPREQ = 6
  540. };
  541. #ifdef UNICODE
  542. #define _NTMS_PMIDINFORMATION _NTMS_PMIDINFORMATIONW
  543. #define NTMS_PMIDINFORMATION NTMS_PMIDINFORMATIONW
  544. #else
  545. #define _NTMS_PMIDINFORMATION _NTMS_PMIDINFORMATIONA
  546. #define NTMS_PMIDINFORMATION NTMS_PMIDINFORMATIONA
  547. #endif
  548. typedef struct _NTMS_PMIDINFORMATIONA {
  549. NTMS_GUID CurrentLibrary; // the current library
  550. NTMS_GUID MediaPool; // media pool that the media belongs to
  551. NTMS_GUID Location; // actual location of the media
  552. DWORD LocationType;
  553. NTMS_GUID MediaType;
  554. NTMS_GUID HomeSlot; // home slot for online media
  555. CHAR szBarCode[NTMS_BARCODE_LENGTH]; // bar code string
  556. DWORD BarCodeState; // current state of the bar code
  557. CHAR szSequenceNumber[NTMS_SEQUENCE_LENGTH];
  558. DWORD MediaState; // current media state
  559. DWORD dwNumberOfPartitions;
  560. DWORD dwMediaTypeCode;
  561. DWORD dwDensityCode;
  562. NTMS_GUID MountedPartition;
  563. } NTMS_PMIDINFORMATIONA;
  564. typedef struct _NTMS_PMIDINFORMATIONW {
  565. NTMS_GUID CurrentLibrary; // the current library
  566. NTMS_GUID MediaPool; // media pool that the media belongs to
  567. NTMS_GUID Location; // actual location of the media
  568. DWORD LocationType;
  569. NTMS_GUID MediaType;
  570. NTMS_GUID HomeSlot; // home slot for online media
  571. WCHAR szBarCode[NTMS_BARCODE_LENGTH]; // bar code string
  572. DWORD BarCodeState; // current state of the bar code
  573. WCHAR szSequenceNumber[NTMS_SEQUENCE_LENGTH];
  574. DWORD MediaState; // current media state
  575. DWORD dwNumberOfPartitions;
  576. DWORD dwMediaTypeCode;
  577. DWORD dwDensityCode;
  578. NTMS_GUID MountedPartition;
  579. } NTMS_PMIDINFORMATIONW;
  580. typedef struct _NTMS_LMIDINFORMATION {
  581. NTMS_GUID MediaPool;
  582. DWORD dwNumberOfPartitions;
  583. } NTMS_LMIDINFORMATION;
  584. enum NtmsPartitionState {
  585. NTMS_PARTSTATE_UNKNOWN = 0,
  586. NTMS_PARTSTATE_UNPREPARED = 1,
  587. NTMS_PARTSTATE_INCOMPATIBLE = 2,
  588. NTMS_PARTSTATE_DECOMMISSIONED = 3,
  589. NTMS_PARTSTATE_AVAILABLE = 4,
  590. NTMS_PARTSTATE_ALLOCATED = 5,
  591. NTMS_PARTSTATE_COMPLETE = 6,
  592. NTMS_PARTSTATE_FOREIGN = 7,
  593. NTMS_PARTSTATE_IMPORT = 8,
  594. NTMS_PARTSTATE_RESERVED = 9
  595. };
  596. // define the new state as the unknown state for now.
  597. #define NTMS_PARTSTATE_NEW NTMS_PARTSTATE_UNKNOWN
  598. #ifdef UNICODE
  599. #define _NTMS_PARTITIONINFORMATION _NTMS_PARTITIONINFORMATIONW
  600. #define NTMS_PARTITIONINFORMATION NTMS_PARTITIONINFORMATIONW
  601. #else
  602. #define _NTMS_PARTITIONINFORMATION _NTMS_PARTITIONINFORMATIONA
  603. #define NTMS_PARTITIONINFORMATION NTMS_PARTITIONINFORMATIONA
  604. #endif
  605. typedef struct _NTMS_PARTITIONINFORMATIONA {
  606. NTMS_GUID PhysicalMedia;
  607. NTMS_GUID LogicalMedia;
  608. DWORD State;
  609. WORD Side;
  610. DWORD dwOmidLabelIdLength; // binary id
  611. BYTE OmidLabelId[NTMS_OMIDLABELID_LENGTH];
  612. CHAR szOmidLabelType[NTMS_OMIDLABELTYPE_LENGTH]; // type string
  613. CHAR szOmidLabelInfo[NTMS_OMIDLABELINFO_LENGTH]; // info string
  614. DWORD dwMountCount;
  615. DWORD dwAllocateCount;
  616. LARGE_INTEGER Capacity;
  617. } NTMS_PARTITIONINFORMATIONA;
  618. typedef struct _NTMS_PARTITIONINFORMATIONW {
  619. NTMS_GUID PhysicalMedia;
  620. NTMS_GUID LogicalMedia;
  621. DWORD State;
  622. WORD Side;
  623. DWORD dwOmidLabelIdLength; // binary id
  624. BYTE OmidLabelId[NTMS_OMIDLABELID_LENGTH];
  625. WCHAR szOmidLabelType[NTMS_OMIDLABELTYPE_LENGTH]; // type string
  626. WCHAR szOmidLabelInfo[NTMS_OMIDLABELINFO_LENGTH]; // info string
  627. DWORD dwMountCount;
  628. DWORD dwAllocateCount;
  629. LARGE_INTEGER Capacity;
  630. } NTMS_PARTITIONINFORMATIONW;
  631. enum NtmsPoolType {
  632. NTMS_POOLTYPE_UNKNOWN = 0,
  633. NTMS_POOLTYPE_SCRATCH = 1,
  634. NTMS_POOLTYPE_FOREIGN = 2,
  635. NTMS_POOLTYPE_IMPORT = 3,
  636. NTMS_POOLTYPE_APPLICATION = 1000
  637. };
  638. enum NtmsAllocationPolicy {
  639. NTMS_ALLOCATE_FROMSCRATCH = 1
  640. };
  641. enum NtmsDeallocationPolicy {
  642. NTMS_DEALLOCATE_TOSCRATCH = 1
  643. };
  644. typedef struct _NTMS_MEDIAPOOLINFORMATION {
  645. DWORD PoolType;
  646. NTMS_GUID MediaType;
  647. NTMS_GUID Parent;
  648. DWORD AllocationPolicy;
  649. DWORD DeallocationPolicy;
  650. DWORD dwMaxAllocates;
  651. DWORD dwNumberOfPhysicalMedia;
  652. DWORD dwNumberOfLogicalMedia;
  653. DWORD dwNumberOfMediaPools;
  654. } NTMS_MEDIAPOOLINFORMATION;
  655. enum NtmsReadWriteCharacteristics {
  656. NTMS_MEDIARW_UNKNOWN = 0,
  657. NTMS_MEDIARW_REWRITABLE = 1,
  658. NTMS_MEDIARW_WRITEONCE = 2,
  659. NTMS_MEDIARW_READONLY = 3
  660. };
  661. typedef struct _NTMS_MEDIATYPEINFORMATION {
  662. DWORD MediaType; // MediaTypeCodes
  663. DWORD NumberOfSides;
  664. DWORD ReadWriteCharacteristics;
  665. DWORD DeviceType;
  666. } NTMS_MEDIATYPEINFORMATION;
  667. #ifdef UNICODE
  668. #define _NTMS_DRIVETYPEINFORMATION _NTMS_DRIVETYPEINFORMATIONW
  669. #define NTMS_DRIVETYPEINFORMATION NTMS_DRIVETYPEINFORMATIONW
  670. #else
  671. #define _NTMS_DRIVETYPEINFORMATION _NTMS_DRIVETYPEINFORMATIONA
  672. #define NTMS_DRIVETYPEINFORMATION NTMS_DRIVETYPEINFORMATIONA
  673. #endif
  674. typedef struct _NTMS_DRIVETYPEINFORMATIONA {
  675. CHAR szVendor[NTMS_VENDORNAME_LENGTH];
  676. CHAR szProduct[NTMS_PRODUCTNAME_LENGTH];
  677. DWORD NumberOfHeads;
  678. DWORD DeviceType;
  679. } NTMS_DRIVETYPEINFORMATIONA;
  680. typedef struct _NTMS_DRIVETYPEINFORMATIONW {
  681. WCHAR szVendor[NTMS_VENDORNAME_LENGTH];
  682. WCHAR szProduct[NTMS_PRODUCTNAME_LENGTH];
  683. DWORD NumberOfHeads;
  684. DWORD DeviceType;
  685. } NTMS_DRIVETYPEINFORMATIONW;
  686. #ifdef UNICODE
  687. #define _NTMS_CHANGERTYPEINFORMATION _NTMS_CHANGERTYPEINFORMATIONW
  688. #define NTMS_CHANGERTYPEINFORMATION NTMS_CHANGERTYPEINFORMATIONW
  689. #else
  690. #define _NTMS_CHANGERTYPEINFORMATION _NTMS_CHANGERTYPEINFORMATIONA
  691. #define NTMS_CHANGERTYPEINFORMATION NTMS_CHANGERTYPEINFORMATIONA
  692. #endif
  693. typedef struct _NTMS_CHANGERTYPEINFORMATIONA {
  694. CHAR szVendor[NTMS_VENDORNAME_LENGTH];
  695. CHAR szProduct[NTMS_PRODUCTNAME_LENGTH];
  696. DWORD DeviceType;
  697. } NTMS_CHANGERTYPEINFORMATIONA;
  698. typedef struct _NTMS_CHANGERTYPEINFORMATIONW {
  699. WCHAR szVendor[NTMS_VENDORNAME_LENGTH];
  700. WCHAR szProduct[NTMS_PRODUCTNAME_LENGTH];
  701. DWORD DeviceType;
  702. } NTMS_CHANGERTYPEINFORMATIONW;
  703. //
  704. // Support both CHANGER & LIBRARY for (Dis/Enable) - backwards compatibility
  705. //
  706. enum NtmsLmOperation {
  707. NTMS_LM_REMOVE = 0,
  708. NTMS_LM_DISABLECHANGER = 1,
  709. NTMS_LM_DISABLELIBRARY = 1,
  710. NTMS_LM_ENABLECHANGER = 2,
  711. NTMS_LM_ENABLELIBRARY = 2,
  712. NTMS_LM_DISABLEDRIVE = 3,
  713. NTMS_LM_ENABLEDRIVE = 4,
  714. NTMS_LM_DISABLEMEDIA = 5,
  715. NTMS_LM_ENABLEMEDIA = 6,
  716. NTMS_LM_UPDATEOMID = 7,
  717. NTMS_LM_INVENTORY = 8,
  718. NTMS_LM_DOORACCESS = 9,
  719. NTMS_LM_EJECT = 10,
  720. NTMS_LM_EJECTCLEANER = 11,
  721. NTMS_LM_INJECT = 12,
  722. NTMS_LM_INJECTCLEANER = 13,
  723. NTMS_LM_PROCESSOMID = 14,
  724. NTMS_LM_CLEANDRIVE = 15,
  725. NTMS_LM_DISMOUNT = 16,
  726. NTMS_LM_MOUNT = 17,
  727. NTMS_LM_WRITESCRATCH = 18,
  728. NTMS_LM_CLASSIFY = 19,
  729. NTMS_LM_RESERVECLEANER = 20,
  730. NTMS_LM_RELEASECLEANER = 21,
  731. NTMS_LM_MAXWORKITEM
  732. };
  733. enum NtmsLmState {
  734. NTMS_LM_QUEUED = 0,
  735. NTMS_LM_INPROCESS = 1,
  736. NTMS_LM_PASSED = 2,
  737. NTMS_LM_FAILED = 3,
  738. NTMS_LM_INVALID = 4,
  739. NTMS_LM_WAITING = 5,
  740. NTMS_LM_DEFERRED = 6,
  741. NTMS_LM_DEFFERED = 6, // DO NOT USE. Maintained for backward compatiblity
  742. NTMS_LM_CANCELLED = 7,
  743. NTMS_LM_STOPPED = 8
  744. };
  745. #ifdef UNICODE
  746. #define _NTMS_LIBREQUESTINFORMATION _NTMS_LIBREQUESTINFORMATIONW
  747. #define NTMS_LIBREQUESTINFORMATION NTMS_LIBREQUESTINFORMATIONW
  748. #else
  749. #define _NTMS_LIBREQUESTINFORMATION _NTMS_LIBREQUESTINFORMATIONA
  750. #define NTMS_LIBREQUESTINFORMATION NTMS_LIBREQUESTINFORMATIONA
  751. #endif
  752. typedef struct _NTMS_LIBREQUESTINFORMATIONA {
  753. DWORD OperationCode;
  754. DWORD OperationOption;
  755. DWORD State;
  756. NTMS_GUID PartitionId;
  757. NTMS_GUID DriveId;
  758. NTMS_GUID PhysMediaId;
  759. NTMS_GUID Library;
  760. NTMS_GUID SlotId;
  761. SYSTEMTIME TimeQueued;
  762. SYSTEMTIME TimeCompleted;
  763. CHAR szApplication[NTMS_APPLICATIONNAME_LENGTH];
  764. CHAR szUser[NTMS_USERNAME_LENGTH];
  765. CHAR szComputer[NTMS_COMPUTERNAME_LENGTH];
  766. DWORD dwErrorCode; // error value if state = FAILED
  767. NTMS_GUID WorkItemId; // work item id for cancel and other requests that
  768. DWORD dwPriority; // require and associated work item
  769. } NTMS_LIBREQUESTINFORMATIONA;
  770. typedef struct _NTMS_LIBREQUESTINFORMATIONW {
  771. DWORD OperationCode;
  772. DWORD OperationOption;
  773. DWORD State;
  774. NTMS_GUID PartitionId;
  775. NTMS_GUID DriveId;
  776. NTMS_GUID PhysMediaId;
  777. NTMS_GUID Library;
  778. NTMS_GUID SlotId;
  779. SYSTEMTIME TimeQueued;
  780. SYSTEMTIME TimeCompleted;
  781. WCHAR szApplication[NTMS_APPLICATIONNAME_LENGTH];
  782. WCHAR szUser[NTMS_USERNAME_LENGTH];
  783. WCHAR szComputer[NTMS_COMPUTERNAME_LENGTH];
  784. DWORD dwErrorCode; // error value if state = FAILED
  785. NTMS_GUID WorkItemId; // work item id for cancel and other requests that
  786. DWORD dwPriority; // require and associated work item
  787. } NTMS_LIBREQUESTINFORMATIONW;
  788. enum NtmsOpreqCommand {
  789. NTMS_OPREQ_UNKNOWN = 0,
  790. NTMS_OPREQ_NEWMEDIA = 1,
  791. NTMS_OPREQ_CLEANER = 2,
  792. NTMS_OPREQ_DEVICESERVICE = 3,
  793. NTMS_OPREQ_MOVEMEDIA = 4,
  794. NTMS_OPREQ_MESSAGE = 5
  795. };
  796. enum NtmsOpreqState {
  797. NTMS_OPSTATE_UNKNOWN = 0,
  798. NTMS_OPSTATE_SUBMITTED = 1,
  799. NTMS_OPSTATE_ACTIVE = 2,
  800. NTMS_OPSTATE_INPROGRESS = 3,
  801. NTMS_OPSTATE_REFUSED = 4,
  802. NTMS_OPSTATE_COMPLETE = 5
  803. };
  804. #ifdef UNICODE
  805. #define _NTMS_OPREQUESTINFORMATION _NTMS_OPREQUESTINFORMATIONW
  806. #define NTMS_OPREQUESTINFORMATION NTMS_OPREQUESTINFORMATIONW
  807. #else
  808. #define _NTMS_OPREQUESTINFORMATION _NTMS_OPREQUESTINFORMATIONA
  809. #define NTMS_OPREQUESTINFORMATION NTMS_OPREQUESTINFORMATIONA
  810. #endif
  811. typedef struct _NTMS_OPREQUESTINFORMATIONA {
  812. DWORD Request;
  813. SYSTEMTIME Submitted;
  814. DWORD State;
  815. CHAR szMessage[NTMS_MESSAGE_LENGTH];
  816. DWORD Arg1Type;
  817. NTMS_GUID Arg1;
  818. DWORD Arg2Type;
  819. NTMS_GUID Arg2;
  820. CHAR szApplication[NTMS_APPLICATIONNAME_LENGTH];
  821. CHAR szUser[NTMS_USERNAME_LENGTH];
  822. CHAR szComputer[NTMS_COMPUTERNAME_LENGTH];
  823. } NTMS_OPREQUESTINFORMATIONA;
  824. typedef struct _NTMS_OPREQUESTINFORMATIONW {
  825. DWORD Request;
  826. SYSTEMTIME Submitted;
  827. DWORD State;
  828. WCHAR szMessage[NTMS_MESSAGE_LENGTH];
  829. DWORD Arg1Type;
  830. NTMS_GUID Arg1;
  831. DWORD Arg2Type;
  832. NTMS_GUID Arg2;
  833. WCHAR szApplication[NTMS_APPLICATIONNAME_LENGTH];
  834. WCHAR szUser[NTMS_USERNAME_LENGTH];
  835. WCHAR szComputer[NTMS_COMPUTERNAME_LENGTH];
  836. } NTMS_OPREQUESTINFORMATIONW;
  837. typedef struct _NTMS_COMPUTERINFORMATION {
  838. DWORD dwLibRequestPurgeTime;
  839. DWORD dwOpRequestPurgeTime;
  840. DWORD dwLibRequestFlags;
  841. DWORD dwOpRequestFlags;
  842. DWORD dwMediaPoolPolicy;
  843. } NTMS_COMPUTERINFORMATION;
  844. // library request option flags
  845. enum NtmsLibRequestFlags {
  846. NTMS_LIBREQFLAGS_NOAUTOPURGE = 0x01,
  847. NTMS_LIBREQFLAGS_NOFAILEDPURGE = 0x02
  848. };
  849. // operator request option flags
  850. enum NtmsOpRequestFlags {
  851. NTMS_OPREQFLAGS_NOAUTOPURGE = 0x01,
  852. NTMS_OPREQFLAGS_NOFAILEDPURGE = 0x02,
  853. NTMS_OPREQFLAGS_NOALERTS = 0x10,
  854. NTMS_OPREQFLAGS_NOTRAYICON = 0x20
  855. };
  856. // media pool policy flags
  857. enum NtmsMediaPoolPolicy {
  858. // purge offline scratch media. By default we keep offline scratch media
  859. // in the fixed offline media pool
  860. NTMS_POOLPOLICY_PURGEOFFLINESCRATCH = 0x01,
  861. NTMS_POOLPOLICY_KEEPOFFLINEIMPORT = 0x02
  862. };
  863. #ifdef UNICODE
  864. #define _NTMS_OBJECTINFORMATION _NTMS_OBJECTINFORMATIONW
  865. #define NTMS_OBJECTINFORMATION NTMS_OBJECTINFORMATIONW
  866. #define LPNTMS_OBJECTINFORMATION LPNTMS_OBJECTINFORMATIONW
  867. #else
  868. #define _NTMS_OBJECTINFORMATION _NTMS_OBJECTINFORMATIONA
  869. #define NTMS_OBJECTINFORMATION NTMS_OBJECTINFORMATIONA
  870. #define LPNTMS_OBJECTINFORMATION LPNTMS_OBJECTINFORMATIONA
  871. #endif
  872. enum NtmsOperationalState {
  873. NTMS_READY = 0,
  874. NTMS_INITIALIZING = 10,
  875. NTMS_NEEDS_SERVICE = 20,
  876. NTMS_NOT_PRESENT = 21
  877. };
  878. typedef struct _NTMS_OBJECTINFORMATIONA {
  879. DWORD dwSize;
  880. DWORD dwType;
  881. SYSTEMTIME Created;
  882. SYSTEMTIME Modified;
  883. NTMS_GUID ObjectGuid;
  884. BOOL Enabled;
  885. DWORD dwOperationalState;
  886. CHAR szName[NTMS_OBJECTNAME_LENGTH];
  887. CHAR szDescription[NTMS_DESCRIPTION_LENGTH];
  888. #ifdef MIDL_PASS
  889. [switch_is(dwType)] union {
  890. [case(NTMS_DRIVE)] NTMS_DRIVEINFORMATIONA Drive;
  891. [case(NTMS_DRIVE_TYPE)] NTMS_DRIVETYPEINFORMATIONA DriveType;
  892. [case(NTMS_LIBRARY)] NTMS_LIBRARYINFORMATION Library;
  893. [case(NTMS_CHANGER)] NTMS_CHANGERINFORMATIONA Changer;
  894. [case(NTMS_CHANGER_TYPE)] NTMS_CHANGERTYPEINFORMATIONA ChangerType;
  895. [case(NTMS_STORAGESLOT)] NTMS_STORAGESLOTINFORMATION StorageSlot;
  896. [case(NTMS_IEDOOR)] NTMS_IEDOORINFORMATION IEDoor;
  897. [case(NTMS_IEPORT)] NTMS_IEPORTINFORMATION IEPort;
  898. [case(NTMS_PHYSICAL_MEDIA)] NTMS_PMIDINFORMATIONA PhysicalMedia;
  899. [case(NTMS_LOGICAL_MEDIA)] NTMS_LMIDINFORMATION LogicalMedia;
  900. [case(NTMS_PARTITION)] NTMS_PARTITIONINFORMATIONA Partition;
  901. [case(NTMS_MEDIA_POOL)] NTMS_MEDIAPOOLINFORMATION MediaPool;
  902. [case(NTMS_MEDIA_TYPE)] NTMS_MEDIATYPEINFORMATION MediaType;
  903. [case(NTMS_LIBREQUEST)] NTMS_LIBREQUESTINFORMATIONA LibRequest;
  904. [case(NTMS_OPREQUEST)] NTMS_OPREQUESTINFORMATIONA OpRequest;
  905. [case(NTMS_COMPUTER)] NTMS_COMPUTERINFORMATION Computer;
  906. [default] ;
  907. } Info;
  908. #else
  909. union {
  910. NTMS_DRIVEINFORMATIONA Drive;
  911. NTMS_DRIVETYPEINFORMATIONA DriveType;
  912. NTMS_LIBRARYINFORMATION Library;
  913. NTMS_CHANGERINFORMATIONA Changer;
  914. NTMS_CHANGERTYPEINFORMATIONA ChangerType;
  915. NTMS_STORAGESLOTINFORMATION StorageSlot;
  916. NTMS_IEDOORINFORMATION IEDoor;
  917. NTMS_IEPORTINFORMATION IEPort;
  918. NTMS_PMIDINFORMATIONA PhysicalMedia;
  919. NTMS_LMIDINFORMATION LogicalMedia;
  920. NTMS_PARTITIONINFORMATIONA Partition;
  921. NTMS_MEDIAPOOLINFORMATION MediaPool;
  922. NTMS_MEDIATYPEINFORMATION MediaType;
  923. NTMS_LIBREQUESTINFORMATIONA LibRequest;
  924. NTMS_OPREQUESTINFORMATIONA OpRequest;
  925. NTMS_COMPUTERINFORMATION Computer;
  926. } Info;
  927. #endif // MIDL_PASS
  928. } NTMS_OBJECTINFORMATIONA, *LPNTMS_OBJECTINFORMATIONA;
  929. typedef struct _NTMS_OBJECTINFORMATIONW {
  930. DWORD dwSize;
  931. DWORD dwType;
  932. SYSTEMTIME Created;
  933. SYSTEMTIME Modified;
  934. NTMS_GUID ObjectGuid;
  935. BOOL Enabled;
  936. DWORD dwOperationalState;
  937. WCHAR szName[NTMS_OBJECTNAME_LENGTH];
  938. WCHAR szDescription[NTMS_DESCRIPTION_LENGTH];
  939. #ifdef MIDL_PASS
  940. [switch_is(dwType)] union {
  941. [case(NTMS_DRIVE)] NTMS_DRIVEINFORMATIONW Drive;
  942. [case(NTMS_DRIVE_TYPE)] NTMS_DRIVETYPEINFORMATIONW DriveType;
  943. [case(NTMS_LIBRARY)] NTMS_LIBRARYINFORMATION Library;
  944. [case(NTMS_CHANGER)] NTMS_CHANGERINFORMATIONW Changer;
  945. [case(NTMS_CHANGER_TYPE)] NTMS_CHANGERTYPEINFORMATIONW ChangerType;
  946. [case(NTMS_STORAGESLOT)] NTMS_STORAGESLOTINFORMATION StorageSlot;
  947. [case(NTMS_IEDOOR)] NTMS_IEDOORINFORMATION IEDoor;
  948. [case(NTMS_IEPORT)] NTMS_IEPORTINFORMATION IEPort;
  949. [case(NTMS_PHYSICAL_MEDIA)] NTMS_PMIDINFORMATIONW PhysicalMedia;
  950. [case(NTMS_LOGICAL_MEDIA)] NTMS_LMIDINFORMATION LogicalMedia;
  951. [case(NTMS_PARTITION)] NTMS_PARTITIONINFORMATIONW Partition;
  952. [case(NTMS_MEDIA_POOL)] NTMS_MEDIAPOOLINFORMATION MediaPool;
  953. [case(NTMS_MEDIA_TYPE)] NTMS_MEDIATYPEINFORMATION MediaType;
  954. [case(NTMS_LIBREQUEST)] NTMS_LIBREQUESTINFORMATIONW LibRequest;
  955. [case(NTMS_OPREQUEST)] NTMS_OPREQUESTINFORMATIONW OpRequest;
  956. [case(NTMS_COMPUTER)] NTMS_COMPUTERINFORMATION Computer;
  957. [default] ;
  958. } Info;
  959. #else
  960. union {
  961. NTMS_DRIVEINFORMATIONW Drive;
  962. NTMS_DRIVETYPEINFORMATIONW DriveType;
  963. NTMS_LIBRARYINFORMATION Library;
  964. NTMS_CHANGERINFORMATIONW Changer;
  965. NTMS_CHANGERTYPEINFORMATIONW ChangerType;
  966. NTMS_STORAGESLOTINFORMATION StorageSlot;
  967. NTMS_IEDOORINFORMATION IEDoor;
  968. NTMS_IEPORTINFORMATION IEPort;
  969. NTMS_PMIDINFORMATIONW PhysicalMedia;
  970. NTMS_LMIDINFORMATION LogicalMedia;
  971. NTMS_PARTITIONINFORMATIONW Partition;
  972. NTMS_MEDIAPOOLINFORMATION MediaPool;
  973. NTMS_MEDIATYPEINFORMATION MediaType;
  974. NTMS_LIBREQUESTINFORMATIONW LibRequest;
  975. NTMS_OPREQUESTINFORMATIONW OpRequest;
  976. NTMS_COMPUTERINFORMATION Computer;
  977. } Info;
  978. #endif // MIDL_PASS
  979. } NTMS_OBJECTINFORMATIONW, *LPNTMS_OBJECTINFORMATIONW;
  980. //********************************************************************************
  981. // NT 5.0 BETA1 variations of object information. Required to keep here for
  982. // backward compatibility in DCOM interface.
  983. // Different data structures add the _I1_ to the structure name, denoting
  984. // used for Interface 1 only.
  985. // DO NOT MODIFY IN FUTURE VERSIONS !!
  986. //********************************************************************************
  987. #ifdef UNICODE
  988. #define NTMS_I1_LIBREQUESTINFORMATION NTMS_I1_LIBREQUESTINFORMATIONW
  989. #define NTMS_I1_PARTITIONINFORMATION NTMS_I1_PARTITIONINFORMATIONW
  990. #define NTMS_I1_PMIDINFORMATION NTMS_I1_PMIDINFORMATIONW
  991. #define NTMS_I1_OPREQUESTINFORMATION NTMS_I1_OPREQUESTINFORMATIONW
  992. #define NTMS_I1_OBJECTINFORMATION NTMS_I1_OBJECTINFORMATIONW
  993. #else
  994. #define NTMS_I1_LIBREQUESTINFORMATION NTMS_I1_LIBREQUESTINFORMATIONA
  995. #define NTMS_I1_PARTITIONINFORMATION NTMS_I1_PARTITIONINFORMATIONA
  996. #define NTMS_I1_PMIDINFORMATION NTMS_I1_PMIDINFORMATIONA
  997. #define NTMS_I1_OPREQUESTINFORMATION NTMS_I1_OPREQUESTINFORMATIONA
  998. #define NTMS_I1_OBJECTINFORMATION NTMS_I1_OBJECTINFORMATIONA
  999. #endif
  1000. typedef struct _NTMS_I1_LIBRARYINFORMATION {
  1001. DWORD LibraryType;
  1002. NTMS_GUID CleanerSlot;
  1003. NTMS_GUID CleanerSlotDefault;
  1004. BOOL LibrarySupportsDriveCleaning;
  1005. BOOL BarCodeReaderInstalled;
  1006. DWORD InventoryMethod;
  1007. DWORD dwCleanerUsesRemaining;
  1008. DWORD FirstDriveNumber;
  1009. DWORD dwNumberOfDrives;
  1010. DWORD FirstSlotNumber;
  1011. DWORD dwNumberOfSlots;
  1012. DWORD FirstDoorNumber;
  1013. DWORD dwNumberOfDoors;
  1014. DWORD FirstPortNumber;
  1015. DWORD dwNumberOfPorts;
  1016. DWORD FirstChangerNumber;
  1017. DWORD dwNumberOfChangers;
  1018. DWORD dwNumberOfMedia;
  1019. DWORD dwNumberOfMediaTypes;
  1020. DWORD dwNumberOfLibRequests;
  1021. GUID Reserved;
  1022. } NTMS_I1_LIBRARYINFORMATION;
  1023. typedef struct _NTMS_I1_LIBREQUESTINFORMATIONA {
  1024. DWORD OperationCode;
  1025. DWORD OperationOption;
  1026. DWORD State;
  1027. NTMS_GUID PartitionId;
  1028. NTMS_GUID DriveId;
  1029. NTMS_GUID PhysMediaId;
  1030. NTMS_GUID Library;
  1031. NTMS_GUID SlotId;
  1032. SYSTEMTIME TimeQueued;
  1033. SYSTEMTIME TimeCompleted;
  1034. CHAR szApplication[NTMS_APPLICATIONNAME_LENGTH];
  1035. CHAR szUser[NTMS_USERNAME_LENGTH];
  1036. CHAR szComputer[NTMS_COMPUTERNAME_LENGTH];
  1037. } NTMS_I1_LIBREQUESTINFORMATIONA;
  1038. typedef struct _NTMS_I1_LIBREQUESTINFORMATIONW {
  1039. DWORD OperationCode;
  1040. DWORD OperationOption;
  1041. DWORD State;
  1042. NTMS_GUID PartitionId;
  1043. NTMS_GUID DriveId;
  1044. NTMS_GUID PhysMediaId;
  1045. NTMS_GUID Library;
  1046. NTMS_GUID SlotId;
  1047. SYSTEMTIME TimeQueued;
  1048. SYSTEMTIME TimeCompleted;
  1049. WCHAR szApplication[NTMS_APPLICATIONNAME_LENGTH];
  1050. WCHAR szUser[NTMS_USERNAME_LENGTH];
  1051. WCHAR szComputer[NTMS_COMPUTERNAME_LENGTH];
  1052. } NTMS_I1_LIBREQUESTINFORMATIONW;
  1053. typedef struct _NTMS_I1_PMIDINFORMATIONA {
  1054. NTMS_GUID CurrentLibrary; // the current library
  1055. NTMS_GUID MediaPool; // media pool that the media belongs to
  1056. NTMS_GUID Location; // actual location of the media
  1057. DWORD LocationType;
  1058. NTMS_GUID MediaType;
  1059. NTMS_GUID HomeSlot; // home slot for online media
  1060. CHAR szBarCode[NTMS_BARCODE_LENGTH]; // bar code string
  1061. DWORD BarCodeState; // current state of the bar code
  1062. CHAR szSequenceNumber[NTMS_SEQUENCE_LENGTH];
  1063. DWORD MediaState; // current media state
  1064. DWORD dwNumberOfPartitions;
  1065. } NTMS_I1_PMIDINFORMATIONA;
  1066. typedef struct _NTMS_I1_PMIDINFORMATIONW {
  1067. NTMS_GUID CurrentLibrary; // the current library
  1068. NTMS_GUID MediaPool; // media pool that the media belongs to
  1069. NTMS_GUID Location; // actual location of the media
  1070. DWORD LocationType;
  1071. NTMS_GUID MediaType;
  1072. NTMS_GUID HomeSlot; // home slot for online media
  1073. WCHAR szBarCode[NTMS_BARCODE_LENGTH]; // bar code string
  1074. DWORD BarCodeState; // current state of the bar code
  1075. WCHAR szSequenceNumber[NTMS_SEQUENCE_LENGTH];
  1076. DWORD MediaState; // current media state
  1077. DWORD dwNumberOfPartitions;
  1078. } NTMS_I1_PMIDINFORMATIONW;
  1079. typedef struct _NTMS_I1_PARTITIONINFORMATIONA {
  1080. NTMS_GUID PhysicalMedia;
  1081. NTMS_GUID LogicalMedia;
  1082. DWORD State;
  1083. WORD Side;
  1084. DWORD dwOmidLabelIdLength; // binary id
  1085. BYTE OmidLabelId[255];
  1086. CHAR szOmidLabelType[64]; // type string
  1087. CHAR szOmidLabelInfo[256]; // info string
  1088. DWORD dwMountCount;
  1089. DWORD dwAllocateCount;
  1090. } NTMS_I1_PARTITIONINFORMATIONA;
  1091. typedef struct _NTMS_I1_PARTITIONINFORMATIONW {
  1092. NTMS_GUID PhysicalMedia;
  1093. NTMS_GUID LogicalMedia;
  1094. DWORD State;
  1095. WORD Side;
  1096. DWORD dwOmidLabelIdLength; // binary id
  1097. BYTE OmidLabelId[255];
  1098. WCHAR szOmidLabelType[64]; // type string
  1099. WCHAR szOmidLabelInfo[256]; // info string
  1100. DWORD dwMountCount;
  1101. DWORD dwAllocateCount;
  1102. } NTMS_I1_PARTITIONINFORMATIONW;
  1103. typedef struct _NTMS_I1_OPREQUESTINFORMATIONA {
  1104. DWORD Request;
  1105. SYSTEMTIME Submitted;
  1106. DWORD State;
  1107. CHAR szMessage[NTMS_I1_MESSAGE_LENGTH];
  1108. DWORD Arg1Type;
  1109. NTMS_GUID Arg1;
  1110. DWORD Arg2Type;
  1111. NTMS_GUID Arg2;
  1112. CHAR szApplication[NTMS_APPLICATIONNAME_LENGTH];
  1113. CHAR szUser[NTMS_USERNAME_LENGTH];
  1114. CHAR szComputer[NTMS_COMPUTERNAME_LENGTH];
  1115. } NTMS_I1_OPREQUESTINFORMATIONA;
  1116. typedef struct _NTMS_I1_OPREQUESTINFORMATIONW {
  1117. DWORD Request;
  1118. SYSTEMTIME Submitted;
  1119. DWORD State;
  1120. WCHAR szMessage[NTMS_I1_MESSAGE_LENGTH];
  1121. DWORD Arg1Type;
  1122. NTMS_GUID Arg1;
  1123. DWORD Arg2Type;
  1124. NTMS_GUID Arg2;
  1125. WCHAR szApplication[NTMS_APPLICATIONNAME_LENGTH];
  1126. WCHAR szUser[NTMS_USERNAME_LENGTH];
  1127. WCHAR szComputer[NTMS_COMPUTERNAME_LENGTH];
  1128. } NTMS_I1_OPREQUESTINFORMATIONW;
  1129. typedef struct _NTMS_I1_OBJECTINFORMATIONA {
  1130. DWORD dwSize;
  1131. DWORD dwType;
  1132. SYSTEMTIME Created;
  1133. SYSTEMTIME Modified;
  1134. NTMS_GUID ObjectGuid;
  1135. BOOL Enabled;
  1136. DWORD dwOperationalState;
  1137. CHAR szName[NTMS_OBJECTNAME_LENGTH];
  1138. CHAR szDescription[NTMS_DESCRIPTION_LENGTH];
  1139. #ifdef MIDL_PASS
  1140. [switch_is(dwType)] union {
  1141. [case(NTMS_DRIVE)] NTMS_DRIVEINFORMATIONA Drive;
  1142. [case(NTMS_DRIVE_TYPE)] NTMS_DRIVETYPEINFORMATIONA DriveType;
  1143. [case(NTMS_LIBRARY)] NTMS_I1_LIBRARYINFORMATION Library;
  1144. [case(NTMS_CHANGER)] NTMS_CHANGERINFORMATIONA Changer;
  1145. [case(NTMS_CHANGER_TYPE)] NTMS_CHANGERTYPEINFORMATIONA ChangerType;
  1146. [case(NTMS_STORAGESLOT)] NTMS_STORAGESLOTINFORMATION StorageSlot;
  1147. [case(NTMS_IEDOOR)] NTMS_IEDOORINFORMATION IEDoor;
  1148. [case(NTMS_IEPORT)] NTMS_IEPORTINFORMATION IEPort;
  1149. [case(NTMS_PHYSICAL_MEDIA)] NTMS_I1_PMIDINFORMATIONA PhysicalMedia;
  1150. [case(NTMS_LOGICAL_MEDIA)] NTMS_LMIDINFORMATION LogicalMedia;
  1151. [case(NTMS_PARTITION)] NTMS_I1_PARTITIONINFORMATIONA Partition;
  1152. [case(NTMS_MEDIA_POOL)] NTMS_MEDIAPOOLINFORMATION MediaPool;
  1153. [case(NTMS_MEDIA_TYPE)] NTMS_MEDIATYPEINFORMATION MediaType;
  1154. [case(NTMS_LIBREQUEST)] NTMS_I1_LIBREQUESTINFORMATIONA LibRequest;
  1155. [case(NTMS_OPREQUEST)] NTMS_I1_OPREQUESTINFORMATIONA OpRequest;
  1156. [default] ;
  1157. } Info;
  1158. #else
  1159. union {
  1160. NTMS_DRIVEINFORMATIONA Drive;
  1161. NTMS_DRIVETYPEINFORMATIONA DriveType;
  1162. NTMS_I1_LIBRARYINFORMATION Library;
  1163. NTMS_CHANGERINFORMATIONA Changer;
  1164. NTMS_CHANGERTYPEINFORMATIONA ChangerType;
  1165. NTMS_STORAGESLOTINFORMATION StorageSlot;
  1166. NTMS_IEDOORINFORMATION IEDoor;
  1167. NTMS_IEPORTINFORMATION IEPort;
  1168. NTMS_I1_PMIDINFORMATIONA PhysicalMedia;
  1169. NTMS_LMIDINFORMATION LogicalMedia;
  1170. NTMS_I1_PARTITIONINFORMATIONA Partition;
  1171. NTMS_MEDIAPOOLINFORMATION MediaPool;
  1172. NTMS_MEDIATYPEINFORMATION MediaType;
  1173. NTMS_I1_LIBREQUESTINFORMATIONA LibRequest;
  1174. NTMS_I1_OPREQUESTINFORMATIONA OpRequest;
  1175. } Info;
  1176. #endif // MIDL_PASS
  1177. } NTMS_I1_OBJECTINFORMATIONA, *LPNTMS_I1_OBJECTINFORMATIONA;
  1178. typedef struct _NTMS_I1_OBJECTINFORMATIONW {
  1179. DWORD dwSize;
  1180. DWORD dwType;
  1181. SYSTEMTIME Created;
  1182. SYSTEMTIME Modified;
  1183. NTMS_GUID ObjectGuid;
  1184. BOOL Enabled;
  1185. DWORD dwOperationalState;
  1186. WCHAR szName[NTMS_OBJECTNAME_LENGTH];
  1187. WCHAR szDescription[NTMS_DESCRIPTION_LENGTH];
  1188. #ifdef MIDL_PASS
  1189. [switch_is(dwType)] union {
  1190. [case(NTMS_DRIVE)] NTMS_DRIVEINFORMATIONW Drive;
  1191. [case(NTMS_DRIVE_TYPE)] NTMS_DRIVETYPEINFORMATIONW DriveType;
  1192. [case(NTMS_LIBRARY)] NTMS_I1_LIBRARYINFORMATION Library;
  1193. [case(NTMS_CHANGER)] NTMS_CHANGERINFORMATIONW Changer;
  1194. [case(NTMS_CHANGER_TYPE)] NTMS_CHANGERTYPEINFORMATIONW ChangerType;
  1195. [case(NTMS_STORAGESLOT)] NTMS_STORAGESLOTINFORMATION StorageSlot;
  1196. [case(NTMS_IEDOOR)] NTMS_IEDOORINFORMATION IEDoor;
  1197. [case(NTMS_IEPORT)] NTMS_IEPORTINFORMATION IEPort;
  1198. [case(NTMS_PHYSICAL_MEDIA)] NTMS_I1_PMIDINFORMATIONW PhysicalMedia;
  1199. [case(NTMS_LOGICAL_MEDIA)] NTMS_LMIDINFORMATION LogicalMedia;
  1200. [case(NTMS_PARTITION)] NTMS_I1_PARTITIONINFORMATIONW Partition;
  1201. [case(NTMS_MEDIA_POOL)] NTMS_MEDIAPOOLINFORMATION MediaPool;
  1202. [case(NTMS_MEDIA_TYPE)] NTMS_MEDIATYPEINFORMATION MediaType;
  1203. [case(NTMS_LIBREQUEST)] NTMS_I1_LIBREQUESTINFORMATIONW LibRequest;
  1204. [case(NTMS_OPREQUEST)] NTMS_I1_OPREQUESTINFORMATIONW OpRequest;
  1205. [default] ;
  1206. } Info;
  1207. #else
  1208. union {
  1209. NTMS_DRIVEINFORMATIONW Drive;
  1210. NTMS_DRIVETYPEINFORMATIONW DriveType;
  1211. NTMS_I1_LIBRARYINFORMATION Library;
  1212. NTMS_CHANGERINFORMATIONW Changer;
  1213. NTMS_CHANGERTYPEINFORMATIONW ChangerType;
  1214. NTMS_STORAGESLOTINFORMATION StorageSlot;
  1215. NTMS_IEDOORINFORMATION IEDoor;
  1216. NTMS_IEPORTINFORMATION IEPort;
  1217. NTMS_I1_PMIDINFORMATIONW PhysicalMedia;
  1218. NTMS_LMIDINFORMATION LogicalMedia;
  1219. NTMS_I1_PARTITIONINFORMATIONW Partition;
  1220. NTMS_MEDIAPOOLINFORMATION MediaPool;
  1221. NTMS_MEDIATYPEINFORMATION MediaType;
  1222. NTMS_I1_LIBREQUESTINFORMATIONW LibRequest;
  1223. NTMS_I1_OPREQUESTINFORMATIONW OpRequest;
  1224. } Info;
  1225. #endif // MIDL_PASS
  1226. } NTMS_I1_OBJECTINFORMATIONW, *LPNTMS_I1_OBJECTINFORMATIONW;
  1227. #endif // NTMS_NOREDEF
  1228. #ifndef NTMS_NOREDEF
  1229. //=======================================================================
  1230. // CREATENTMSMEDIA DEFINITIONS
  1231. //=======================================================================
  1232. enum NtmsCreateNtmsMediaOptions {
  1233. NTMS_ERROR_ON_DUPLICATE = 0x0001
  1234. };
  1235. #endif
  1236. #ifndef MIDL_PASS
  1237. //======================================================================
  1238. // OBJECT MANAGEMENT APIS
  1239. //======================================================================
  1240. #ifdef PRE_SEVIL
  1241. DWORD WINAPI GetNtmsObjectInformation(
  1242. HANDLE hSession,
  1243. LPNTMS_GUID lpObjectId,
  1244. LPNTMS_OBJECTINFORMATION lpInfo
  1245. );
  1246. DWORD WINAPI SetNtmsObjectInformation(
  1247. HANDLE hSession,
  1248. LPNTMS_GUID lpObjectId,
  1249. LPNTMS_OBJECTINFORMATION lpInfo
  1250. );
  1251. #endif
  1252. // Added by SEvilia
  1253. DWORD WINAPI GetNtmsObjectInformationA(
  1254. HANDLE hSession,
  1255. LPNTMS_GUID lpObjectId,
  1256. LPNTMS_OBJECTINFORMATIONA lpInfo
  1257. );
  1258. DWORD WINAPI GetNtmsObjectInformationW(
  1259. HANDLE hSession,
  1260. LPNTMS_GUID lpObjectId,
  1261. LPNTMS_OBJECTINFORMATIONW lpInfo
  1262. );
  1263. DWORD WINAPI SetNtmsObjectInformationA(
  1264. HANDLE hSession,
  1265. LPNTMS_GUID lpObjectId,
  1266. LPNTMS_OBJECTINFORMATIONA lpInfo
  1267. );
  1268. DWORD WINAPI SetNtmsObjectInformationW(
  1269. HANDLE hSession,
  1270. LPNTMS_GUID lpObjectId,
  1271. LPNTMS_OBJECTINFORMATIONW lpInfo
  1272. );
  1273. // END of SEVILIA
  1274. DWORD WINAPI CreateNtmsMediaA(
  1275. HANDLE hSession,
  1276. LPNTMS_OBJECTINFORMATIONA lpMedia,
  1277. LPNTMS_OBJECTINFORMATIONA lpList,
  1278. DWORD dwOptions
  1279. ) ;
  1280. DWORD WINAPI CreateNtmsMediaW(
  1281. HANDLE hSession,
  1282. LPNTMS_OBJECTINFORMATIONW lpMedia,
  1283. LPNTMS_OBJECTINFORMATIONW lpList,
  1284. DWORD dwOptions
  1285. ) ;
  1286. enum NtmsEnumerateOption {
  1287. NTMS_ENUM_DEFAULT = 0,
  1288. NTMS_ENUM_ROOTPOOL = 1
  1289. };
  1290. DWORD WINAPI EnumerateNtmsObject(
  1291. HANDLE hSession,
  1292. const LPNTMS_GUID lpContainerId,
  1293. LPNTMS_GUID lpList,
  1294. LPDWORD lpdwListSize,
  1295. DWORD dwType,
  1296. DWORD dwOptions
  1297. );
  1298. DWORD WINAPI DisableNtmsObject(
  1299. HANDLE hSession,
  1300. DWORD dwType,
  1301. LPNTMS_GUID lpObjectId
  1302. );
  1303. DWORD WINAPI EnableNtmsObject(
  1304. HANDLE hSession,
  1305. DWORD dwType,
  1306. LPNTMS_GUID lpObjectId
  1307. );
  1308. enum NtmsEjectOperation {
  1309. NTMS_EJECT_START = 0,
  1310. NTMS_EJECT_STOP = 1,
  1311. NTMS_EJECT_QUEUE = 2,
  1312. NTMS_EJECT_FORCE = 3,
  1313. NTMS_EJECT_IMMEDIATE = 4,
  1314. NTMS_EJECT_ASK_USER = 5
  1315. };
  1316. DWORD WINAPI EjectNtmsMedia(
  1317. HANDLE hSession,
  1318. LPNTMS_GUID lpMediaId,
  1319. LPNTMS_GUID lpEjectOperation,
  1320. DWORD dwAction
  1321. );
  1322. enum NtmsInjectOperation {
  1323. NTMS_INJECT_START = 0,
  1324. NTMS_INJECT_STOP = 1,
  1325. NTMS_INJECT_RETRACT = 2,
  1326. NTMS_INJECT_STARTMANY = 3
  1327. };
  1328. DWORD WINAPI InjectNtmsMedia(
  1329. HANDLE hSession,
  1330. LPNTMS_GUID lpLibraryId,
  1331. LPNTMS_GUID lpInjectOperation,
  1332. DWORD dwAction
  1333. );
  1334. DWORD WINAPI AccessNtmsLibraryDoor(
  1335. HANDLE hSession,
  1336. LPNTMS_GUID lpLibraryId,
  1337. DWORD dwAction
  1338. );
  1339. DWORD WINAPI CleanNtmsDrive(
  1340. HANDLE hSession,
  1341. LPNTMS_GUID lpDriveId
  1342. );
  1343. DWORD WINAPI DismountNtmsDrive(
  1344. HANDLE hSession,
  1345. LPNTMS_GUID lpDriveId
  1346. );
  1347. DWORD WINAPI InventoryNtmsLibrary(
  1348. HANDLE hSession,
  1349. LPNTMS_GUID lpLibraryId,
  1350. DWORD dwAction
  1351. );
  1352. DWORD WINAPI IdentifyNtmsSlot(
  1353. HANDLE hSession,
  1354. LPNTMS_GUID lpSlotId,
  1355. DWORD dwOption
  1356. );
  1357. // definitions for the UpdateNtmsOmidInfo ...
  1358. #define NTMS_OMID_TYPE_RAW_LABEL 0x01
  1359. #define NTMS_OMID_TYPE_FILESYSTEM_INFO 0x02
  1360. typedef struct
  1361. {
  1362. WCHAR FileSystemType[64] ;
  1363. WCHAR VolumeName[256] ;
  1364. DWORD SerialNumber ;
  1365. } NTMS_FILESYSTEM_INFO ;
  1366. DWORD WINAPI UpdateNtmsOmidInfo(
  1367. HANDLE hSession,
  1368. LPNTMS_GUID lpMediaId,
  1369. DWORD labelType,
  1370. DWORD numberOfBytes,
  1371. LPVOID lpBuffer
  1372. );
  1373. DWORD WINAPI CancelNtmsLibraryRequest(
  1374. HANDLE hSession,
  1375. LPNTMS_GUID lpRequestId
  1376. );
  1377. DWORD WINAPI GetNtmsRequestOrder(
  1378. HANDLE hSession,
  1379. LPNTMS_GUID lpRequestId,
  1380. LPDWORD lpdwOrderNumber
  1381. );
  1382. DWORD WINAPI SetNtmsRequestOrder(
  1383. HANDLE hSession,
  1384. LPNTMS_GUID lpRequestId,
  1385. DWORD dwOrderNumber
  1386. );
  1387. DWORD WINAPI DeleteNtmsRequests(
  1388. HANDLE hSession,
  1389. LPNTMS_GUID lpRequestId,
  1390. DWORD dwType,
  1391. DWORD dwCount
  1392. );
  1393. DWORD WINAPI ReserveNtmsCleanerSlot (
  1394. HANDLE hSession,
  1395. LPNTMS_GUID lpLibrary,
  1396. LPNTMS_GUID lpSlot
  1397. );
  1398. DWORD WINAPI ReleaseNtmsCleanerSlot (
  1399. HANDLE hSession,
  1400. LPNTMS_GUID lpLibrary
  1401. );
  1402. DWORD WINAPI InjectNtmsCleaner (
  1403. HANDLE hSession,
  1404. LPNTMS_GUID lpLibrary,
  1405. LPNTMS_GUID lpInjectOperation,
  1406. DWORD dwNumberOfCleansLeft,
  1407. DWORD dwAction
  1408. );
  1409. DWORD WINAPI EjectNtmsCleaner (
  1410. HANDLE hSession,
  1411. LPNTMS_GUID lpLibrary,
  1412. LPNTMS_GUID lpEjectOperation,
  1413. DWORD dwAction
  1414. );
  1415. DWORD WINAPI BeginNtmsDeviceChangeDetection(
  1416. HANDLE hSession,
  1417. LPHANDLE lpDetectHandle
  1418. );
  1419. DWORD WINAPI SetNtmsDeviceChangeDetection(
  1420. HANDLE hSession,
  1421. HANDLE DetectHandle,
  1422. LPNTMS_GUID lpRequestId,
  1423. DWORD dwType,
  1424. DWORD dwCount
  1425. );
  1426. DWORD WINAPI EndNtmsDeviceChangeDetection(
  1427. HANDLE hSession,
  1428. HANDLE DetectHandle
  1429. );
  1430. #endif // MIDL_PASS
  1431. #ifndef NTMS_NOREDEF
  1432. enum NtmsDriveType {
  1433. NTMS_UNKNOWN_DRIVE = 0
  1434. };
  1435. #endif // NTMS_NOREDEF
  1436. #ifndef MIDL_PASS
  1437. // Security for NTMS API
  1438. DWORD WINAPI GetNtmsObjectSecurity(
  1439. HANDLE hSession,
  1440. LPNTMS_GUID lpObjectId,
  1441. DWORD dwType,
  1442. SECURITY_INFORMATION RequestedInformation,
  1443. PSECURITY_DESCRIPTOR lpSecurityDescriptor,
  1444. DWORD nLength,
  1445. LPDWORD lpnLengthNeeded
  1446. );
  1447. DWORD WINAPI SetNtmsObjectSecurity(
  1448. HANDLE hSession,
  1449. LPNTMS_GUID lpObjectId,
  1450. DWORD dwType,
  1451. SECURITY_INFORMATION SecurityInformation,
  1452. PSECURITY_DESCRIPTOR lpSecurityDescriptor
  1453. );
  1454. // Security Access Control Masks :
  1455. // NTMS_USE_ACCESS is required to use an NTMS object. For example,
  1456. // you will need this access to a library in order to mount media
  1457. // within it.
  1458. // NTMS_MODIFY_ACCESS is required to make changes to an NTMS object.
  1459. // For example, you will need modify access in order to change the name
  1460. // of an object or change its attributes.
  1461. // NTMS_CONTROL_ACCESS is required to control an NTMS object. For
  1462. // example, you will need control access to a library in order to
  1463. // inject media, eject media, clean or open the door.
  1464. //
  1465. enum NtmsAccessMask {
  1466. NTMS_USE_ACCESS = 0x1,
  1467. NTMS_MODIFY_ACCESS = 0x2,
  1468. NTMS_CONTROL_ACCESS = 0x4
  1469. };
  1470. // Generic Mappings :
  1471. #define NTMS_GENERIC_READ NTMS_USE_ACCESS
  1472. #define NTMS_GENERIC_WRITE NTMS_USE_ACCESS | NTMS_MODIFY_ACCESS
  1473. #define NTMS_GENERIC_EXECUTE NTMS_USE_ACCESS | NTMS_MODIFY_ACCESS | NTMS_CONTROL_ACCESS
  1474. #define NTMS_GENERIC_ALL NTMS_USE_ACCESS | NTMS_MODIFY_ACCESS | NTMS_CONTROL_ACCESS
  1475. // Maximum attribute size for NTMS Object attribute API's
  1476. #define NTMS_MAXATTR_LENGTH 0x10000
  1477. // Maximum len of attribute name (# of chars.)
  1478. #define NTMS_MAXATTR_NAMELEN 32
  1479. // Object extensions for NTMS API
  1480. DWORD WINAPI GetNtmsObjectAttributeA(
  1481. HANDLE hSession,
  1482. LPNTMS_GUID lpObjectId,
  1483. DWORD dwType,
  1484. LPCSTR lpAttributeName,
  1485. LPVOID lpAttributeData,
  1486. LPDWORD lpAttributeSize
  1487. );
  1488. DWORD WINAPI GetNtmsObjectAttributeW(
  1489. HANDLE hSession,
  1490. LPNTMS_GUID lpObjectId,
  1491. DWORD dwType,
  1492. LPCWSTR lpAttributeName,
  1493. LPVOID lpAttributeData,
  1494. LPDWORD lpAttributeSize
  1495. );
  1496. DWORD WINAPI SetNtmsObjectAttributeA(
  1497. HANDLE hSession,
  1498. LPNTMS_GUID lpObjectId,
  1499. DWORD dwType,
  1500. LPCSTR lpAttributeName,
  1501. LPVOID lpAttributeData,
  1502. DWORD dwAttributeSize
  1503. );
  1504. DWORD WINAPI SetNtmsObjectAttributeW(
  1505. HANDLE hSession,
  1506. LPNTMS_GUID lpObjectId,
  1507. DWORD dwType,
  1508. LPCWSTR lpAttributeName,
  1509. LPVOID lpAttributeData,
  1510. DWORD AttributeSize
  1511. );
  1512. //UI Notification
  1513. enum NtmsUITypes {
  1514. NTMS_UITYPE_INVALID = 0,
  1515. NTMS_UITYPE_INFO,
  1516. NTMS_UITYPE_REQ,
  1517. NTMS_UITYPE_ERR,
  1518. NTMS_UITYPE_MAX
  1519. };
  1520. enum NtmsUIOperations {
  1521. NTMS_UIDEST_ADD = 1,
  1522. NTMS_UIDEST_DELETE,
  1523. NTMS_UIDEST_DELETEALL,
  1524. NTMS_UIOPERATION_MAX
  1525. };
  1526. DWORD WINAPI GetNtmsUIOptionsA(
  1527. HANDLE hSession,
  1528. const LPNTMS_GUID lpObjectId,
  1529. DWORD dwType,
  1530. LPSTR lpszDestination,
  1531. LPDWORD lpAttributeSize
  1532. );
  1533. DWORD WINAPI GetNtmsUIOptionsW(
  1534. HANDLE hSession,
  1535. const LPNTMS_GUID lpObjectId,
  1536. DWORD dwType,
  1537. LPWSTR lpszDestination,
  1538. LPDWORD lpdwSize
  1539. );
  1540. DWORD WINAPI SetNtmsUIOptionsA(
  1541. HANDLE hSession,
  1542. const LPNTMS_GUID lpObjectId,
  1543. DWORD dwType,
  1544. DWORD dwOperation,
  1545. LPCSTR lpszDestination
  1546. );
  1547. DWORD WINAPI SetNtmsUIOptionsW(
  1548. HANDLE hSession,
  1549. const LPNTMS_GUID lpObjectId,
  1550. DWORD dwType,
  1551. DWORD dwOperation,
  1552. LPCWSTR lpszDestination
  1553. );
  1554. // Operator Requests
  1555. DWORD WINAPI SubmitNtmsOperatorRequestW(
  1556. HANDLE hSession,
  1557. DWORD dwRequest,
  1558. LPCWSTR lpMessage,
  1559. LPNTMS_GUID lpArg1Id,
  1560. LPNTMS_GUID lpArg2Id,
  1561. LPNTMS_GUID lpRequestId
  1562. );
  1563. DWORD WINAPI SubmitNtmsOperatorRequestA(
  1564. HANDLE hSession,
  1565. DWORD dwRequest,
  1566. LPCSTR lpMessage,
  1567. LPNTMS_GUID lpArg1Id,
  1568. LPNTMS_GUID lpArg2Id,
  1569. LPNTMS_GUID lpRequestId
  1570. );
  1571. DWORD WINAPI WaitForNtmsOperatorRequest(
  1572. HANDLE hSession,
  1573. LPNTMS_GUID lpRequestId,
  1574. DWORD dwTimeout
  1575. );
  1576. DWORD WINAPI CancelNtmsOperatorRequest(
  1577. HANDLE hSession,
  1578. LPNTMS_GUID lpRequestId
  1579. );
  1580. DWORD WINAPI SatisfyNtmsOperatorRequest(
  1581. HANDLE hSession,
  1582. LPNTMS_GUID lpRequestId
  1583. );
  1584. #endif // MIDL_PASS
  1585. #ifndef NTMS_NOREDEF
  1586. enum NtmsNotificationOperations {
  1587. NTMS_OBJ_UPDATE = 1,
  1588. NTMS_OBJ_INSERT = 2,
  1589. NTMS_OBJ_DELETE = 3,
  1590. NTMS_EVENT_SIGNAL = 4,
  1591. NTMS_EVENT_COMPLETE = 5
  1592. };
  1593. // object notification
  1594. typedef struct _NTMS_NOTIFICATIONINFORMATION {
  1595. DWORD dwOperation;
  1596. NTMS_GUID ObjectId;
  1597. } NTMS_NOTIFICATIONINFORMATION, *LPNTMS_NOTIFICATIONINFORMATION;
  1598. #endif // NTMS_NOREDEF
  1599. #ifndef MIDL_PASS
  1600. DWORD WINAPI ImportNtmsDatabase(
  1601. HANDLE hSession
  1602. );
  1603. DWORD WINAPI ExportNtmsDatabase(
  1604. HANDLE hSession
  1605. );
  1606. #endif // MIDL_PASS
  1607. #ifndef MIDL_PASS
  1608. DWORD WINAPI ImportNtmsDatabase(
  1609. HANDLE hSession
  1610. );
  1611. DWORD WINAPI ExportNtmsDatabase(
  1612. HANDLE hSession
  1613. );
  1614. #endif // MIDL_PASS
  1615. #ifndef MIDL_PASS
  1616. HANDLE WINAPI OpenNtmsNotification(
  1617. HANDLE hSession,
  1618. DWORD dwType
  1619. );
  1620. DWORD WINAPI WaitForNtmsNotification(
  1621. HANDLE hNotification,
  1622. LPNTMS_NOTIFICATIONINFORMATION lpNotificationInformation,
  1623. DWORD dwTimeout
  1624. );
  1625. DWORD WINAPI CloseNtmsNotification(
  1626. HANDLE hNotification
  1627. );
  1628. #endif // MIDL_PASS
  1629. #ifndef MIDL_PASS
  1630. DWORD WINAPI EjectDiskFromSADriveW(
  1631. LPCWSTR lpComputerName,
  1632. LPCWSTR lpAppName,
  1633. LPCWSTR lpDeviceName,
  1634. HWND hWnd,
  1635. LPCWSTR lpTitle,
  1636. LPCWSTR lpMessage,
  1637. DWORD dwOptions
  1638. );
  1639. DWORD WINAPI EjectDiskFromSADriveA(
  1640. LPCSTR lpComputerName,
  1641. LPCSTR lpAppName,
  1642. LPCSTR lpDeviceName,
  1643. HWND hWnd,
  1644. LPCSTR lpTitle,
  1645. LPCSTR lpMessage,
  1646. DWORD dwOptions
  1647. );
  1648. #endif
  1649. #ifndef MIDL_PASS
  1650. DWORD WINAPI GetVolumesFromDriveW(
  1651. LPWSTR pszDriveName,
  1652. LPWSTR *VolumeNameBufferPtr,
  1653. LPWSTR *DriveLetterBufferPtr
  1654. );
  1655. DWORD WINAPI GetVolumesFromDriveA(
  1656. LPSTR pszDriveName,
  1657. LPSTR* VolumeNameBufferPtr,
  1658. LPSTR* DriveLetterBufferPtr
  1659. );
  1660. #endif
  1661. #ifdef __cplusplus
  1662. } // end extern "C"
  1663. #endif
  1664. #pragma pack()
  1665. #endif // _INCL_NTMSAPI_H_