github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/exp/shiny/driver/internal/win32/zsyscall_windows.go (about)

     1  // MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT
     2  
     3  package win32
     4  
     5  import "unsafe"
     6  import "syscall"
     7  
     8  var _ unsafe.Pointer
     9  
    10  var (
    11  	moduser32 = syscall.NewLazyDLL("user32.dll")
    12  
    13  	procGetDC             = moduser32.NewProc("GetDC")
    14  	procReleaseDC         = moduser32.NewProc("ReleaseDC")
    15  	procSendMessageW      = moduser32.NewProc("SendMessageW")
    16  	procPostMessageW      = moduser32.NewProc("PostMessageW")
    17  	procGetMessageW       = moduser32.NewProc("GetMessageW")
    18  	procTranslateMessage  = moduser32.NewProc("TranslateMessage")
    19  	procDispatchMessageW  = moduser32.NewProc("DispatchMessageW")
    20  	procDefWindowProcW    = moduser32.NewProc("DefWindowProcW")
    21  	procRegisterClassW    = moduser32.NewProc("RegisterClassW")
    22  	procCreateWindowExW   = moduser32.NewProc("CreateWindowExW")
    23  	procDestroyWindow     = moduser32.NewProc("DestroyWindow")
    24  	procLoadIconW         = moduser32.NewProc("LoadIconW")
    25  	procLoadCursorW       = moduser32.NewProc("LoadCursorW")
    26  	procShowWindow        = moduser32.NewProc("ShowWindow")
    27  	procGetClientRect     = moduser32.NewProc("GetClientRect")
    28  	procGetKeyState       = moduser32.NewProc("GetKeyState")
    29  	procPostQuitMessage   = moduser32.NewProc("PostQuitMessage")
    30  	procGetKeyboardLayout = moduser32.NewProc("GetKeyboardLayout")
    31  	procGetKeyboardState  = moduser32.NewProc("GetKeyboardState")
    32  	procToUnicodeEx       = moduser32.NewProc("ToUnicodeEx")
    33  )
    34  
    35  func GetDC(hwnd HWND) (dc HDC, err error) {
    36  	r0, _, e1 := syscall.Syscall(procGetDC.Addr(), 1, uintptr(hwnd), 0, 0)
    37  	dc = HDC(r0)
    38  	if dc == 0 {
    39  		if e1 != 0 {
    40  			err = error(e1)
    41  		} else {
    42  			err = syscall.EINVAL
    43  		}
    44  	}
    45  	return
    46  }
    47  
    48  func ReleaseDC(hwnd HWND, dc HDC) (err error) {
    49  	r1, _, e1 := syscall.Syscall(procReleaseDC.Addr(), 2, uintptr(hwnd), uintptr(dc), 0)
    50  	if r1 == 0 {
    51  		if e1 != 0 {
    52  			err = error(e1)
    53  		} else {
    54  			err = syscall.EINVAL
    55  		}
    56  	}
    57  	return
    58  }
    59  
    60  func SendMessage(hwnd HWND, uMsg uint32, wParam uintptr, lParam uintptr) (lResult uintptr) {
    61  	r0, _, _ := syscall.Syscall6(procSendMessageW.Addr(), 4, uintptr(hwnd), uintptr(uMsg), uintptr(wParam), uintptr(lParam), 0, 0)
    62  	lResult = uintptr(r0)
    63  	return
    64  }
    65  
    66  func _PostMessage(hwnd HWND, uMsg uint32, wParam uintptr, lParam uintptr) (lResult bool) {
    67  	r0, _, _ := syscall.Syscall6(procPostMessageW.Addr(), 4, uintptr(hwnd), uintptr(uMsg), uintptr(wParam), uintptr(lParam), 0, 0)
    68  	lResult = r0 != 0
    69  	return
    70  }
    71  
    72  func _GetMessage(msg *_MSG, hwnd HWND, msgfiltermin uint32, msgfiltermax uint32) (ret int32, err error) {
    73  	r0, _, e1 := syscall.Syscall6(procGetMessageW.Addr(), 4, uintptr(unsafe.Pointer(msg)), uintptr(hwnd), uintptr(msgfiltermin), uintptr(msgfiltermax), 0, 0)
    74  	ret = int32(r0)
    75  	if ret == -1 {
    76  		if e1 != 0 {
    77  			err = error(e1)
    78  		} else {
    79  			err = syscall.EINVAL
    80  		}
    81  	}
    82  	return
    83  }
    84  
    85  func _TranslateMessage(msg *_MSG) (done bool) {
    86  	r0, _, _ := syscall.Syscall(procTranslateMessage.Addr(), 1, uintptr(unsafe.Pointer(msg)), 0, 0)
    87  	done = r0 != 0
    88  	return
    89  }
    90  
    91  func _DispatchMessage(msg *_MSG) (ret int32) {
    92  	r0, _, _ := syscall.Syscall(procDispatchMessageW.Addr(), 1, uintptr(unsafe.Pointer(msg)), 0, 0)
    93  	ret = int32(r0)
    94  	return
    95  }
    96  
    97  func _DefWindowProc(hwnd HWND, uMsg uint32, wParam uintptr, lParam uintptr) (lResult uintptr) {
    98  	r0, _, _ := syscall.Syscall6(procDefWindowProcW.Addr(), 4, uintptr(hwnd), uintptr(uMsg), uintptr(wParam), uintptr(lParam), 0, 0)
    99  	lResult = uintptr(r0)
   100  	return
   101  }
   102  
   103  func _RegisterClass(wc *_WNDCLASS) (atom uint16, err error) {
   104  	r0, _, e1 := syscall.Syscall(procRegisterClassW.Addr(), 1, uintptr(unsafe.Pointer(wc)), 0, 0)
   105  	atom = uint16(r0)
   106  	if atom == 0 {
   107  		if e1 != 0 {
   108  			err = error(e1)
   109  		} else {
   110  			err = syscall.EINVAL
   111  		}
   112  	}
   113  	return
   114  }
   115  
   116  func _CreateWindowEx(exstyle uint32, className *uint16, windowText *uint16, style uint32, x int32, y int32, width int32, height int32, parent HWND, menu syscall.Handle, hInstance syscall.Handle, lpParam uintptr) (hwnd HWND, err error) {
   117  	r0, _, e1 := syscall.Syscall12(procCreateWindowExW.Addr(), 12, uintptr(exstyle), uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(windowText)), uintptr(style), uintptr(x), uintptr(y), uintptr(width), uintptr(height), uintptr(parent), uintptr(menu), uintptr(hInstance), uintptr(lpParam))
   118  	hwnd = HWND(r0)
   119  	if hwnd == 0 {
   120  		if e1 != 0 {
   121  			err = error(e1)
   122  		} else {
   123  			err = syscall.EINVAL
   124  		}
   125  	}
   126  	return
   127  }
   128  
   129  func _DestroyWindow(hwnd HWND) (err error) {
   130  	r1, _, e1 := syscall.Syscall(procDestroyWindow.Addr(), 1, uintptr(hwnd), 0, 0)
   131  	if r1 == 0 {
   132  		if e1 != 0 {
   133  			err = error(e1)
   134  		} else {
   135  			err = syscall.EINVAL
   136  		}
   137  	}
   138  	return
   139  }
   140  
   141  func _LoadIcon(hInstance syscall.Handle, iconName uintptr) (icon syscall.Handle, err error) {
   142  	r0, _, e1 := syscall.Syscall(procLoadIconW.Addr(), 2, uintptr(hInstance), uintptr(iconName), 0)
   143  	icon = syscall.Handle(r0)
   144  	if icon == 0 {
   145  		if e1 != 0 {
   146  			err = error(e1)
   147  		} else {
   148  			err = syscall.EINVAL
   149  		}
   150  	}
   151  	return
   152  }
   153  
   154  func _LoadCursor(hInstance syscall.Handle, cursorName uintptr) (cursor syscall.Handle, err error) {
   155  	r0, _, e1 := syscall.Syscall(procLoadCursorW.Addr(), 2, uintptr(hInstance), uintptr(cursorName), 0)
   156  	cursor = syscall.Handle(r0)
   157  	if cursor == 0 {
   158  		if e1 != 0 {
   159  			err = error(e1)
   160  		} else {
   161  			err = syscall.EINVAL
   162  		}
   163  	}
   164  	return
   165  }
   166  
   167  func _ShowWindow(hwnd HWND, cmdshow int32) (wasvisible bool) {
   168  	r0, _, _ := syscall.Syscall(procShowWindow.Addr(), 2, uintptr(hwnd), uintptr(cmdshow), 0)
   169  	wasvisible = r0 != 0
   170  	return
   171  }
   172  
   173  func _GetClientRect(hwnd HWND, rect *_RECT) (err error) {
   174  	r1, _, e1 := syscall.Syscall(procGetClientRect.Addr(), 2, uintptr(hwnd), uintptr(unsafe.Pointer(rect)), 0)
   175  	if r1 == 0 {
   176  		if e1 != 0 {
   177  			err = error(e1)
   178  		} else {
   179  			err = syscall.EINVAL
   180  		}
   181  	}
   182  	return
   183  }
   184  
   185  func _GetKeyState(virtkey int32) (keystatus int16) {
   186  	r0, _, _ := syscall.Syscall(procGetKeyState.Addr(), 1, uintptr(virtkey), 0, 0)
   187  	keystatus = int16(r0)
   188  	return
   189  }
   190  
   191  func _PostQuitMessage(exitCode int32) {
   192  	syscall.Syscall(procPostQuitMessage.Addr(), 1, uintptr(exitCode), 0, 0)
   193  	return
   194  }
   195  
   196  func _GetKeyboardLayout(threadID uint32) (locale syscall.Handle) {
   197  	r0, _, _ := syscall.Syscall(procGetKeyboardLayout.Addr(), 1, uintptr(threadID), 0, 0)
   198  	locale = syscall.Handle(r0)
   199  	return
   200  }
   201  
   202  func _GetKeyboardState(lpKeyState *byte) (err error) {
   203  	r1, _, e1 := syscall.Syscall(procGetKeyboardState.Addr(), 1, uintptr(unsafe.Pointer(lpKeyState)), 0, 0)
   204  	if r1 == 0 {
   205  		if e1 != 0 {
   206  			err = error(e1)
   207  		} else {
   208  			err = syscall.EINVAL
   209  		}
   210  	}
   211  	return
   212  }
   213  
   214  func _ToUnicodeEx(wVirtKey uint32, wScanCode uint32, lpKeyState *byte, pwszBuff *uint16, cchBuff int32, wFlags uint32, dwhkl syscall.Handle) (ret int32) {
   215  	r0, _, _ := syscall.Syscall9(procToUnicodeEx.Addr(), 7, uintptr(wVirtKey), uintptr(wScanCode), uintptr(unsafe.Pointer(lpKeyState)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(wFlags), uintptr(dwhkl), 0, 0)
   216  	ret = int32(r0)
   217  	return
   218  }