@@ -28,6 +28,9 @@ internal delegate int IdeGetPopupObject(out IntPtr objectType, out IntPtr object
2828 //*FUNC: 79*/ char *(*IDE_GetObjectSource)(char *ObjectType, char *ObjectOwner, char *ObjectName);
2929 internal delegate IntPtr IdeGetObjectSource ( string objectType , string objectOwner , string objectName ) ;
3030
31+ //*FUNC: 97*/ extern char *(*IDE_GetConnectAs)();
32+ internal delegate IntPtr IdeGetConnectAs ( ) ;
33+
3134 //*FUNC: 150*/ void (*IDE_CreateToolButton)(int ID, int Index, char *Name, char *BitmapFile, int BitmapHandle);
3235 internal delegate void IdeCreateToolButton ( int id , int index , string name , string bitmapFile , long bitmapHandle ) ;
3336
@@ -47,12 +50,14 @@ public class PlsqlDeveloperUtPlsqlPlugin
4750 internal static IdeCreatePopupItem createPopupItem ;
4851 internal static IdeGetPopupObject getPopupObject ;
4952 internal static IdeGetObjectSource getObjectSource ;
53+ internal static IdeGetConnectAs getConnectAs ;
5054 internal static IdeCreateToolButton createToolButton ;
5155
5256 internal static int pluginId ;
5357 internal static string username ;
5458 internal static string password ;
5559 internal static string database ;
60+ internal static string connectAs ;
5661
5762 private static PlsqlDeveloperUtPlsqlPlugin _plugin ;
5863
@@ -163,6 +168,9 @@ public static void RegisterCallback(int index, IntPtr function)
163168 case 79 :
164169 getObjectSource = ( IdeGetObjectSource ) Marshal . GetDelegateForFunctionPointer ( function , typeof ( IdeGetObjectSource ) ) ;
165170 break ;
171+ case 97 :
172+ getConnectAs = ( IdeGetConnectAs ) Marshal . GetDelegateForFunctionPointer ( function , typeof ( IdeGetConnectAs ) ) ;
173+ break ;
166174 case 150 :
167175 createToolButton = ( IdeCreateToolButton ) Marshal . GetDelegateForFunctionPointer ( function , typeof ( IdeCreateToolButton ) ) ;
168176 break ;
@@ -200,7 +208,7 @@ public static void OnMenuClick(int index)
200208 {
201209 if ( connected ( ) )
202210 {
203- var testResultWindow = new TestRunnerWindow ( _plugin , username , password , database ) ;
211+ var testResultWindow = new TestRunnerWindow ( _plugin , username , password , database , connectAs ) ;
204212 Windows . Add ( testResultWindow ) ;
205213 testResultWindow . RunTestsAsync ( "_ALL" , username , null , null , false ) ;
206214 }
@@ -209,7 +217,7 @@ public static void OnMenuClick(int index)
209217 {
210218 if ( connected ( ) )
211219 {
212- var testResultWindow = new TestRunnerWindow ( _plugin , username , password , database ) ;
220+ var testResultWindow = new TestRunnerWindow ( _plugin , username , password , database , connectAs ) ;
213221 Windows . Add ( testResultWindow ) ;
214222 testResultWindow . RunTestsAsync ( "_ALL" , username , null , null , true ) ;
215223 }
@@ -220,7 +228,7 @@ public static void OnMenuClick(int index)
220228 {
221229 getPopupObject ( out IntPtr type , out IntPtr owner , out IntPtr name , out IntPtr subType ) ;
222230
223- var testResultWindow = new TestRunnerWindow ( _plugin , username , password , database ) ;
231+ var testResultWindow = new TestRunnerWindow ( _plugin , username , password , database , connectAs ) ;
224232 Windows . Add ( testResultWindow ) ;
225233 testResultWindow . RunTestsAsync ( Marshal . PtrToStringAnsi ( type ) , Marshal . PtrToStringAnsi ( owner ) ,
226234 Marshal . PtrToStringAnsi ( name ) , Marshal . PtrToStringAnsi ( subType ) , false ) ;
@@ -232,7 +240,7 @@ public static void OnMenuClick(int index)
232240 {
233241 getPopupObject ( out IntPtr type , out IntPtr owner , out IntPtr name , out IntPtr subType ) ;
234242
235- var testResultWindow = new TestRunnerWindow ( _plugin , username , password , database ) ;
243+ var testResultWindow = new TestRunnerWindow ( _plugin , username , password , database , connectAs ) ;
236244 Windows . Add ( testResultWindow ) ;
237245 testResultWindow . RunTestsAsync ( Marshal . PtrToStringAnsi ( type ) , Marshal . PtrToStringAnsi ( owner ) ,
238246 Marshal . PtrToStringAnsi ( name ) , Marshal . PtrToStringAnsi ( subType ) , true ) ;
@@ -266,6 +274,10 @@ private static void ConnectToDatabase()
266274 username = Marshal . PtrToStringAnsi ( ptrUsername ) ;
267275 password = Marshal . PtrToStringAnsi ( ptrPassword ) ;
268276 database = Marshal . PtrToStringAnsi ( ptrDatabase ) ;
277+
278+ IntPtr ptrConnectAs = getConnectAs ( ) ;
279+
280+ connectAs = Marshal . PtrToStringAnsi ( ptrConnectAs ) ;
269281 }
270282 }
271283 catch ( Exception e )
0 commit comments