public void GetInfo()
    {
        var info = LocalDbRegistryReader.GetInfo();

        Assert.NotNull(info.path);
        Assert.NotNull(info.version);
    }
Пример #2
0
    static LocalDbApi()
    {
        var(path, version) = LocalDbRegistryReader.GetInfo();
        ApiVersion         = version;
        uint loadLibrarySearchDefaultDirs = 0x00001000;

        api = LoadLibraryEx(path, IntPtr.Zero, loadLibrarySearchDefaultDirs);
        if (api == IntPtr.Zero)
        {
            throw new Win32Exception();
        }

        createInstance  = GetFunction <LocalDBCreateInstance>();
        getInstanceInfo = GetFunction <LocalDBGetInstanceInfo>();
        getInstances    = GetFunction <LocalDBGetInstances>();
        deleteInstance  = GetFunction <LocalDBDeleteInstance>();
        startInstance   = GetFunction <LocalDBStartInstance>();
        stopInstance    = GetFunction <LocalDBStopInstance>();
    }