Git Product home page Git Product logo

w32's Introduction

About w32

w32 is a wrapper of windows apis for the Go Programming Language.

It wraps win32 apis to "Go style" to make them easier to use.

Setup

  1. Make sure you have a working Go installation and build environment, see this go-nuts post for details: http://groups.google.com/group/golang-nuts/msg/5c87630a84f4fd0c

    Updated versions of the Windows Go build are available here: http://code.google.com/p/gomingw/downloads/list

  2. Create a "gopath" directory if you do not have one yet and set the GOPATH variable accordingly. For example: mkdir -p go-externals/src export GOPATH=${PWD}/go-externals

  3. go get github.com/AllenDang/w32

  4. go install github.com/AllenDang/w32...

Contribute

Contributions in form of design, code, documentation, bug reporting or other ways you see fit are very welcome.

Thank You!

w32's People

Contributors

abduelhamit avatar allendang avatar anschelsc avatar bbigras avatar beatgammit avatar biorhitm avatar bronze1man avatar bsiegert avatar danieljoos avatar henkman avatar hnakamur avatar hut8 avatar leedenison avatar linuturk avatar mattn avatar mewmew avatar nbareil avatar paulmaddox avatar rygorous avatar saintfish avatar sqweek avatar taruti avatar ziyatdinov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

w32's Issues

Unable to Use for cross compiling

# github.com/AllenDang/w32
/home/developer/go/src/github.com/AllenDang/w32/advapi32.go:15:16: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/alpc.go:15:13: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/comctl32.go:13:16: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/comdlg32.go:13:16: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/create_process.go:13:13: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/dwmapi.go:21:14: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/fork.go:37:10: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/gdi32.go:13:13: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/gdiplus.go:92:15: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/kernel32.go:13:16: undefined: syscall.NewLazyDLL
/home/developer/go/src/github.com/AllenDang/w32/gdiplus.go:92:15: too many errors

when i try to goget for my archlinux machine

GPL

Can anyone tell me if I can use this in a GPL licensed project?

w32.a(_all.o): malformed pe file: No error

I only have the problem on 64-bits. It's fine on Xp 32-bits.

go version go1.3 windows/amd64
Windows 7 64-bits

Maybe it's a Golang bug.

package main

import (
    "fmt"
    "github.com/AllenDang/w32"
)

func main() {
    fmt.Println(w32.ANSI_CHARSET)
}
D:\Dev\go\Bogues\bugw32> go build
# _/D_/Dev/go/Bogues/bugw32
C:\Users\bbigras\AppData\Local\Temp\go-build866516527/github.com/AllenDang/w32.a(_all.o): malformed pe file: No error

The type is inconsistent..

type (
BOOL int
ATOM uint16
DWORD uint16
HANDLE uintptr
HINSTANCE HANDLE
HACCEL HANDLE
HCURSOR HANDLE
HDWP HANDLE
HICON HANDLE
HMENU HANDLE
HWND HANDLE
HBRUSH HANDLE
HRESULT uint
HFONT HANDLE
HDC HANDLE
HGDIOBJ HANDLE
HDROP HANDLE
HENHMETAFILE HANDLE
HBITMAP HANDLE
HPEN HANDLE
HKEY HANDLE
HIMAGELIST HANDLE
HGLOBAL HANDLE
HMODULE HANDLE
HRSRC HANDLE
COLORREF uint
)
COLORREF and HRESULT should be uint32

please refer to
http://msdn.microsoft.com/en-us/library/aa383751(v=vs.85).aspx

undefined: w32.GetDC

w32 compiles fine - trying to do a screen capture:

func screenRect() (image.Rectangle, error) {
hDC := w32.GetDC(0)
if hDC == 0 {
return image.Rectangle{}, fmt.Errorf("Could not Get primary display err:%d\n", w32.GetLastError())
}
defer w32.ReleaseDC(0, hDC)
x := w32.GetDeviceCaps(w32.HDC(hDC), w32.HORZRES)
y := w32.GetDeviceCaps(w32.HDC(hDC), w32.VERTRES)
return image.Rect(0, 0, x, y), nil
}

Compiling with:
GOARCH=386 go build

.\main_windows.go:46: undefined: w32.GetDC
.\main_windows.go:50: undefined: w32.ReleaseDC

So it finds GetDeviceCaps, but not the GetDC - what should I be looking for?

Callback example

