Registry API

- [x] GetSystemRegistryQuota
- [x] RegCloseKey
- [x] RegConnectRegistry
- [x] RegCopyTree
- [x] RegCreateKeyEx
- RegCreateKeyTransacted (needs [Kernel Transaction Manager API](http://msdn.microsoft.com/en-us/library/windows/desktop/bb986748%28v=vs.85%29.aspx))
- [x] RegDeleteKey
- [x] RegDeleteKeyEx
- RegDeleteKeyTransacted (needs [Kernel Transaction Manager API](http://msdn.microsoft.com/en-us/library/windows/desktop/bb986748%28v=vs.85%29.aspx))
- [x] RegDeleteKeyValue
- [x] RegDeleteTree
- [x] RegDeleteValue
- [x] RegDisablePredefinedCache
- [x] RegDisablePredefinedCacheEx
- [x] RegDisableReflectionKey
- [x] RegEnableReflectionKey
- [x] RegEnumKeyEx
- [x] RegEnumValue
- [x] RegFlushKey
- RegGetKeySecurity (needs [Authorization API](http://msdn.microsoft.com/en-us/library/windows/desktop/aa375769%28v=vs.85%29.aspx))
- [x] RegGetValue
- RegLoadKey (needs [Enabling priviledges](http://msdn.microsoft.com/en-us/library/aa446619%28VS.85%29.aspx))
- [x] RegLoadMUIString
- [x] RegNotifyChangeKeyValue
- [x] RegOpenCurrentUser
- [x] RegOpenKeyEx
- RegOpenKeyTransacted (needs [Kernel Transaction Manager API](http://msdn.microsoft.com/en-us/library/windows/desktop/bb986748%28v=vs.85%29.aspx))
- [x] RegOpenUserClassesRoot
- [x] RegOverridePredefKey
- [x] RegQueryInfoKey
- [x] RegQueryMultipleValues
- [x] RegQueryReflectionKey
- [x] RegQueryValueEx
- RegReplaceKey (needs [Enabling priviledges](http://msdn.microsoft.com/en-us/library/aa446619%28VS.85%29.aspx))
- RegRestoreKey (needs [Enabling priviledges](http://msdn.microsoft.com/en-us/library/aa446619%28VS.85%29.aspx))
- RegSaveKey (needs [Enabling priviledges](http://msdn.microsoft.com/en-us/library/aa446619%28VS.85%29.aspx))
- RegSaveKeyEx (needs [Enabling priviledges](http://msdn.microsoft.com/en-us/library/aa446619%28VS.85%29.aspx))
- [x] RegSetKeyValue
- RegSetKeySecurity (needs [Authorization API](http://msdn.microsoft.com/en-us/library/windows/desktop/aa375769%28v=vs.85%29.aspx))
- [x] RegSetValueEx
- RegUnLoadKey (needs [Enabling priviledges](http://msdn.microsoft.com/en-us/library/aa446619%28VS.85%29.aspx))

Usage example:
```rust
extern crate winapi;
use std::{fmt,mem,os,ptr};
use RegValue::{SZ,DWORD};

enum RegValue {
    SZ(String),
    DWORD(winapi::DWORD)
}

impl fmt::Show for RegValue {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            SZ(ref s) => write!(f, "SZ({})", s),
            DWORD(n) => write!(f, "DWORD({})", n)
        }
    }
}

fn create_key(h_key: winapi::HKEY, subkey: &str, opts: winapi::DWORD, perms: winapi::REGSAM)
-> Result<winapi::HKEY, uint> {
    let subkey_cstr = subkey.to_c_str();
    let mut new_hkey: winapi::HKEY = ptr::null_mut();
    let mut disp: winapi::DWORD = 0;
    match unsafe{
        winapi::RegCreateKeyExA(
            h_key,
            subkey_cstr.as_ptr(),
            0,
            ptr::null(),
            opts,
            perms,
            ptr::null_mut(),
            &mut new_hkey,
            &mut disp //created new key or opened existing one, ignored in this example
        )
    } {
        0 => Ok(new_hkey),
        err => Err(err as uint)
    }
}

fn close_key(h_key: winapi::HKEY) -> Result<(), uint> {
    match unsafe{
        winapi::RegCloseKey(h_key)
    } {
        0 => Ok(()),
        err => Err(err as uint)
    }
}

fn set_value(h_key: winapi::HKEY, name: &str, value: &RegValue) -> Result<(), uint> {
    let name_c = name.to_c_str();
    match unsafe{
        match *value {
            RegValue::SZ(ref s) => winapi::RegSetValueExA(
                h_key,
                name_c.as_ptr(),
                0,
                winapi::REG_SZ,
                s.to_c_str().as_ptr() as *const winapi::BYTE,
                (s.len()+1) as u32),
            RegValue::DWORD(n) => {
                let buf: [u8, ..4] = mem::transmute(n);
                winapi::RegSetValueExA(
                    h_key,
                    name_c.as_ptr(),
                    0,
                    winapi::REG_DWORD,
                    buf.as_ptr() as *const winapi::BYTE,
                    4u32)
            }
        }
    } {
        0 => Ok(()),
        err => Err(err as uint)
    }
}

fn query_value(h_key: winapi::HKEY, name: &str) -> Result<RegValue, uint> {
    let name_c = name.to_c_str();
    let mut vtype: winapi::DWORD = 0;
    let mut buf_len: winapi::DWORD = winapi::MAX_PATH as winapi::DWORD;
    let mut buf: Vec<u8> = Vec::with_capacity(buf_len as uint);
    match unsafe{
        winapi::RegQueryValueExA(
            h_key,
            name_c.as_ptr() as *const i8,
            ptr::null_mut(),
            &mut vtype,
            buf.as_mut_ptr() as winapi::LPBYTE,
            &mut buf_len
        )
    } {
        0 => match vtype {
            winapi::REG_SZ => {
                Ok(RegValue::SZ(unsafe{
                    String::from_raw_buf_len(buf.as_ptr(), (buf_len - 1) as uint)
                }))
            },
            winapi::REG_DWORD => {
                Ok(RegValue::DWORD(unsafe{
                    buf.set_len(4);
                    (buf[3] as u32 << 24) | (buf[2] as u32 << 16) |
                        (buf[1] as u32 << 8) | (buf[0] as u32)
                }))
            },
            _ => Err(13) //invalid data error
        },
        err => Err(err as uint)
    }
}

fn main() {
    let h_key = create_key(winapi::HKEY_CURRENT_USER, "Software\\RegistrySampleRustA",
            winapi::REG_OPTION_NON_VOLATILE, winapi::KEY_ALL_ACCESS)
    .unwrap_or_else(|i| panic!(os::error_string(i)));

    let name_sz = "Test string";
    set_value(h_key, name_sz, &RegValue::SZ("This is a test".to_string()))
    .unwrap_or_else(|i| panic!(os::error_string(i)));

    let val_sz = query_value(h_key, name_sz)
    .unwrap_or_else(|i| panic!(os::error_string(i)));
    println!("{}", val_sz);

    let name_dw = "Test number";
    set_value(h_key, name_dw, &RegValue::DWORD(1234567))
    .unwrap_or_else(|i| panic!(os::error_string(i)));

    let val_dw = query_value(h_key, name_dw)
    .unwrap_or_else(|i| panic!(os::error_string(i)));
    println!("{}", val_dw);

    close_key(h_key).unwrap_or_else(|i: uint| panic!(os::error_string(i)));
}
```
Example with unicode:
```rust
extern crate winapi;
use std::{os,ptr};

fn main() {
    let mut h_key: winapi::HKEY = ptr::null_mut();
    let mut disp: winapi::DWORD = 0;
    let mut path_w: Vec<u16> = "Software\\RegistrySampleRustW\\".utf16_units().collect();
    path_w.push(0);
    let res_w = unsafe{
        winapi::RegCreateKeyExW(
            winapi::HKEY_CURRENT_USER,
            path_w.as_ptr(),
            0,
            ptr::null(),
            winapi::REG_OPTION_NON_VOLATILE,
            winapi::KEY_WRITE,
            ptr::null_mut(),
            &mut h_key,
            &mut disp
        )
    };
    println!("RegCreateKeyExW returned {}, disposition = {}",
        os::error_string(res_w as uint), disp);
}


```
As well as all the `REG_` stuff is in `winnt.h`