6 Appendix A: Full IDL

 import "ms-dtyp.idl";
  
 [
     uuid( 338CD001-2244-31F1-AAAA-900038001003 ),
     pointer_default( unique ),
     version( 1.0 )
 ]
 interface winreg
 {
     typedef RPC_UNICODE_STRING RRP_UNICODE_STRING, *PRRP_UNICODE_STRING;
     typedef [context_handle] HANDLE    RPC_HKEY;
     typedef                  RPC_HKEY  *PRPC_HKEY;
  
     typedef [handle] PWCHAR PREGISTRY_SERVER_NAME;
     typedef DWORD           SECURITY_INFORMATION, 
                            *PSECURITY_INFORMATION;
  
     typedef struct value_ent {  
         PRPC_UNICODE_STRING   ve_valuename;  
         DWORD             ve_valuelen;  
         LPDWORD           ve_valueptr;  
         DWORD             ve_type;
     } RVALENT,  *PRVALENT;
  
     typedef ULONG REGSAM;
  
     typedef struct _RPC_SECURITY_DESCRIPTOR {
         [ size_is( cbInSecurityDescriptor ),
         length_is( cbOutSecurityDescriptor ) ] 
             PBYTE lpSecurityDescriptor;
         DWORD cbInSecurityDescriptor;
         DWORD cbOutSecurityDescriptor;
     } RPC_SECURITY_DESCRIPTOR, *PRPC_SECURITY_DESCRIPTOR;
  
     typedef struct _RPC_SECURITY_ATTRIBUTES {
         DWORD nLength;
         RPC_SECURITY_DESCRIPTOR RpcSecurityDescriptor;
         BOOLEAN bInheritHandle;
     } RPC_SECURITY_ATTRIBUTES, *PRPC_SECURITY_ATTRIBUTES;
  
     // method declarations
  
     error_status_t
     OpenClassesRoot(
         [ in, unique ] PREGISTRY_SERVER_NAME ServerName,
         [ in ] REGSAM  samDesired,
         [ out ] PRPC_HKEY phKey
         );
  
     error_status_t
     OpenCurrentUser(
         [ in, unique ] PREGISTRY_SERVER_NAME ServerName,
         [ in ] REGSAM  samDesired,
         [ out ] PRPC_HKEY phKey
         );
  
     error_status_t
     OpenLocalMachine(
         [ in, unique ] PREGISTRY_SERVER_NAME ServerName,
         [ in ] REGSAM  samDesired,
         [ out ] PRPC_HKEY phKey
         );
  
     error_status_t
     OpenPerformanceData(
         [ in, unique ] PREGISTRY_SERVER_NAME ServerName,
         [ in ] REGSAM  samDesired,
         [ out ] PRPC_HKEY phKey
         );
  
     error_status_t
     OpenUsers(
         [ in, unique ] PREGISTRY_SERVER_NAME ServerName,
         [ in ] REGSAM  samDesired,
         [ out ] PRPC_HKEY phKey
         );
  
     error_status_t
     BaseRegCloseKey(
         [ in, out ] PRPC_HKEY hKey
         );
  
     error_status_t
     BaseRegCreateKey(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpSubKey,
         [ in ] PRRP_UNICODE_STRING lpClass,
         [ in ] DWORD dwOptions,
         [ in ] REGSAM  samDesired,
         [ in, unique ] PRPC_SECURITY_ATTRIBUTES lpSecurityAttributes,
         [ out ] PRPC_HKEY phkResult,
         [ in, out, unique ] LPDWORD lpdwDisposition
         );
  
     error_status_t
     BaseRegDeleteKey(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpSubKey
         );
  
     error_status_t
     BaseRegDeleteValue(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpValueName
         );
  
     error_status_t 
     BaseRegEnumKey(
         [in] RPC_HKEY hKey,
         [in] DWORD dwIndex,
         [in] PRRP_UNICODE_STRING lpNameIn,
         [out] PRRP_UNICODE_STRING lpNameOut,
         [in, unique] PRRP_UNICODE_STRING lpClassIn,
         [out] PRPC_UNICODE_STRING *lplpClassOut,
         [in, out, unique] PFILETIME lpftLastWriteTime    
     );
  
     error_status_t
     BaseRegEnumValue (
         [ in ] RPC_HKEY hKey,
         [ in ] DWORD dwIndex,
         [ in ] PRRP_UNICODE_STRING lpValueNameIn,
         [ out ] PRPC_UNICODE_STRING lpValueNameOut,
         [ in, out, unique ] LPDWORD lpType,
         [ in, out, unique, size_is( lpcbData ? *lpcbData : 0 ), 
             length_is ( lpcbLen ? *lpcbLen : 0 ),
             range(0, 0x4000000) ] LPBYTE lpData,
         [ in, out, unique ] LPDWORD lpcbData,
         [ in, out, unique ] LPDWORD lpcbLen
         );
  
     error_status_t
     BaseRegFlushKey(
         [ in ] RPC_HKEY hKey
         );
  
     error_status_t
     BaseRegGetKeySecurity(
         [ in ] RPC_HKEY hKey,
         [ in ] SECURITY_INFORMATION SecurityInformation,
         [ in ]  PRPC_SECURITY_DESCRIPTOR pRpcSecurityDescriptorIn,
         [ out ] PRPC_SECURITY_DESCRIPTOR pRpcSecurityDescriptorOut
         );
  
     error_status_t
     BaseRegLoadKey(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpSubKey,
         [ in ] PRRP_UNICODE_STRING lpFile
         );
  
     void Opnum14NotImplemented();
  
     error_status_t
     BaseRegOpenKey(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpSubKey,
         [ in ] DWORD dwOptions,
         [ in ] REGSAM  samDesired,
         [ out ] PRPC_HKEY phkResult
         );
  
     error_status_t
     BaseRegQueryInfoKey(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpClassIn,
         [ out ] PRPC_UNICODE_STRING lpClassOut,
         [ out ] LPDWORD lpcSubKeys,
         [ out ] LPDWORD lpcbMaxSubKeyLen,
         [ out ] LPDWORD lpcbMaxClassLen,
         [ out ] LPDWORD lpcValues,
         [ out ] LPDWORD lpcbMaxValueNameLen,
         [ out ] LPDWORD lpcbMaxValueLen,
         [ out ] LPDWORD lpcbSecurityDescriptor,
         [ out ] PFILETIME lpftLastWriteTime
         );
  
     error_status_t
     BaseRegQueryValue(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpValueName,
         [ in, out, unique ] LPDWORD lpType,
         [ in, out, unique, size_is( lpcbData ? *lpcbData : 0 ), 
             length_is ( lpcbLen ? *lpcbLen : 0 ),
             range(0, 0x4000000) ] LPBYTE lpData,
         [ in, out, unique ] LPDWORD lpcbData,
         [ in, out, unique ] LPDWORD lpcbLen
         );
  
     error_status_t
     BaseRegReplaceKey(
         [ in ] RPC_HKEY  hKey,
         [ in ] PRRP_UNICODE_STRING lpSubKey,
         [ in ] PRRP_UNICODE_STRING lpNewFile,
         [ in ] PRRP_UNICODE_STRING lpOldFile
         );
  
     error_status_t
     BaseRegRestoreKey(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpFile,
         [ in ] DWORD    Flags
         );
  
     error_status_t
     BaseRegSaveKey(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpFile,
         [ in, unique ] PRPC_SECURITY_ATTRIBUTES pSecurityAttributes
         );
  
     error_status_t
     BaseRegSetKeySecurity(
         [ in ] RPC_HKEY hKey,
         [ in ] SECURITY_INFORMATION SecurityInformation,
         [ in ] PRPC_SECURITY_DESCRIPTOR pRpcSecurityDescriptor
         );
  
     error_status_t
     BaseRegSetValue(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpValueName,
         [ in ] DWORD dwType,
         [ in, size_is( cbData )] LPBYTE lpData,
         [ in ] DWORD cbData
         );
  
     error_status_t
     BaseRegUnLoadKey(
         [ in ] RPC_HKEY  hKey,
         [ in ] PRRP_UNICODE_STRING lpSubKey
         );
  
     void Opnum24NotImplemented();
  
     void Opnum25NotImplemented();
  
     error_status_t
     BaseRegGetVersion(
         [ in ] RPC_HKEY hKey,
         [ out ] LPDWORD lpdwVersion
         );
  
     error_status_t
     OpenCurrentConfig(
         [ in, unique ] PREGISTRY_SERVER_NAME ServerName,
         [ in ] REGSAM  samDesired,
         [ out ] PRPC_HKEY phKey
         );
  
     void Opnum28NotImplemented();
  
     error_status_t
     BaseRegQueryMultipleValues(
         [ in ] RPC_HKEY hKey,
         [ in, size_is(num_vals), length_is(num_vals) ] 
             PRVALENT val_listIn,
         [ out, size_is(num_vals), length_is(num_vals) ] 
             PRVALENT val_listOut,
         [ in ] DWORD num_vals,
         [ in, out, unique, size_is(*ldwTotsize), 
             length_is(*ldwTotsize) ] char* lpvalueBuf,
         [ in, out, ref ] LPDWORD ldwTotsize
         );
  
  
     void Opnum30NotImplemented();
  
     error_status_t
     BaseRegSaveKeyEx(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpFile,
         [ in, unique ] PRPC_SECURITY_ATTRIBUTES pSecurityAttributes,
         [ in ] DWORD    Flags
         );
  
     error_status_t
     OpenPerformanceText(
         [ in, unique ] PREGISTRY_SERVER_NAME ServerName,
         [ in ] REGSAM  samDesired,
         [ out ] PRPC_HKEY phKey
         );
  
     error_status_t
     OpenPerformanceNlsText(
         [ in, unique ] PREGISTRY_SERVER_NAME ServerName,
         [ in ] REGSAM  samDesired,
         [ out ] PRPC_HKEY phKey
         );
         
     error_status_t
     BaseRegQueryMultipleValues2(
         [ in ] RPC_HKEY hKey,
         [ in, size_is(num_vals), length_is(num_vals) ] 
             PRVALENT val_listIn,
         [ out, size_is(num_vals), length_is(num_vals) ] 
             PRVALENT val_listOut,
         [ in ] DWORD num_vals,
         [ in, out, unique, size_is(*ldwTotsize), length_is(*ldwTotsize) ]
             char * lpvalueBuf,
         [ in ] LPDWORD ldwTotsize,
         [ out ] LPDWORD ldwRequiredSize
         );
  
     error_status_t
     BaseRegDeleteKeyEx(
         [ in ] RPC_HKEY hKey,
         [ in ] PRRP_UNICODE_STRING lpSubKey,
         [ in ] REGSAM AccessMask,
         [ in ] DWORD Reserved
         );
  
 }
  
Show: