Lines Matching refs:stm
46 static void istream_destructor(php_istream *stm);
49 php_istream *stm = (php_istream*)This; \
50 if (GetCurrentThreadId() != stm->engine_thread) \
54 php_istream *stm = (php_istream*)This; \
55 if (GetCurrentThreadId() != stm->engine_thread) \
68 InterlockedIncrement(&stm->refcount); in stm_queryinterface()
80 return InterlockedIncrement(&stm->refcount); in stm_addref()
88 ret = InterlockedDecrement(&stm->refcount); in stm_release()
91 istream_destructor(stm); in stm_release()
101 nread = (ULONG)php_stream_read(stm->stream, pv, cb); in stm_read()
117 nwrote = php_stream_write(stm->stream, pv, cb); in stm_write()
151 ret = php_stream_seek(stm->stream, offset, whence); in stm_seek()
168 if (php_stream_truncate_supported(stm->stream)) { in stm_set_size()
169 int ret = php_stream_truncate_set_size(stm->stream, (size_t)libNewSize.QuadPart); in stm_set_size()
191 php_stream_flush(stm->stream); in stm_commit()
242 static void istream_destructor(php_istream *stm) in istream_destructor() argument
244 if (stm->refcount > 0) { in istream_destructor()
245 CoDisconnectObject((IUnknown*)stm, 0); in istream_destructor()
248 zend_list_delete(stm->stream->res); in istream_destructor()
250 CoTaskMemFree(stm); in istream_destructor()
256 php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm)); in php_com_wrapper_export_stream() local
258 if (stm == NULL) in php_com_wrapper_export_stream()
261 memset(stm, 0, sizeof(*stm)); in php_com_wrapper_export_stream()
262 stm->engine_thread = GetCurrentThreadId(); in php_com_wrapper_export_stream()
263 stm->lpVtbl = &php_istream_vtbl; in php_com_wrapper_export_stream()
264 stm->refcount = 1; in php_com_wrapper_export_stream()
265 stm->stream = stream; in php_com_wrapper_export_stream()
269 return (IStream*)stm; in php_com_wrapper_export_stream()
520 IStream *stm = NULL; in CPH_METHOD() local
535 stm = php_com_wrapper_export_stream(stream); in CPH_METHOD()
536 if (stm == NULL) { in CPH_METHOD()
548 res = OleLoadFromStream(stm, &IID_IDispatch, &disp); in CPH_METHOD()
556 res = IPersistStreamInit_Load(helper->ipsi, stm); in CPH_METHOD()
560 res = IPersistStreamInit_Load(helper->ipsi, stm); in CPH_METHOD()
564 IStream_Release(stm); in CPH_METHOD()
578 IStream *stm = NULL; in CPH_METHOD() local
595 stm = php_com_wrapper_export_stream(stream); in CPH_METHOD()
596 if (stm == NULL) { in CPH_METHOD()
603 res = IPersistStreamInit_Save(helper->ipsi, stm, TRUE); in CPH_METHOD()
607 res = IPersistStream_Save(helper->ips, stm, TRUE); in CPH_METHOD()
611 IStream_Release(stm); in CPH_METHOD()