I am trying to use your EnumDisplayMonitors function, but I can't figure out how to pass a function pointer that works. Do you have examples of how to use this?

I've tried lots of things along the lines of

func monitorEnumProc(hMonitor w32.HMONITOR, hdc w32.HDC, lpRect *w32.RECT, lparam w32.LPARAM) bool {
fmt.Println("hMonitor")
return true
}

func GetMonitors() {

funcPtr := monitorEnumProc
fptr := unsafe.Pointer(&funcPtr)
EnumDisplayMonitors(0, nil, uintptr(fptr), 0)

}

but it invariably crashes somewhere along the way, displaying something like
Process 33436 has exited with status 3221226525

Any assistance greatly appreciated!
-Steven

mobiles

This is a bit out there but did you even try windows Mobile using gomobile ?

I use gomobile and its opengl support to run apps on all desktops and mobiles, but am investigating supporting microsoft mobiles.

SO i figured its worth asking.

RegSetKeyValueW requires Windows Vista or newer (advapi32.go)

RegSetKeyValueW requires Windows Vista or newer. This is used in advapi32.go. It would be very good to have the ability to write to the registry while running Windows XP. RegSetValueEx seems to do a similar job and is supported in Windows 2000 and newer.

RegSetValueEx documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724923(v=vs.85).aspx

It would also be nice if it somehow detected that the user was running something older than Vista and complain appropriately (instead of failing with a somewhat cryptic panic), though honestly that warning is probably outside the scope of this package.

how to check current user language (locale)

hello, i need help with check what user locale is cerrentluy used.
for example i want to lo log pressed key, but this library allow return only key code
and i also want to determine language

Trying to implement CreateThread and WaitForSingleObject

I'm trying to get these to work, but don't know where to look if something is failing or working.

CreateThread

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682453(v=vs.85).aspx

Current Code

func CreateThread(attrib, stackSize, startAddress, parameter, createFlag, threadID uintptr) (uintptr, error) {                                                                                                                                                                 
    hand, _, err := createThread.Call(                                                                                                                                                                                                                                     
            attrib,                                                                                                                                                                                                                                                        
            stackSize,                                                                                                                                                                                                                                                     
            startAddress,                                                                                                                                                                                                                                                  
            parameter,                                                                                                                                                                                                                                                     
            createFlag,                                                                                                                                                                                                                                                    
            threadID)                                                                                                                                                                                                                                                      
    return hand, err                                                                                                                                                                                                                                                       
}       

WaitForSingleObject

http://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx

Current Code

func WaitForSingleObject(handle, milliSeconds uintptr) (uintptr, error) {                                                                                                                                                                                                      
    value, _, err := waitForSingleObject.Call(                                                                                                                                                                                                                             
            handle,                                                                                                                                                                                                                                                        
            milliSeconds)                                                                                                                                                                                                                                                  
    return value, err                                                                                                                                                                                                                                                      
} 
Vars at the top of the program
var (                                                                                                                                                                                                                                                                          
    kernel32            = syscall.MustLoadDLL("kernel32.dll")                                                                                                                                                                                                              
    VirtualAlloc        = kernel32.MustFindProc("VirtualAlloc")                                                                                                                                                                                                            
    moveMemory          = kernel32.MustFindProc("RtlMoveMemory")                                                                                                                                                                                                           
    createThread        = kernel32.MustFindProc("CreateThread")                                                                                                                                                                                                            
    waitForSingleObject = kernel32.MustFindProc("WaitForSingleObject")                                                                                                                                                                                                     
)                        

Error syscall GetTcpTable2, need your help

I am new to windows programming and wanna syscall GetTcpTable2 by Golang, but error occurs on calling it, could you help me figure it out, so appreciated if you could help.

package main

import (
    "fmt"
    "syscall"
    "unsafe"
)

type (
    DWORD uint32
)

type TCP_CONNECTION_OFFLOAD_STATE int

const (
    TcpConnectionOffloadStateInHost     TCP_CONNECTION_OFFLOAD_STATE = 0
    TcpConnectionOffloadStateOffloading TCP_CONNECTION_OFFLOAD_STATE = 1
    TcpConnectionOffloadStateOffloaded  TCP_CONNECTION_OFFLOAD_STATE = 2
    TcpConnectionOffloadStateUploading  TCP_CONNECTION_OFFLOAD_STATE = 3
    TcpConnectionOffloadStateMax        TCP_CONNECTION_OFFLOAD_STATE = 4
)

