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()
64 php_istream *stm = (php_istream*)This; \
65 if (GetCurrentThreadId() != stm->engine_thread) \
78 InterlockedIncrement(&stm->refcount); in stm_queryinterface()
90 return InterlockedIncrement(&stm->refcount); in stm_addref()
98 ret = InterlockedDecrement(&stm->refcount); in stm_release()
101 if (stm->id) in stm_release()
102 zend_list_delete(stm->id); in stm_release()
112 nread = php_stream_read(stm->stream, pv, cb); in stm_read()
128 nwrote = php_stream_write(stm->stream, pv, cb); in stm_write()
162 ret = php_stream_seek(stm->stream, offset, whence); in stm_seek()
179 if (php_stream_truncate_supported(stm->stream)) { in stm_set_size()
180 int ret = php_stream_truncate_set_size(stm->stream, (size_t)libNewSize.QuadPart); in stm_set_size()
202 php_stream_flush(stm->stream); in stm_commit()
253 static void istream_destructor(php_istream *stm) in istream_destructor() argument
257 if (stm->id) { in istream_destructor()
258 int id = stm->id; in istream_destructor()
259 stm->id = 0; in istream_destructor()
264 if (stm->refcount > 0) { in istream_destructor()
265 CoDisconnectObject((IUnknown*)stm, 0); in istream_destructor()
268 zend_list_delete(stm->stream->rsrc_id); in istream_destructor()
270 CoTaskMemFree(stm); in istream_destructor()
276 php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm)); in php_com_wrapper_export_stream() local
278 if (stm == NULL) in php_com_wrapper_export_stream()
281 memset(stm, 0, sizeof(*stm)); in php_com_wrapper_export_stream()
282 stm->engine_thread = GetCurrentThreadId(); in php_com_wrapper_export_stream()
283 stm->lpVtbl = &php_istream_vtbl; in php_com_wrapper_export_stream()
284 stm->refcount = 1; in php_com_wrapper_export_stream()
285 stm->stream = stream; in php_com_wrapper_export_stream()
288 stm->id = zend_list_insert(stm, le_istream); in php_com_wrapper_export_stream()
290 return (IStream*)stm; in php_com_wrapper_export_stream()
551 IStream *stm = NULL; in CPH_METHOD() local
567 stm = php_com_wrapper_export_stream(stream TSRMLS_CC); in CPH_METHOD()
568 if (stm == NULL) { in CPH_METHOD()
580 res = OleLoadFromStream(stm, &IID_IDispatch, &disp); in CPH_METHOD()
588 res = IPersistStreamInit_Load(helper->ipsi, stm); in CPH_METHOD()
592 res = IPersistStreamInit_Load(helper->ipsi, stm); in CPH_METHOD()
596 IStream_Release(stm); in CPH_METHOD()
611 IStream *stm = NULL; in CPH_METHOD() local
629 stm = php_com_wrapper_export_stream(stream TSRMLS_CC); in CPH_METHOD()
630 if (stm == NULL) { in CPH_METHOD()
637 res = IPersistStreamInit_Save(helper->ipsi, stm, TRUE); in CPH_METHOD()
641 res = IPersistStream_Save(helper->ips, stm, TRUE); in CPH_METHOD()
645 IStream_Release(stm); in CPH_METHOD()