Lines Matching refs:stm

45 static void istream_destructor(php_istream *stm);
49 php_istream *stm = (php_istream *)rsrc->ptr; in istream_dtor() local
50 istream_destructor(stm); in istream_dtor()
54 php_istream *stm = (php_istream*)This; \
55 if (GetCurrentThreadId() != stm->engine_thread) \
59 php_istream *stm = (php_istream*)This; \
60 if (GetCurrentThreadId() != stm->engine_thread) \
73 InterlockedIncrement(&stm->refcount); in stm_queryinterface()
85 return InterlockedIncrement(&stm->refcount); in stm_addref()
93 ret = InterlockedDecrement(&stm->refcount); in stm_release()
96 if (stm->res) in stm_release()
97 zend_list_delete(stm->res); in stm_release()
107 nread = (ULONG)php_stream_read(stm->stream, pv, cb); in stm_read()
123 nwrote = php_stream_write(stm->stream, pv, cb); in stm_write()
157 ret = php_stream_seek(stm->stream, offset, whence); in stm_seek()
174 if (php_stream_truncate_supported(stm->stream)) { in stm_set_size()
175 int ret = php_stream_truncate_set_size(stm->stream, (size_t)libNewSize.QuadPart); in stm_set_size()
197 php_stream_flush(stm->stream); in stm_commit()
248 static void istream_destructor(php_istream *stm) in istream_destructor() argument
250 if (stm->refcount > 0) { in istream_destructor()
251 CoDisconnectObject((IUnknown*)stm, 0); in istream_destructor()
254 zend_list_delete(stm->stream->res); in istream_destructor()
256 CoTaskMemFree(stm); in istream_destructor()
262 php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm)); in php_com_wrapper_export_stream() local
264 if (stm == NULL) in php_com_wrapper_export_stream()
267 memset(stm, 0, sizeof(*stm)); in php_com_wrapper_export_stream()
268 stm->engine_thread = GetCurrentThreadId(); in php_com_wrapper_export_stream()
269 stm->lpVtbl = &php_istream_vtbl; in php_com_wrapper_export_stream()
270 stm->refcount = 1; in php_com_wrapper_export_stream()
271 stm->stream = stream; in php_com_wrapper_export_stream()
274 stm->res = zend_register_resource(stm, le_istream); in php_com_wrapper_export_stream()
276 return (IStream*)stm; in php_com_wrapper_export_stream()
532 IStream *stm = NULL; in CPH_METHOD() local
547 stm = php_com_wrapper_export_stream(stream); in CPH_METHOD()
548 if (stm == NULL) { in CPH_METHOD()
560 res = OleLoadFromStream(stm, &IID_IDispatch, &disp); in CPH_METHOD()
568 res = IPersistStreamInit_Load(helper->ipsi, stm); in CPH_METHOD()
572 res = IPersistStreamInit_Load(helper->ipsi, stm); in CPH_METHOD()
576 IStream_Release(stm); in CPH_METHOD()
590 IStream *stm = NULL; in CPH_METHOD() local
607 stm = php_com_wrapper_export_stream(stream); in CPH_METHOD()
608 if (stm == NULL) { in CPH_METHOD()
615 res = IPersistStreamInit_Save(helper->ipsi, stm, TRUE); in CPH_METHOD()
619 res = IPersistStream_Save(helper->ips, stm, TRUE); in CPH_METHOD()
623 IStream_Release(stm); in CPH_METHOD()