type MIB_TCPROW2 struct {
    dwState        DWORD
    dwLocalAddr    DWORD
    dwLocalPort    DWORD
    dwRemoteAddr   DWORD
    dwRemotePort   DWORD
    dwOwningPid    DWORD
    dwOffloadState TCP_CONNECTION_OFFLOAD_STATE
}

type MIB_TCPTABLE2 struct {
    dwNumEntries DWORD
    table        []MIB_TCPROW2
}

func main() {
    call := syscall.NewLazyDLL("Iphlpapi.dll")
    var table MIB_TCPTABLE2 = MIB_TCPTABLE2{}
    getTcpTable2 := call.NewProc("GetTcpTable2")
    bbb := true
    getTcpTable2.Call(uintptr(unsafe.Pointer(&table)), unsafe.Sizeof(table), uintptr(unsafe.Pointer(&bbb)))

    fmt.Println(table)
}

Error Log:

$ go run getTcpTable.go
Exception 0xc0000005 0x0 0x20 0x7ffe96f4b7a9
PC=0x7ffe96f4b7a9

syscall.Syscall(0x7ffe96f61de0, 0x3, 0xc08202fef8, 0x20, 0xc08202fe57, 0xc08201c000, 0x0, 0xc082008140)
        D:/Program Files/go/src/runtime/syscall_windows.go:163 +0x5c
syscall.(*Proc).Call(0xc08200a780, 0xc08202fe58, 0x3, 0x3, 0x30, 0x4f98e0, 0x0, 0x0)
        D:/Program Files/go/src/syscall/dll_windows.go:149 +0x4a6
syscall.(*LazyProc).Call(0xc082007fb0, 0xc08202fe58, 0x3, 0x3, 0x6540a8, 0x48ab89, 0x0, 0x0)
        D:/Program Files/go/src/syscall/dll_windows.go:300 +0x6d
main.main()
        C:/Users/hzlinqien/Desktop/getTcpTable.go:43 +0x1c2
rax     0x2
rbx     0x7dbf2c
rcx     0x7dbf20
rdi     0x7dd04c
rsi     0x7d68b0
rbp     0x4c
rsp     0x8fd10
r8      0x1
r9      0x20
r10     0xc08202fef8
r11     0xffff
r12     0x0
r13     0x5434be
r14     0x0
r15     0x1
rip     0x7ffe96f4b7a9
rflags  0x10246
cs      0x33
fs      0x53
gs      0x2b
exit status 2

NTFS Change Journal

Hi,
Would it be possible to add NTFS Change Journal support? There's is example given in C++, if you can just guide i can also do that. Any help would be appreciated.

Thanks

Failed to find GetWindowLongPtrW procedure in user32.dll

https://github.com/AllenDang/w32/blob/master/user32.go#L369 seems to be broken. Worked before updating from a version that was months old, has something changed?
(win7 x64)

Easily replicated by grabbing skelterjohn/go.wde/wdetest and adding wd.LockSize(true) there.


panic: Failed to find GetWindowLongPtrW procedure in user32.dll: The specified procedure could not be found.

goroutine 1 [running]:
syscall.(_LazyProc).mustFind(0x1263ada0, 0x125fa9d0)
$GOPATH/src/pkg/syscall/dll_windows.go:234 +0x6b
syscall.(_LazyProc).Call(0x1263ada0, 0x1d1718, 0x2, 0x2, 0x2, ...)
$GOPATH/src/pkg/syscall/dll_windows.go:247 +0x32
github.com/AllenDang/w32.GetWindowLongPtr(0x41a62, 0xfffffff0, 0x5c3b94, 0x4)
$GOPATH/src/pkg/github.com/AllenDang/w32/user32.go:369 +0x71
github.com/skelterjohn/go.wde/win.(*Window).LockSize(0x1261b400, 0x5c3b01, 0x4)
$GOPATH/src/pkg/github.com/skelterjohn/go.wde/win/win_windows.go:132 +0x35

main.init┬À1()
$GOPATH/src/rain/graphics.go:37 +0x179
main.init()
$GOPATH/src/rain/rain.go:134 +0xfd

goroutine 2 [syscall]:
created by runtime.main
$GOPATH/src/pkg/runtime/proc.c:221

