Lines Matching refs:stm

48 static void istream_destructor(php_istream *stm TSRMLS_DC);
52 php_istream *stm = (php_istream *)rsrc->ptr; in istream_dtor() local
53 istream_destructor(stm TSRMLS_CC); in istream_dtor()
57 php_istream *stm = (php_istream*)This; \
59 if (GetCurrentThreadId() != stm->engine_thread) \
63 php_istream *stm = (php_istream*)This; \
64 if (GetCurrentThreadId() != stm->engine_thread) \
77 InterlockedIncrement(&stm->refcount); in stm_queryinterface()
89 return InterlockedIncrement(&stm->refcount); in stm_addref()
97 ret = InterlockedDecrement(&stm->refcount); in stm_release()
100 if (stm->id) in stm_release()
101 zend_list_delete(stm->id); in stm_release()
111 nread = php_stream_read(stm->stream, pv, cb); in stm_read()
127 nwrote = php_stream_write(stm->stream, pv, cb); in stm_write()
161 ret = php_stream_seek(stm->stream, offset, whence); in stm_seek()
178 if (php_stream_truncate_supported(stm->stream)) { in stm_set_size()
179 int ret = php_stream_truncate_set_size(stm->stream, (size_t)libNewSize.QuadPart); in stm_set_size()
201 php_stream_flush(stm->stream); in stm_commit()
252 static void istream_destructor(php_istream *stm TSRMLS_DC) in istream_destructor()
254 if (stm->id) { in istream_destructor()
255 int id = stm->id; in istream_destructor()
256 stm->id = 0; in istream_destructor()
261 if (stm->refcount > 0) { in istream_destructor()
262 CoDisconnectObject((IUnknown*)stm, 0); in istream_destructor()
265 zend_list_delete(stm->stream->rsrc_id); in istream_destructor()
267 CoTaskMemFree(stm); in istream_destructor()
273 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 stm->id = zend_list_insert(stm, le_istream TSRMLS_CC); in php_com_wrapper_export_stream()
287 return (IStream*)stm; in php_com_wrapper_export_stream()
539 IStream *stm = NULL; in CPH_METHOD() local
555 stm = php_com_wrapper_export_stream(stream TSRMLS_CC); in CPH_METHOD()
556 if (stm == NULL) { in CPH_METHOD()
568 res = OleLoadFromStream(stm, &IID_IDispatch, &disp); in CPH_METHOD()
576 res = IPersistStreamInit_Load(helper->ipsi, stm); in CPH_METHOD()
580 res = IPersistStreamInit_Load(helper->ipsi, stm); in CPH_METHOD()
584 IStream_Release(stm); in CPH_METHOD()
599 IStream *stm = NULL; in CPH_METHOD() local
617 stm = php_com_wrapper_export_stream(stream TSRMLS_CC); in CPH_METHOD()
618 if (stm == NULL) { in CPH_METHOD()
625 res = IPersistStreamInit_Save(helper->ipsi, stm, TRUE); in CPH_METHOD()
629 res = IPersistStream_Save(helper->ips, stm, TRUE); in CPH_METHOD()
633 IStream_Release(stm); in CPH_METHOD()