home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / mddefw.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  26KB  |  409 lines

  1. /* this ALWAYS GENERATED file contains the definitions for the interfaces */
  2.  
  3.  
  4. /* File created by MIDL compiler version 3.03.0110 */
  5. /* at Mon Nov 03 15:42:31 1997
  6.  */
  7. /* Compiler settings for .\mddefw.idl:
  8.     Oi (OptLev=i0), W1, Zp8, env=Win32, ms_ext, c_ext
  9.     error checks: allocation ref 
  10. */
  11. //@@MIDL_FILE_HEADING(  )
  12.  
  13.  
  14. /* verify that the <rpcndr.h> version is high enough to compile this file*/
  15. #ifndef __REQUIRED_RPCNDR_H_VERSION__
  16. #define __REQUIRED_RPCNDR_H_VERSION__ 440
  17. #endif
  18.  
  19. #include "rpc.h"
  20. #include "rpcndr.h"
  21.  
  22. #ifndef __mddefw_h__
  23. #define __mddefw_h__
  24.  
  25. #ifdef __cplusplus
  26. extern "C"{
  27. #endif 
  28.  
  29. /* Forward Declarations */ 
  30.  
  31. /* header files for imported files */
  32. #include "unknwn.h"
  33.  
  34. void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
  35. void __RPC_USER MIDL_user_free( void __RPC_FAR * ); 
  36.  
  37. /****************************************
  38.  * Generated header for interface: __MIDL_itf_mddefw_0000
  39.  * at Mon Nov 03 15:42:31 1997
  40.  * using MIDL 3.03.0110
  41.  ****************************************/
  42. /* [local] */ 
  43.  
  44.  
  45. /*++
  46.                                                                                 
  47. Copyright (c) 1997 Microsoft Corporation
  48.                                                                                 
  49. Module Name: mddef.h
  50.                                                                                 
  51.     Definitions for Admin Objects and Metadata
  52.                                                                                 
  53. --*/
  54. #ifndef _MD_DEFW_
  55. #define _MD_DEFW_
  56. #include <mdmsg.h>
  57. #include <mdcommsg.h>
  58. /*                                                                              
  59.     Error Codes                                                                 
  60.                                                                                 
  61.         Metadata api's all return HRESULTS. Since internal results are either   
  62.         winerrors or Metadata specific return codes (see mdmsg.h), they are     
  63.         converted to HRESULTS using the RETURNCODETOHRESULT macro (see          
  64.         commsg.h).                                                              
  65. */                                                                              
  66.                                                                                 
  67. /*                                                                              
  68.     Max Name Length                                                             
  69.         The maximum number of characters in the length of a metaobject name,    
  70.         including the terminating NULL. This refers to each node in the tree,   
  71.         not the entire path.                                                    
  72.         eg. strlen("Root") < METADATA_MAX_NAME_LEN                            
  73. */                                                                              
  74. #define METADATA_MAX_NAME_LEN           256
  75. /*                                                                              
  76.    Access Permissons                                                            
  77.        Permissions associated with handles of type METADATA_HANDLE              
  78.                                                                                 
  79.        METADATA_PERMISSION_READ - Allows reading metadata.                      
  80.        METADATA_PERMISSION_WRITE - Allows writing metadata.                     
  81. */                                                                              
  82. #define METADATA_PERMISSION_READ        0x00000001
  83. #define METADATA_PERMISSION_WRITE       0x00000002
  84. /*                                                                              
  85.     Data Types                                                                  
  86.                                                                                 
  87.         ALL_METADATA - Used on Get/Enum/Getall api's (ComMDGetMetaData,         
  88.             ComMDEnumMetaData, and ComMDGetAllMetaData), api's to allow getting 
  89.             all data. Not valid on the Set api.                                 
  90.                                                                                 
  91.         DWORD_METADATA - The data is an unsigned 32 bit value.                  
  92.                                                                                 
  93.         STRING_METADATA - The data is a null terminated ASCII string.           
  94.                                                                                 
  95.         BINARY_METADATA - The data is any binary value.                         
  96.                                                                                 
  97.         EXPANDSZ_METADATA - The data is a null terminated ASCII string.         
  98.             Clients are expected to treat this as an expandsz string.           
  99.                                                                                 
  100.         MULTISZ_METADATA - A series of NULL terminated ASCII strings. ending    
  101.             with 2 NULL's.                                                      
  102. */                                                                              
  103.  
  104. enum METADATATYPES
  105.     {    ALL_METADATA    = 0,
  106.     DWORD_METADATA    = ALL_METADATA + 1,
  107.     STRING_METADATA    = DWORD_METADATA + 1,
  108.     BINARY_METADATA    = STRING_METADATA + 1,
  109.     EXPANDSZ_METADATA    = BINARY_METADATA + 1,
  110.     MULTISZ_METADATA    = EXPANDSZ_METADATA + 1,
  111.     INVALID_END_METADATA    = MULTISZ_METADATA + 1
  112.     };
  113. /*                                                                              
  114.     Attributes - The flags for the data.                                        
  115.                                                                                 
  116.         METADATA_INHERIT - If set for a data item, the data item can be         
  117.             inherited. If set on input to the Get/Enum/Getall api's,            
  118.             (ComMDGetMetaData, ComMDEnumMetaData, and ComMDGetAllMetaData),     
  119.             inheritable data will be returned. If not set on input to the       
  120.             Get/Enum/Getall, inheritable data will not be returned.             
  121.                                                                                 
  122.         METADATA_PARTIAL_PATH - If set on input to Get/Enum/Getall api's, this  
  123.             routine will return ERROR_SUCCESS and the inherited data even if    
  124.             the entire path is not present. Only valid if METADATA_INHERIT is   
  125.             also set. Should not be set for data items on input the the Set api 
  126.             (ComMDSetMetaData).                                                 
  127.                                                                                 
  128.         METADATA_SECURE - If set for a data item, the data is stored in a       
  129.             secure fasion. Should not be set on input to Get/Enum api's.        
  130.                                                                                 
  131.         METADATA_REFERENCE - If set for a data item, the data item may be       
  132.             gotten by reference. If set on input to Get/Enum/GetAll api's and   
  133.             set on a the data item being returned, the data is returned by      
  134.             reference. A pointer to the metadata server's copy of the data is   
  135.             placed in the Data field of the METADATA_RECORD or                  
  136.             METADATA_GETALL_RECORD, and the DataTag field is set. This data must
  137.             be freed by calling ComMDReleaseReferenceData. The client must not  
  138.             change this data. This flag must not be set on input to             
  139.             Get/Enum/Getall api's from remote clients.                          
  140.                                                                                 
  141.         METADATA_VOLATILE - If set for a data item, the data item will not be   
  142.             saved to long term storage.                                         
  143.                                                                                 
  144.         METADATA_ISINHERITED - If specified on input to one of the get api's,   
  145.         the flag will be set on return if the data was inherited.               
  146.                                                                                 
  147.         METADATA_INSERT_PATH - If specified on input to one of the get api's,   
  148.         and on a string data item, the path relative to handle will replaced the
  149.         string MD_INSERT_PATH_STRING in the string data.                        
  150.                                                                                 
  151. */                                                                              
  152.                                                                                 
  153. #define METADATA_NO_ATTRIBUTES          0                                       
  154. #define METADATA_INHERIT                0x00000001                              
  155. #define METADATA_PARTIAL_PATH           0x00000002                              
  156. #define METADATA_SECURE                 0x00000004                              
  157. #define METADATA_REFERENCE              0x00000008                              
  158. #define METADATA_VOLATILE               0x00000010                              
  159. #define METADATA_ISINHERITED            0x00000020                              
  160. #define METADATA_INSERT_PATH            0x00000040                              
  161.                                                                                 
  162. /*                                                                              
  163.     Backup Flags.                                                               
  164.                                                                                 
  165.         MD_BACKUP_OVERWRITE - If set, the metabase will be backed up even if    
  166.             a backupe with the same name and version already exists. The        
  167.             existing backup will be overwritten.                                
  168.                                                                                 
  169.         MD_BACKUP_SAVE_FIRST - If set backup will save the metabase prior to    
  170.             making the backup. If the save fails, backup behavior is dependent  
  171.             on the value of MD_BACKUP_FORCE_BACKUP.                             
  172.                                                                                 
  173.         MD_BACKUP_FORCE_BACKUP - If set backup will proceed even if the save    
  174.             failed. Only valid if MD_BACKUP_SAVE_FIRST is set. If the save      
  175.             but the backup succeeds, a warning will be returned.                
  176. */                                                                              
  177.                                                                                 
  178. #define MD_BACKUP_OVERWRITE             0x00000001                              
  179. #define MD_BACKUP_SAVE_FIRST            0x00000002                              
  180. #define MD_BACKUP_FORCE_BACKUP          0x00000004                              
  181. /*                                                                              
  182.     Backup Version Defines.                                                     
  183.                                                                                 
  184.         MD_BACKUP_NEXT_VERSION - For Backup, indicates use the next available   
  185.             backup version of the BackupLocation specified, ie. one higher than 
  186.             the highest existing version.                                       
  187.             Not valid for Restore or DeleteBackup.                              
  188.                                                                                 
  189.         MD_BACKUP_HIGHEST_VERSION - For Backup, Restore, and DeleteBackup, will 
  190.             use the highest existing backup version of the BackupLocation       
  191.             specified.                                                          
  192.                                                                                 
  193.         MD_BACKUP_MAX_VERSION - The highest allowed backup version number.      
  194.                                                                                 
  195.         MD_BACKUP_MAX_LEN - The maximup length, in UNICODE characters, of the   
  196.             BackupLocation.                                                     
  197. */                                                                              
  198.                                                                                 
  199. #define MD_BACKUP_NEXT_VERSION          0xffffffff                              
  200. #define MD_BACKUP_HIGHEST_VERSION       0xfffffffe                              
  201. #define MD_BACKUP_MAX_VERSION           9999                                    
  202. #define MD_BACKUP_MAX_LEN               (100)                                   
  203.                                                                                 
  204. /*                                                                              
  205.     Backup Location Defines.                                                    
  206.                                                                                 
  207.         MD_DEFAULT_BACKUP_LOCATION - The default location to backup from or     
  208.             restore to if no location is specified.                             
  209. */                                                                              
  210.                                                                                 
  211. #define MD_DEFAULT_BACKUP_LOCATION TEXT("MDBackUp")                           
  212.                                                                                 
  213. /*                                                                              
  214.     Insert Path Defines.                                                        
  215. */                                                                              
  216.                                                                                 
  217.                                                                                 
  218. #define MD_INSERT_PATH_STRINGA      "<%INSERT_PATH%>"                         
  219. #define MD_INSERT_PATH_STRINGW      L##"<%INSERT_PATH%>"                      
  220. #define MD_INSERT_PATH_STRING       TEXT("<%INSERT_PATH%>")                   
  221.                                                                                 
  222. /*                                                                              
  223.     Handle Defines.                                                             
  224. */                                                                              
  225.                                                                                 
  226. #define METADATA_MASTER_ROOT_HANDLE     0
  227.                                                                                 
  228. /*                                                                              
  229.     METADATA_RECORD is the basic input/output parameter for the set and get     
  230.         metadata api's. The Set api (ComMDSetMetaData) takes all fields as      
  231.         input, except DataTag. The Get/Enum api's (ComMDGetMetadata and         
  232.         ComMDEnumMetaData) take some of the fields as input, and fill in all    
  233.         fields as output.                                                       
  234.                                                                                 
  235.     Identifier - The identifier of the data.                                    
  236.                                                                                 
  237.     Attributes - The flags for the data.                                        
  238.                                                                                 
  239.     UserType - The User Type for the data. This is a user defined field to allow
  240.         users to group data. If set to anything other than ALL_METADATA on input
  241.         to Get/Set apis, only metadata of the specified User Type will be       
  242.         returned.                                                               
  243.                                                                                 
  244.         ALL_METADATA                                                            
  245.                                                                                 
  246.         User Defined Values                                                     
  247.                                                                                 
  248.     DataType - The Type of the data. Must be set to a valid value other than    
  249.         ALL_METADATA for each data item. If set to anything other than          
  250.         ALL_METADATA on input to Get/Set api's, only metadata of the            
  251.         specified Data Type will be returned.                                   
  252.              ALL_METADATA                                                       
  253.              DWORD_METADATA                                                     
  254.              STRING_METADATA                                                    
  255.              BINARY_METADATA                                                    
  256.              EXPANDSZ_METADATA                                                  
  257.                                                                                 
  258.     DataLen - On input to the Set api, specifies the length of Data, in         
  259.         bytes. Inprocess clients only need to specify this for binary data.     
  260.         Remote clients need to specify this for all data types. For strings,    
  261.         this must include the trailing '\0', eg. strlen(string) + 1.            
  262.         On input to Get/Enum apis, specifies the size of the buffer pointed to  
  263.         by Data. On successful output from Get/Enum API's, specifies the size of
  264.         Data in bytes.                                                          
  265.                                                                                 
  266.     Data - On input to the Set api, points to the data. On input to the         
  267.         Get/Enum api's, points to a buffer to return the data in. On output     
  268.         from the Get/Enum api's, points to the data. If the data is not         
  269.         gotten by reference, the  pointer will be unchanged.                    
  270.                                                                                 
  271.     DataTag - A tag for reference data. Not used in the Set api. Not used on    
  272.         input to the Get/Enum api's. On successful return from the Get/Enum     
  273.         api's, this is set to a nonzero tag if the data was gotten by reference,
  274.         and set to 0 if the data was not gotten by reference.                   
  275. */                                                                              
  276. typedef struct  _METADATA_RECORD
  277.     {
  278.     DWORD dwMDIdentifier;
  279.     DWORD dwMDAttributes;
  280.     DWORD dwMDUserType;
  281.     DWORD dwMDDataType;
  282.     DWORD dwMDDataLen;
  283.     /* [size_is][unique] */ unsigned char __RPC_FAR *pbMDData;
  284.     DWORD dwMDDataTag;
  285.     }    METADATA_RECORD;
  286.  
  287. typedef struct _METADATA_RECORD __RPC_FAR *PMETADATA_RECORD;
  288.  
  289. /*                                                                              
  290.     METADATA_GETALL_RECORD, is essentially the same as METADATA_RECORD, but is  
  291.         used by MDGetAllMetaData. It is used the same as the corresponding      
  292.         METADATA_RECORD values for the MDGetMetaData, with the following        
  293.         exceptions:                                                             
  294.                                                                                 
  295.     MDGetAllMetadata does not take the structure as input, but takes parameters 
  296.         equivalent to Attributes, UserType, and DataType.                       
  297.                                                                                 
  298.     On output, MDGetAllMetadata returns an array of METADATA_GETALL_RECORD.     
  299.                                                                                 
  300.     DataOffset/Data - If the data is not returned by reference, DataOffset      
  301.         contains the byte offset into the buffer provided. If the data is       
  302.         returned by reference, Data contains a pointer to the data.             
  303. */                                                                              
  304. typedef struct  _METADATA_GETALL_RECORD
  305.     {
  306.     DWORD dwMDIdentifier;
  307.     DWORD dwMDAttributes;
  308.     DWORD dwMDUserType;
  309.     DWORD dwMDDataType;
  310.     DWORD dwMDDataLen;
  311.     union 
  312.         {
  313.         DWORD dwMDDataOffset;
  314.         unsigned char __RPC_FAR *pbMDData;
  315.         }    ;
  316.     DWORD dwMDDataTag;
  317.     }    METADATA_GETALL_RECORD;
  318.  
  319. typedef struct _METADATA_GETALL_RECORD __RPC_FAR *PMETADATA_GETALL_RECORD;
  320.  
  321. typedef DWORD METADATA_HANDLE;
  322.  
  323. typedef DWORD __RPC_FAR *PMETADATA_HANDLE;
  324.  
  325. /*                                                                              
  326. Handle Information                                                              
  327.                                                                                 
  328.     Permissions - The permissions associated with the handle.                   
  329.         METADATA_PERMISSION_READ                                                
  330.         METADATA_PERMISSION_WRITE                                               
  331.                                                                                 
  332.     SystemChangeNumber - The system change number at the time the handle was    
  333.         allocated.                                                              
  334. */                                                                              
  335. typedef struct  _METADATA_HANDLE_INFO
  336.     {
  337.     DWORD dwMDPermissions;
  338.     DWORD dwMDSystemChangeNumber;
  339.     }    METADATA_HANDLE_INFO;
  340.  
  341. typedef struct _METADATA_HANDLE_INFO __RPC_FAR *PMETADATA_HANDLE_INFO;
  342.  
  343. /*                                                                              
  344.     Change Object - The structure passed to ComMDSinkNotify.                    
  345.                                                                                 
  346.         Path - The path of the MetaObject modified.                             
  347.                                                                                 
  348.         ChangeType - The types of changes made, from the flags below.           
  349.                                                                                 
  350.         NumDataIDs - The number of data id's changed.                           
  351.                                                                                 
  352.         DataIDs - An array of the data id's changed.                            
  353. */                                                                              
  354.                                                                                 
  355. #define MD_CHANGE_OBJECT     MD_CHANGE_OBJECT_W                                 
  356. #define PMD_CHANGE_OBJECT    PMD_CHANGE_OBJECT_W                                
  357. typedef struct  _MD_CHANGE_OBJECT_W
  358.     {
  359.     /* [string] */ LPWSTR pszMDPath;
  360.     DWORD dwMDChangeType;
  361.     DWORD dwMDNumDataIDs;
  362.     /* [size_is][unique] */ DWORD __RPC_FAR *pdwMDDataIDs;
  363.     }    MD_CHANGE_OBJECT_W;
  364.  
  365. typedef struct _MD_CHANGE_OBJECT_W __RPC_FAR *PMD_CHANGE_OBJECT_W;
  366.  
  367. /*                                                                              
  368.                                                                                 
  369. Change Types                                                                    
  370.                                                                                 
  371.     MD_CHANGE_TYPE_DELETE_OBJECT - The Meta Object was deleted.                 
  372.                                                                                 
  373.     MD_CHANGE_TYPE_ADD_OBJECT - The Meta Object was added.                      
  374.                                                                                 
  375.     MD_CHANGE_TYPE_SET_DATA - A data item was set.                              
  376.                                                                                 
  377.     MD_CHANGE_TYPE_DELETE_DATA - A data item was deleted.                       
  378.                                                                                 
  379.     MD_CHANGE_TYPE_RENAME_OBJECT - The Meta Object was renamed.                 
  380.                                                                                 
  381. */                                                                              
  382. #define MD_CHANGE_TYPE_DELETE_OBJECT   0x00000001
  383. #define MD_CHANGE_TYPE_ADD_OBJECT      0x00000002
  384. #define MD_CHANGE_TYPE_SET_DATA        0x00000004
  385. #define MD_CHANGE_TYPE_DELETE_DATA     0x00000008
  386. #define MD_CHANGE_TYPE_RENAME_OBJECT   0x00000010
  387. /*                                                                              
  388.                                                                                 
  389. Max Change Entries - The maximum number of change entries that will be sent on  
  390.     a single call to IMDCOMSINK::ComMDSinkNotify. If more notifications are     
  391.     required, IMDCOMSINK::ComMDSinkNotify will be called multiple times.        
  392. */                                                                              
  393. #define MD_MAX_CHANGE_ENTRIES          100
  394. #endif
  395.  
  396.  
  397. extern RPC_IF_HANDLE __MIDL_itf_mddefw_0000_v0_0_c_ifspec;
  398. extern RPC_IF_HANDLE __MIDL_itf_mddefw_0000_v0_0_s_ifspec;
  399.  
  400. /* Additional Prototypes for ALL interfaces */
  401.  
  402. /* end of Additional Prototypes */
  403.  
  404. #ifdef __cplusplus
  405. }
  406. #endif
  407.  
  408. #endif
  409.