goroutine 3 [syscall]:
syscall.Syscall6(0x76a578e2, 0x4, 0x12600600, 0x41a62, 0x0, ...)
$GOPATH/src/pkg/runtime/zsyscall_windows_386.c:97 +0x49
syscall.(_Proc).Call(0x125fa820, 0x1d477c, 0x4, 0x4, 0x0, ...)
$GOPATH/src/pkg/syscall/dll_windows.go:119 +0x4e9
syscall.(_LazyProc).Call(0x1263aba0, 0x1d477c, 0x4, 0x4, 0x1d4788, ...)
$GOPATH/src/pkg/syscall/dll_windows.go:248 +0x4f
github.com/AllenDang/w32.GetMessage(0x12600600, 0x41a62, 0x0, 0x0, 0x1, ...)
$GOPATH/src/pkg/github.com/AllenDang/w32/user32.go:227 +0x94
github.com/skelterjohn/go.wde/win.(*Window).HandleWndMessages(0x1261b400, 0x125f4b00)
$GOPATH/src/pkg/github.com/skelterjohn/go.wde/win/win_windows.go:197 +0x59

github.com/skelterjohn/go.wde/win._func_004(0x12601538, 0x12601528, 0x12601530,0x125f4b00, 0x0, ...)
$GOPATH/src/pkg/github.com/skelterjohn/go.wde/win/win_windows.go:110 +0x83

created by github.com/skelterjohn/go.wde/win.NewWindow
$GOPATH/src/pkg/github.com/skelterjohn/go.wde/win/win_windows.go:111 +0xb9

Could not determine kind of name for C.DWORD and C.INPUT

Getting the following errors on building the project.

# github.com/AllenDang/w32
could not determine kind of name for C.DWORD
could not determine kind of name for C.INPUT

Any help is appreciated.
Commands

go get -u -d github.com\getgauge\gauge_screenshot
cd $GOPATH/github.com\getgauge\gauge_screenshot
go build

Unable to build w32

Development Environment Info

Windows 8 64-bit
MinGW 32-bit
gcc 4.8.1
go version go1.2 windows/386

Sample of Error Output

c:\mingw\include\ole2.h:70:52: error: unknown type name 'LPOLESTR'
WINOLEAPI ReadFmtUserTypeStg(LPSTORAGE,CLIPFORMAT_,LPOLESTR_);
^
In file included from c:\mingw\include\rpcdce.h:33:0,
from c:\mingw\include\rpc.h:65,
from c:\mingw\include\windows.h:82,
from c:\mingw\include\rpc.h:27,
from c:\mingw\include\wtypes.h:29,
from src\github.com\AllenDang\w32\user32.go:8:
c:\mingw\include\ole2.h:80:41: error: expected ')' before 'const'
WINOLEAPI OleCreateLinkToFile(LPCOLESTR,REFIID,DWORD,LPFORMATETC,LPOLECLIENTSITE,LPSTORAGE,PVOID_);
^
In file included from c:\mingw\include\windows.h:101:0,
from c:\mingw\include\rpc.h:27,
from c:\mingw\include\wtypes.h:29,
from src\github.com\AllenDang\w32\user32.go:8:
c:\mingw\include\ole2.h:81:38: error: unknown type name 'LPCOLESTR'
WINOLEAPI OleCreateFromFile(REFCLSID,LPCOLESTR,REFIID,DWORD,LPFORMATETC,LPOLECLIENTSITE,LPSTORAGE,PVOID_);
^
c:\mingw\include\ole2.h:109:47: error: expected ')' before 'BOOL'
WINOLEAPI_(HGLOBAL) OleGetIconOfFile(LPOLESTR,BOOL);
^
c:\mingw\include\ole2.h:110:48: error: unknown type name 'LPOLESTR'
WINOLEAPI_(HGLOBAL) OleGetIconOfClass(REFCLSID,LPOLESTR,BOOL);
^
c:\mingw\include\ole2.h:111:59: error: unknown type name 'LPOLESTR'
WINOLEAPI_(HGLOBAL) OleMetafilePictFromIconAndLabel(HICON,LPOLESTR,LPOLESTR,UINT);
^
c:\mingw\include\ole2.h:111:68: error: unknown type name 'LPOLESTR'
WINOLEAPI_(HGLOBAL) OleMetafilePictFromIconAndLabel(HICON,LPOLESTR,LPOLESTR,UINT);
^
c:\mingw\include\ole2.h:112:44: error: unknown type name 'LPOLESTR'
WINOLEAPI OleRegGetUserType(REFCLSID,DWORD,LPOLESTR_);
^
In file included from src\github.com\AllenDang\w32\user32.go:8:0:
c:\mingw\include\wtypes.h:110:18: error: 'BSTR' redeclared as different kind of
symbol
typedef OLECHAR *BSTR;
^
In file included from c:\mingw\include\rpcdce.h:33:0,
from c:\mingw\include\rpc.h:65,
from c:\mingw\include\windows.h:82,
from c:\mingw\include\rpc.h:27,
from c:\mingw\include\wtypes.h:29,
from src\github.com\AllenDang\w32\user32.go:8:
c:\mingw\include\oleauto.h:231:1: note: previous declaration of 'BSTR' was here
WINOLEAUTAPI_(BSTR) SysAllocStringByteLen(const char_,unsigned int);
^

