| 1 | /* | 
|---|
| 2 | winreg interface definition | 
|---|
| 3 | */ | 
|---|
| 4 |  | 
|---|
| 5 | import "lsa.idl", "security.idl", "misc.idl"; | 
|---|
| 6 |  | 
|---|
| 7 | [ | 
|---|
| 8 | uuid("338cd001-2244-31f1-aaaa-900038001003"), | 
|---|
| 9 | version(1.0), | 
|---|
| 10 | endpoint("ncacn_np:[\\pipe\\winreg]","ncacn_ip_tcp:","ncalrpc:"), | 
|---|
| 11 | pointer_default(unique), | 
|---|
| 12 | helpstring("Remote Registry Service") | 
|---|
| 13 | ] interface winreg | 
|---|
| 14 | { | 
|---|
| 15 | typedef bitmap security_secinfo security_secinfo; | 
|---|
| 16 |  | 
|---|
| 17 | /* | 
|---|
| 18 | * Access Bits for registry ACLS | 
|---|
| 19 | */ | 
|---|
| 20 |  | 
|---|
| 21 | typedef [bitmap32bit] bitmap { | 
|---|
| 22 | KEY_QUERY_VALUE                 = 0x00001, | 
|---|
| 23 | KEY_SET_VALUE                   = 0x00002, | 
|---|
| 24 | KEY_CREATE_SUB_KEY              = 0x00004, | 
|---|
| 25 | KEY_ENUMERATE_SUB_KEYS          = 0x00008, | 
|---|
| 26 | KEY_NOTIFY                      = 0x00010, | 
|---|
| 27 | KEY_CREATE_LINK                 = 0x00020, | 
|---|
| 28 | KEY_WOW64_64KEY                 = 0x00100, | 
|---|
| 29 | KEY_WOW64_32KEY                 = 0x00200 | 
|---|
| 30 | } winreg_AccessMask; | 
|---|
| 31 |  | 
|---|
| 32 | const int REG_KEY_READ = (      STANDARD_RIGHTS_READ_ACCESS     | | 
|---|
| 33 | KEY_QUERY_VALUE                 | | 
|---|
| 34 | KEY_ENUMERATE_SUB_KEYS          | | 
|---|
| 35 | KEY_NOTIFY); | 
|---|
| 36 |  | 
|---|
| 37 | const int REG_KEY_EXECUTE = REG_KEY_READ; | 
|---|
| 38 |  | 
|---|
| 39 | const int REG_KEY_WRITE = (     STANDARD_RIGHTS_WRITE_ACCESS    | | 
|---|
| 40 | KEY_SET_VALUE                   | | 
|---|
| 41 | KEY_CREATE_SUB_KEY); | 
|---|
| 42 |  | 
|---|
| 43 | const int REG_KEY_ALL = (       STANDARD_RIGHTS_REQUIRED_ACCESS | | 
|---|
| 44 | REG_KEY_READ                    | | 
|---|
| 45 | REG_KEY_WRITE                   | | 
|---|
| 46 | KEY_CREATE_LINK); | 
|---|
| 47 |  | 
|---|
| 48 | typedef [public] struct { | 
|---|
| 49 | [value(strlen_m_term(name)*2)] uint16 name_len; | 
|---|
| 50 | [value(strlen_m_term(name)*2)] uint16 name_size; | 
|---|
| 51 | [string,charset(UTF16)] uint16 *name; | 
|---|
| 52 | } winreg_String; | 
|---|
| 53 |  | 
|---|
| 54 | /******************/ | 
|---|
| 55 | /* Function: 0x00 */ | 
|---|
| 56 | WERROR winreg_OpenHKCR( | 
|---|
| 57 | [in,unique] uint16 *system_name, | 
|---|
| 58 | [in]      winreg_AccessMask access_mask, | 
|---|
| 59 | [out,ref] policy_handle *handle | 
|---|
| 60 | ); | 
|---|
| 61 |  | 
|---|
| 62 | /******************/ | 
|---|
| 63 | /* Function: 0x01 */ | 
|---|
| 64 | WERROR winreg_OpenHKCU( | 
|---|
| 65 | [in,unique] uint16 *system_name, | 
|---|
| 66 | [in]      winreg_AccessMask access_mask, | 
|---|
| 67 | [out,ref] policy_handle *handle | 
|---|
| 68 | ); | 
|---|
| 69 |  | 
|---|
| 70 | /******************/ | 
|---|
| 71 | /* Function: 0x02 */ | 
|---|
| 72 | [public] WERROR winreg_OpenHKLM( | 
|---|
| 73 | [in,unique] uint16 *system_name, | 
|---|
| 74 | [in]      winreg_AccessMask access_mask, | 
|---|
| 75 | [out,ref] policy_handle *handle | 
|---|
| 76 | ); | 
|---|
| 77 |  | 
|---|
| 78 | /******************/ | 
|---|
| 79 | /* Function: 0x03 */ | 
|---|
| 80 | WERROR winreg_OpenHKPD( | 
|---|
| 81 | [in,unique] uint16 *system_name, | 
|---|
| 82 | [in]      winreg_AccessMask access_mask, | 
|---|
| 83 | [out,ref] policy_handle *handle | 
|---|
| 84 | ); | 
|---|
| 85 |  | 
|---|
| 86 | /******************/ | 
|---|
| 87 | /* Function: 0x04 */ | 
|---|
| 88 | WERROR winreg_OpenHKU( | 
|---|
| 89 | [in,unique] uint16 *system_name, | 
|---|
| 90 | [in]      winreg_AccessMask access_mask, | 
|---|
| 91 | [out,ref] policy_handle *handle | 
|---|
| 92 | ); | 
|---|
| 93 |  | 
|---|
| 94 | /******************/ | 
|---|
| 95 | /* Function: 0x05 */ | 
|---|
| 96 | [public] WERROR winreg_CloseKey( | 
|---|
| 97 | [in,out,ref] policy_handle *handle | 
|---|
| 98 | ); | 
|---|
| 99 |  | 
|---|
| 100 | /******************/ | 
|---|
| 101 | /* Function: 0x06 */ | 
|---|
| 102 |  | 
|---|
| 103 | typedef struct { | 
|---|
| 104 | [size_is(size),length_is(len)] uint8 *data; | 
|---|
| 105 | uint32 size; | 
|---|
| 106 | uint32 len; | 
|---|
| 107 | } KeySecurityData; | 
|---|
| 108 |  | 
|---|
| 109 | typedef struct { | 
|---|
| 110 | uint32 length; | 
|---|
| 111 | KeySecurityData sd; | 
|---|
| 112 | boolean8  inherit; | 
|---|
| 113 | } winreg_SecBuf; | 
|---|
| 114 |  | 
|---|
| 115 | typedef [v1_enum] enum { | 
|---|
| 116 | REG_ACTION_NONE         = 0, /* used by caller */ | 
|---|
| 117 | REG_CREATED_NEW_KEY     = 1, | 
|---|
| 118 | REG_OPENED_EXISTING_KEY = 2 | 
|---|
| 119 | } winreg_CreateAction; | 
|---|
| 120 |  | 
|---|
| 121 | [public] WERROR winreg_CreateKey( | 
|---|
| 122 | [in,ref] policy_handle *handle, | 
|---|
| 123 | [in] winreg_String name, | 
|---|
| 124 | [in] winreg_String keyclass, | 
|---|
| 125 | [in] uint32 options, | 
|---|
| 126 | [in] winreg_AccessMask access_mask, | 
|---|
| 127 | [in,unique] winreg_SecBuf *secdesc, | 
|---|
| 128 | [out,ref] policy_handle *new_handle, | 
|---|
| 129 | [in,out,unique] winreg_CreateAction *action_taken | 
|---|
| 130 | ); | 
|---|
| 131 |  | 
|---|
| 132 | /******************/ | 
|---|
| 133 | /* Function: 0x07 */ | 
|---|
| 134 | [public] WERROR winreg_DeleteKey( | 
|---|
| 135 | [in,ref] policy_handle *handle, | 
|---|
| 136 | [in]     winreg_String key | 
|---|
| 137 | ); | 
|---|
| 138 |  | 
|---|
| 139 | /******************/ | 
|---|
| 140 | /* Function: 0x08 */ | 
|---|
| 141 | WERROR winreg_DeleteValue( | 
|---|
| 142 | [in,ref] policy_handle *handle, | 
|---|
| 143 | [in]     winreg_String value | 
|---|
| 144 | ); | 
|---|
| 145 |  | 
|---|
| 146 | typedef struct { | 
|---|
| 147 | [value(strlen_m_term_null(name)*2)] uint16 length; | 
|---|
| 148 | /* size cannot be auto-set by value() as it is the | 
|---|
| 149 | amount of space the server is allowed to use for this | 
|---|
| 150 | string in the reply, not its current size */ | 
|---|
| 151 | uint16 size; | 
|---|
| 152 | [size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name; | 
|---|
| 153 | } winreg_StringBuf; | 
|---|
| 154 |  | 
|---|
| 155 | /******************/ | 
|---|
| 156 | /* Function: 0x09 */ | 
|---|
| 157 | [public] WERROR winreg_EnumKey( | 
|---|
| 158 | [in,ref]        policy_handle    *handle, | 
|---|
| 159 | [in]            uint32           enum_index, | 
|---|
| 160 | [in,out,ref]    winreg_StringBuf *name, | 
|---|
| 161 | [in,out,unique] winreg_StringBuf *keyclass, | 
|---|
| 162 | [in,out,unique] NTTIME           *last_changed_time | 
|---|
| 163 | ); | 
|---|
| 164 |  | 
|---|
| 165 | typedef struct { | 
|---|
| 166 | [value(strlen_m_term(name)*2)] uint16 length; | 
|---|
| 167 | /* size cannot be auto-set by value() as it is the | 
|---|
| 168 | amount of space the server is allowed to use for this | 
|---|
| 169 | string in the reply, not its current size */ | 
|---|
| 170 | uint16 size; | 
|---|
| 171 | [size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name; | 
|---|
| 172 | } winreg_ValNameBuf; | 
|---|
| 173 |  | 
|---|
| 174 | /******************/ | 
|---|
| 175 | /* Function: 0x0a */ | 
|---|
| 176 |  | 
|---|
| 177 | [public] WERROR winreg_EnumValue( | 
|---|
| 178 | [in,ref]        policy_handle *handle, | 
|---|
| 179 | [in]            uint32 enum_index, | 
|---|
| 180 | [in,out,ref]    winreg_ValNameBuf *name, | 
|---|
| 181 | [in,out,unique] winreg_Type *type, | 
|---|
| 182 | [in,out,unique,size_is(*size),length_is(*length)] uint8 *value, | 
|---|
| 183 | [in,out,unique] uint32 *size, | 
|---|
| 184 | [in,out,unique] uint32 *length | 
|---|
| 185 | ); | 
|---|
| 186 |  | 
|---|
| 187 | /******************/ | 
|---|
| 188 | /* Function: 0x0b */ | 
|---|
| 189 | [public] WERROR winreg_FlushKey( | 
|---|
| 190 | [in,ref] policy_handle *handle | 
|---|
| 191 | ); | 
|---|
| 192 |  | 
|---|
| 193 | /******************/ | 
|---|
| 194 | /* Function: 0x0c */ | 
|---|
| 195 | [public] WERROR winreg_GetKeySecurity( | 
|---|
| 196 | [in,ref] policy_handle *handle, | 
|---|
| 197 | [in] security_secinfo sec_info, | 
|---|
| 198 | [in,out,ref] KeySecurityData *sd | 
|---|
| 199 | ); | 
|---|
| 200 |  | 
|---|
| 201 | /******************/ | 
|---|
| 202 | /* Function: 0x0d */ | 
|---|
| 203 | WERROR winreg_LoadKey( | 
|---|
| 204 | [in,ref] policy_handle *handle, | 
|---|
| 205 | [in,unique] winreg_String *keyname, | 
|---|
| 206 | [in,unique] winreg_String *filename | 
|---|
| 207 | ); | 
|---|
| 208 |  | 
|---|
| 209 | /******************/ | 
|---|
| 210 | /* Function: 0x0e */ | 
|---|
| 211 | typedef [public,bitmap32bit] bitmap { | 
|---|
| 212 | REG_NOTIFY_CHANGE_NAME          = 0x00000001, | 
|---|
| 213 | REG_NOTIFY_CHANGE_ATTRIBUTES    = 0x00000002, | 
|---|
| 214 | REG_NOTIFY_CHANGE_LAST_SET      = 0x00000004, | 
|---|
| 215 | REG_NOTIFY_CHANGE_SECURITY      = 0x00000008 | 
|---|
| 216 | } winreg_NotifyChangeType; | 
|---|
| 217 |  | 
|---|
| 218 | [public] WERROR winreg_NotifyChangeKeyValue( | 
|---|
| 219 | [in,ref] policy_handle *handle, | 
|---|
| 220 | [in] boolean8 watch_subtree, | 
|---|
| 221 | [in] winreg_NotifyChangeType notify_filter, | 
|---|
| 222 | [in] uint32 unknown, | 
|---|
| 223 | [in] winreg_String string1, | 
|---|
| 224 | [in] winreg_String string2, | 
|---|
| 225 | [in] uint32 unknown2 | 
|---|
| 226 | ); | 
|---|
| 227 |  | 
|---|
| 228 | /******************/ | 
|---|
| 229 | /* Function: 0x0f */ | 
|---|
| 230 | [public] WERROR winreg_OpenKey( | 
|---|
| 231 | [in,ref] policy_handle *parent_handle, | 
|---|
| 232 | [in] winreg_String keyname, | 
|---|
| 233 | [in] uint32 unknown, | 
|---|
| 234 | [in] winreg_AccessMask access_mask, | 
|---|
| 235 | [out,ref] policy_handle *handle | 
|---|
| 236 | ); | 
|---|
| 237 |  | 
|---|
| 238 | /******************/ | 
|---|
| 239 | /* Function: 0x10 */ | 
|---|
| 240 | [public] WERROR winreg_QueryInfoKey( | 
|---|
| 241 | [in,ref] policy_handle *handle, | 
|---|
| 242 | [in,out,ref] winreg_String *classname, | 
|---|
| 243 | [out,ref] uint32 *num_subkeys, | 
|---|
| 244 | [out,ref] uint32 *max_subkeylen, | 
|---|
| 245 | [out,ref] uint32 *max_classlen, | 
|---|
| 246 | [out,ref] uint32 *num_values, | 
|---|
| 247 | [out,ref] uint32 *max_valnamelen, | 
|---|
| 248 | [out,ref] uint32 *max_valbufsize, | 
|---|
| 249 | [out,ref] uint32 *secdescsize, | 
|---|
| 250 | [out,ref] NTTIME *last_changed_time | 
|---|
| 251 | ); | 
|---|
| 252 |  | 
|---|
| 253 | /******************/ | 
|---|
| 254 | /* Function: 0x11 */ | 
|---|
| 255 | [public] WERROR winreg_QueryValue( | 
|---|
| 256 | [in,ref] policy_handle *handle, | 
|---|
| 257 | [in,ref] winreg_String *value_name, | 
|---|
| 258 | [in,out,unique] winreg_Type *type, | 
|---|
| 259 | [in,out,unique,size_is(data_size ? *data_size : 0),length_is(data_length ? *data_length : 0),range(0,0x4000000)] uint8 *data, | 
|---|
| 260 | [in,out,unique] uint32 *data_size, | 
|---|
| 261 | [in,out,unique] uint32 *data_length | 
|---|
| 262 | ); | 
|---|
| 263 |  | 
|---|
| 264 | /******************/ | 
|---|
| 265 | /* Function: 0x12 */ | 
|---|
| 266 | [todo] WERROR winreg_ReplaceKey( | 
|---|
| 267 | ); | 
|---|
| 268 |  | 
|---|
| 269 | /******************/ | 
|---|
| 270 | /* Function: 0x13 */ | 
|---|
| 271 | WERROR winreg_RestoreKey( | 
|---|
| 272 | [in,ref] policy_handle *handle, | 
|---|
| 273 | [in,ref] winreg_String *filename, | 
|---|
| 274 | [in]     uint32 flags | 
|---|
| 275 | ); | 
|---|
| 276 |  | 
|---|
| 277 | /******************/ | 
|---|
| 278 | /* Function: 0x14 */ | 
|---|
| 279 |  | 
|---|
| 280 | typedef struct { | 
|---|
| 281 | uint32 data_size; | 
|---|
| 282 | KeySecurityData sec_data; | 
|---|
| 283 | uint8 inherit; | 
|---|
| 284 | } KeySecurityAttribute; | 
|---|
| 285 |  | 
|---|
| 286 | WERROR winreg_SaveKey( | 
|---|
| 287 | [in,ref] policy_handle *handle, | 
|---|
| 288 | [in,ref] winreg_String *filename, | 
|---|
| 289 | [in,unique] KeySecurityAttribute *sec_attrib | 
|---|
| 290 | ); | 
|---|
| 291 |  | 
|---|
| 292 | /******************/ | 
|---|
| 293 | /* Function: 0x15 */ | 
|---|
| 294 | WERROR winreg_SetKeySecurity( | 
|---|
| 295 | [in,ref] policy_handle *handle, | 
|---|
| 296 | [in] security_secinfo sec_info, | 
|---|
| 297 | [in,ref] KeySecurityData *sd | 
|---|
| 298 | ); | 
|---|
| 299 |  | 
|---|
| 300 | /******************/ | 
|---|
| 301 | /* Function: 0x16 */ | 
|---|
| 302 | WERROR winreg_SetValue( | 
|---|
| 303 | [in,ref]           policy_handle *handle, | 
|---|
| 304 | [in]               winreg_String name, | 
|---|
| 305 | [in]               winreg_Type type, | 
|---|
| 306 | [in,size_is(size),ref] uint8  *data, | 
|---|
| 307 | [in]               uint32 size | 
|---|
| 308 | ); | 
|---|
| 309 |  | 
|---|
| 310 | /******************/ | 
|---|
| 311 | /* Function: 0x17 */ | 
|---|
| 312 | [todo] WERROR winreg_UnLoadKey( | 
|---|
| 313 | ); | 
|---|
| 314 |  | 
|---|
| 315 | /******************/ | 
|---|
| 316 | /* Function: 0x18 */ | 
|---|
| 317 | WERROR winreg_InitiateSystemShutdown( | 
|---|
| 318 | [in,unique] uint16 *hostname, | 
|---|
| 319 | /* | 
|---|
| 320 | * Note: lsa_String and winreg_String both result | 
|---|
| 321 | *       in WERR_INVALID_PARAM | 
|---|
| 322 | */ | 
|---|
| 323 | [in,unique] lsa_StringLarge *message, | 
|---|
| 324 | [in]    uint32 timeout, | 
|---|
| 325 | [in]    uint8 force_apps, | 
|---|
| 326 | [in]    uint8 do_reboot | 
|---|
| 327 | ); | 
|---|
| 328 |  | 
|---|
| 329 | /******************/ | 
|---|
| 330 | /* Function: 0x19 */ | 
|---|
| 331 | WERROR winreg_AbortSystemShutdown( | 
|---|
| 332 | [in,unique] uint16 *server | 
|---|
| 333 | ); | 
|---|
| 334 |  | 
|---|
| 335 | /******************/ | 
|---|
| 336 | /* Function: 0x1a */ | 
|---|
| 337 | [public] WERROR winreg_GetVersion( | 
|---|
| 338 | [in,ref]     policy_handle *handle, | 
|---|
| 339 | [out,ref]    uint32 *version | 
|---|
| 340 | ); | 
|---|
| 341 |  | 
|---|
| 342 | /******************/ | 
|---|
| 343 | /* Function: 0x1b */ | 
|---|
| 344 | WERROR winreg_OpenHKCC( | 
|---|
| 345 | [in,unique] uint16 *system_name, | 
|---|
| 346 | [in]      winreg_AccessMask access_mask, | 
|---|
| 347 | [out,ref] policy_handle *handle | 
|---|
| 348 | ); | 
|---|
| 349 |  | 
|---|
| 350 | /******************/ | 
|---|
| 351 | /* Function: 0x1c */ | 
|---|
| 352 | WERROR winreg_OpenHKDD( | 
|---|
| 353 | [in,unique] uint16 *system_name, | 
|---|
| 354 | [in]      winreg_AccessMask access_mask, | 
|---|
| 355 | [out,ref] policy_handle *handle | 
|---|
| 356 | ); | 
|---|
| 357 |  | 
|---|
| 358 | typedef struct { | 
|---|
| 359 | winreg_String *name; | 
|---|
| 360 | winreg_Type type; | 
|---|
| 361 | uint32 offset; | 
|---|
| 362 | uint32 length; | 
|---|
| 363 | } QueryMultipleValue; | 
|---|
| 364 |  | 
|---|
| 365 | /******************/ | 
|---|
| 366 | /* Function: 0x1d */ | 
|---|
| 367 | [public] WERROR winreg_QueryMultipleValues( | 
|---|
| 368 | [in,ref] policy_handle *key_handle, | 
|---|
| 369 | [in,out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values, | 
|---|
| 370 | [in] uint32 num_values, | 
|---|
| 371 | [in,out,unique,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer, | 
|---|
| 372 | [in,out,ref] uint32 *buffer_size | 
|---|
| 373 | ); | 
|---|
| 374 |  | 
|---|
| 375 | /******************/ | 
|---|
| 376 | /* Function: 0x1e */ | 
|---|
| 377 | WERROR winreg_InitiateSystemShutdownEx( | 
|---|
| 378 | [in,unique] uint16 *hostname, | 
|---|
| 379 | /* | 
|---|
| 380 | * Note: lsa_String and winreg_String both result | 
|---|
| 381 | *       in WERR_INVALID_PARAM | 
|---|
| 382 | */ | 
|---|
| 383 | [in,unique] lsa_StringLarge *message, | 
|---|
| 384 | [in] uint32 timeout, | 
|---|
| 385 | [in] uint8 force_apps, | 
|---|
| 386 | [in] uint8 do_reboot, | 
|---|
| 387 | [in] uint32 reason | 
|---|
| 388 | ); | 
|---|
| 389 |  | 
|---|
| 390 | /******************/ | 
|---|
| 391 | /* Function: 0x1f */ | 
|---|
| 392 | [todo] WERROR winreg_SaveKeyEx( | 
|---|
| 393 | ); | 
|---|
| 394 |  | 
|---|
| 395 | /******************/ | 
|---|
| 396 | /* Function: 0x20 */ | 
|---|
| 397 | WERROR winreg_OpenHKPT( | 
|---|
| 398 | [in,unique] uint16 *system_name, | 
|---|
| 399 | [in]      winreg_AccessMask access_mask, | 
|---|
| 400 | [out,ref] policy_handle *handle | 
|---|
| 401 | ); | 
|---|
| 402 |  | 
|---|
| 403 | /******************/ | 
|---|
| 404 | /* Function: 0x21 */ | 
|---|
| 405 | WERROR winreg_OpenHKPN( | 
|---|
| 406 | [in,unique] uint16 *system_name, | 
|---|
| 407 | [in]      winreg_AccessMask access_mask, | 
|---|
| 408 | [out,ref] policy_handle *handle | 
|---|
| 409 | ); | 
|---|
| 410 |  | 
|---|
| 411 | /******************/ | 
|---|
| 412 | /* Function: 0x22 */ | 
|---|
| 413 | [todo] WERROR winreg_QueryMultipleValues2( | 
|---|
| 414 | ); | 
|---|
| 415 | } | 
|---|