def create(root, subkey="", sec=None):
    key = registry(root, accept_value=False).get_key(subkey)
    computer0, root0, path0, value0 = _parse_moniker(key.moniker, accept_value=False)

    parts = path0.split(sep)
    for i, part in enumerate(parts):
        computer, root, path, value = _parse_moniker(create_moniker(computer0, root0, sep.join(parts[:i+1])), accept_value=False)
        if computer:
            hRoot = wrapped(win32api.RegConnectRegistry, computer, root)
        else:
            hRoot = root
        wrapped(
            win32api.RegCreateKeyEx,
            Key=hRoot,
            SubKey=path,
            samDesired=Registry._access(Registry.DEFAULT_ACCESS),
            SecurityAttributes=sec.pyobject() if sec else None
        )

    return key
Create a key and apply specific security to it, returning the
dataset/ETHPy150Open tjguk/winsys/winsys/registry.py/create