Other Info

The above is only the bottom several lines of the error output, the actual output is over a thousand lines of similar errors. I'm not sure why these errors are occurring, as far as I know there is nothing wrong with my MinGW installation. This issue may still be on my side. If so, any help would be greatly appreciated.

Error when trying to install on 1.1.2

$ go get github.com/AllenDang/w32
# AllenDang/w32
1: error: 'INPUT' undeclared (first use in this function)
1: note: each undeclared identifier is reported only once for each function it a
ppears in

go version go1.1.2 windows/386

advapi32.RegSetString Not Setting Entire String

Hi,

First of all, thanks for the library.

It seems that there are a few bugs in the advapi32.RegSetString function. The result is that RegSetString will not write the correct amount of characters to the registry entry. See the below comments:

func RegSetString(hKey HKEY, subKey string, value string) (errno int) {
    var lptr, vptr unsafe.Pointer
    if len(subKey) > 0 {
        lptr = unsafe.Pointer(syscall.StringToUTF16Ptr(subKey))
    }
    var buf []uint16
    //Is this size check needed? UTF16FromString always adds a null
    if len(value) > 0 {
        //New buf variable defined for if-statement scope
        buf, err := syscall.UTF16FromString(value)
        if err != nil {
            return ERROR_BAD_FORMAT
        }
        vptr = unsafe.Pointer(&buf[0])
    }
    //If you fmt.Println(buf) right here it is empty
    ret, _, _ := procRegSetValueEx.Call(
        uintptr(hKey),
        uintptr(lptr),
        uintptr(0),
        uintptr(REG_SZ),
        uintptr(vptr),
        //unsafe.Sizeof(buf) returns the size of the slice descriptor not the memory referenced
        //the slice descriptor is always of size 12 so this is always 14
        uintptr(unsafe.Sizeof(buf) + 2)) // 2 is the size of the terminating null character
    return int(ret)
}

I suggest changing to something more like this:

func RegSetString(hKey HKEY, subKey string, value string) (errno int) {
    var lptr, vptr unsafe.Pointer
    if len(subKey) > 0 {
        lptr = unsafe.Pointer(syscall.StringToUTF16Ptr(subKey))
    }
    buf, err := syscall.UTF16FromString(value)
    if err != nil {
        return ERROR_BAD_FORMAT
    }
    //Buf will at least containing 1 element (the null)
    vptr = unsafe.Pointer(&buf[0])
    ret, _, _ := procRegSetValueEx.Call(
        uintptr(hKey),
        uintptr(lptr),
        uintptr(0),
        uintptr(REG_SZ),
        uintptr(vptr),
        uintptr(int(unsafe.Sizeof(buf[0])) * len(buf))
    return int(ret)
}

Hope this helps,

N

Unable to install after 1 May merges

go get -v github.com/AllenDang/w32 throws various errors like:

fork_constants.go:11: SYNCHRONIZE redeclared in this block
fork_constants.go:26: PROCESS_TERMINATE redeclared in this block

Does this package need panic when error is return or just return the error?

GetClientRect panic when error is return.
ReleaseDC return false when error is return.
CreateWindowEx return null and ignore the real error message. (I have verified the GetLastError api will not return error when this api fail.)

Here is my suggest:

  • Use MustGetClientRect to show the this function will panic when error is return.(so the caller can not simple ignore the error, it will stop the program when the error occured. the caller can ignore it will recover )
  • Use GetClientRect return a error type to show if there is an error. (so the caller can ignore it easier)

Adding some examples

Thanks for your Windows API wrapper. Could you please add a couple exapmles of its implementation in Go? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.