@@ -111,6 +111,14 @@ <h1>Source code for windows.com</h1><div class="highlight"><pre>
111111 < span class ="bp "> self</ span > < span class ="o "> .</ span > < span class ="n "> GetDocumentation</ span > < span class ="p "> (</ span > < span class ="nb "> id</ span > < span class ="p "> ,</ span > < span class ="n "> res</ span > < span class ="p "> ,</ span > < span class ="kc "> None</ span > < span class ="p "> ,</ span > < span class ="kc "> None</ span > < span class ="p "> ,</ span > < span class ="kc "> None</ span > < span class ="p "> )</ span >
112112 < span class ="k "> return</ span > < span class ="n "> res</ span >
113113
114+
115+ < span class ="k "> class</ span > < span class ="nc "> MemoryIStream</ span > < span class ="p "> (</ span > < span class ="n "> gdef</ span > < span class ="o "> .</ span > < span class ="n "> IStream</ span > < span class ="p "> ):</ span >
116+ < span class ="nd "> @classmethod</ span >
117+ < span class ="k "> def</ span > < span class ="nf "> create</ span > < span class ="p "> (</ span > < span class ="bp "> cls</ span > < span class ="p "> ):</ span >
118+ < span class ="bp "> self</ span > < span class ="o "> =</ span > < span class ="bp "> cls</ span > < span class ="p "> ()</ span >
119+ < span class ="n "> windows</ span > < span class ="o "> .</ span > < span class ="n "> winproxy</ span > < span class ="o "> .</ span > < span class ="n "> CreateStreamOnHGlobal</ span > < span class ="p "> (</ span > < span class ="n "> ppstm</ span > < span class ="o "> =</ span > < span class ="bp "> self</ span > < span class ="p "> )</ span >
120+ < span class ="k "> return</ span > < span class ="bp "> self</ span >
121+
114122< div class ="viewcode-block " id ="create_instance ">
115123< a class ="viewcode-back " href ="../../com.html#windows.com.create_instance "> [docs]</ a >
116124< span class ="k "> def</ span > < span class ="nf "> create_instance</ span > < span class ="p "> (</ span > < span class ="n "> clsiid</ span > < span class ="p "> ,</ span > < span class ="n "> targetinterface</ span > < span class ="p "> ,</ span > < span class ="n "> custom_iid</ span > < span class ="o "> =</ span > < span class ="kc "> None</ span > < span class ="p "> ,</ span > < span class ="n "> context</ span > < span class ="o "> =</ span > < span class ="n "> CLSCTX_INPROC_SERVER</ span > < span class ="o "> |</ span > < span class ="n "> CLSCTX_LOCAL_SERVER</ span > < span class ="p "> ):</ span >
@@ -119,6 +127,8 @@ <h1>Source code for windows.com</h1><div class="highlight"><pre>
119127 < span class ="n "> custom_iid</ span > < span class ="o "> =</ span > < span class ="n "> targetinterface</ span > < span class ="o "> .</ span > < span class ="n "> IID</ span >
120128 < span class ="k "> if</ span > < span class ="nb "> isinstance</ span > < span class ="p "> (</ span > < span class ="n "> clsiid</ span > < span class ="p "> ,</ span > < span class ="n "> basestring</ span > < span class ="p "> ):</ span >
121129 < span class ="n "> clsiid</ span > < span class ="o "> =</ span > < span class ="n "> IID</ span > < span class ="o "> .</ span > < span class ="n "> from_string</ span > < span class ="p "> (</ span > < span class ="n "> clsiid</ span > < span class ="p "> )</ span >
130+ < span class ="k "> if</ span > < span class ="nb "> isinstance</ span > < span class ="p "> (</ span > < span class ="n "> custom_iid</ span > < span class ="p "> ,</ span > < span class ="n "> basestring</ span > < span class ="p "> ):</ span >
131+ < span class ="n "> custom_iid</ span > < span class ="o "> =</ span > < span class ="n "> IID</ span > < span class ="o "> .</ span > < span class ="n "> from_string</ span > < span class ="p "> (</ span > < span class ="n "> custom_iid</ span > < span class ="p "> )</ span >
122132 < span class ="n "> winproxy</ span > < span class ="o "> .</ span > < span class ="n "> CoCreateInstance</ span > < span class ="p "> (</ span > < span class ="n "> byref</ span > < span class ="p "> (</ span > < span class ="n "> clsiid</ span > < span class ="p "> ),</ span > < span class ="kc "> None</ span > < span class ="p "> ,</ span > < span class ="n "> context</ span > < span class ="p "> ,</ span > < span class ="n "> byref</ span > < span class ="p "> (</ span > < span class ="n "> custom_iid</ span > < span class ="p "> ),</ span > < span class ="n "> byref</ span > < span class ="p "> (</ span > < span class ="n "> targetinterface</ span > < span class ="p "> ))</ span >
123133 < span class ="k "> return</ span > < span class ="n "> targetinterface</ span > </ div >
124134
0 commit comments