Skip to content

Commit aa0127b

Browse files
committed
feat: Expose ScnLoadData.RequestId()
1 parent 3b6704e commit aa0127b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

sciter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,17 @@ var (
134134
// \param[in] data \b LPBYTE, pointer to data buffer.
135135
// \param[in] requestId \b LPVOID, SCN_LOAD_DATA requestId.
136136
// \return \b BOOL, TRUE if Sciter accepts the data or \c FALSE if error occured
137-
func (s *Sciter) DataReadyAsync(uri string, data []byte, requestId unsafe.Pointer) bool {
137+
func (s *Sciter) DataReadyAsync(uri string, data []byte, requestId C.HREQUEST) bool {
138138
// args
139139
var pData C.LPCBYTE
140140
if len(data) > 0 {
141141
pData = (C.LPCBYTE)(unsafe.Pointer(&data[0]))
142142
}
143143
curi := StringToWcharPtr(uri)
144144
cdataLength := C.UINT(len(data))
145-
crequestId := C.LPVOID(requestId)
145+
146146
// cgo call
147-
ret := C.SciterDataReadyAsync(s.hwnd, curi, pData, cdataLength, crequestId)
147+
ret := C.SciterDataReadyAsync(s.hwnd, curi, pData, cdataLength, requestId)
148148
if ret == 0 {
149149
return false
150150
}

types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,10 @@ func (s *ScnLoadData) Uri() string {
10081008
return Utf16ToString((*uint16)(unsafe.Pointer(s.uri)))
10091009
}
10101010

1011+
func (s *ScnLoadData) RequestId() C.HREQUEST {
1012+
return s.RequestId
1013+
}
1014+
10111015
func (s *ScnLoadData) Data() []byte {
10121016
ret := ByteCPtrToBytes(s.outData, s.outDataSize)
10131017
return ret

0 commit comments

Comments
 (0)