Lines Matching refs:stm
48 static void istream_destructor(php_istream *stm);
52 php_istream *stm = (php_istream *)rsrc->ptr; in istream_dtor() local
53 istream_destructor(stm); in istream_dtor()
57 php_istream *stm = (php_istream*)This; \
58 if (GetCurrentThreadId() != stm->engine_thread) \
62 php_istream *stm = (php_istream*)This; \
63 if (GetCurrentThreadId() != stm->engine_thread) \
76 InterlockedIncrement(&stm->refcount); in stm_queryinterface()
88 return InterlockedIncrement(&stm->refcount); in stm_addref()
96 ret = InterlockedDecrement(&stm->refcount); in stm_release()
99 if (stm->res) in stm_release()
100 zend_list_delete(stm->res); in stm_release()
110 nread = (ULONG)php_stream_read(stm->stream, pv, cb); in stm_read()
126 nwrote = (ULONG)php_stream_write(stm->stream, pv, cb); in stm_write()
160 ret = php_stream_seek(stm->stream, offset, whence); in stm_seek()
177 if (php_stream_truncate_supported(stm->stream)) { in stm_set_size()
178 int ret = php_stream_truncate_set_size(stm->stream, (size_t)libNewSize.QuadPart); in stm_set_size()
200 php_stream_flush(stm->stream); in stm_commit()
251 static void istream_destructor(php_istream *stm) in istream_destructor() argument
253 if (stm->res) { in istream_destructor()
254 zend_resource *res = stm->res; in istream_destructor()
255 stm->res = NULL; in istream_destructor()
260 if (stm->refcount > 0) { in istream_destructor()
261 CoDisconnectObject((IUnknown*)stm, 0); in istream_destructor()
264 zend_list_delete(stm->stream->res); in istream_destructor()
266 CoTaskMemFree(stm); in istream_destructor()
272 php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm)); in php_com_wrapper_export_stream() local
275 if (stm == NULL) in php_com_wrapper_export_stream()
278 memset(stm, 0, sizeof(*stm)); in php_com_wrapper_export_stream()
279 stm->engine_thread = GetCurrentThreadId(); in php_com_wrapper_export_stream()
280 stm->lpVtbl = &php_istream_vtbl; in php_com_wrapper_export_stream()
281 stm->refcount = 1; in php_com_wrapper_export_stream()
282 stm->stream = stream; in php_com_wrapper_export_stream()
285 tmp = zend_list_insert(stm, le_istream); in php_com_wrapper_export_stream()
286 stm->res = Z_RES_P(tmp); in php_com_wrapper_export_stream()
288 return (IStream*)stm; in php_com_wrapper_export_stream()
543 IStream *stm = NULL; in CPH_METHOD() local
559 stm = php_com_wrapper_export_stream(stream); in CPH_METHOD()
560 if (stm == NULL) { in CPH_METHOD()
572 res = OleLoadFromStream(stm, &IID_IDispatch, &disp); in CPH_METHOD()
580 res = IPersistStreamInit_Load(helper->ipsi, stm); in CPH_METHOD()
584 res = IPersistStreamInit_Load(helper->ipsi, stm); in CPH_METHOD()
588 IStream_Release(stm); in CPH_METHOD()
603 IStream *stm = NULL; in CPH_METHOD() local
621 stm = php_com_wrapper_export_stream(stream); in CPH_METHOD()
622 if (stm == NULL) { in CPH_METHOD()
629 res = IPersistStreamInit_Save(helper->ipsi, stm, TRUE); in CPH_METHOD()
633 res = IPersistStream_Save(helper->ips, stm, TRUE); in CPH_METHOD()
637 IStream_Release(stm); in CPH_METHOD()