Getting APIs from server

Login to reply to this topic.
Fri, 2007-12-14 11:04
Joined: 2007-12-14
Forum posts: 6

I have created a Client/server dll and exported the APIs in .def file. From my application, I would like to retrieve all API function function my giving my server name...How can I do it? Puzzled Puzzled Puzzled Puzzled


Fri, 2007-12-14 11:42
Joined: 2007-09-20
Forum posts: 114
Re: Getting APIs from server

The question is not clear.

Usually the server provides API to create(as a thread/process) and start it (if it is not run automatically at boot-up). It will be something like "StartMyServer(TServerParams X)". In most of the cases this will be the only method exposed by the server


Chao,
Raghav

Fri, 2007-12-14 14:11
Joined: 2003-12-05
Forum posts: 671
Re: Getting APIs from server

Usually the server developer develops also the client api for client app developers. The client api consists of the necessary header files and the lib/def file plus the runtime dll file for using the server. And of course the server exe file.

Fri, 2007-12-14 16:05
Joined: 2007-12-14
Forum posts: 6
Re: Getting APIs from server

Yes, I understood that .def contains list of export functions. But my question is through an application by programmatically, how can I get list of exported functions supported in my server. For example, suppose my client/server exports some 5 function, through my application I would like to find out the name of the 5 functions, something like RLibrary::Lookup()...!!

Fri, 2007-12-14 16:09
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2006
Re: Getting APIs from server

In current (public) version of the OS, the function are exported by ordinal and not by name... so this later information is not available in the DLL and cannot be retrieved programmatically.

I am not sure whether I have read this somewhere and where or if it is just a dream, but this may change in the future.


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Fri, 2007-12-14 18:25
Joined: 2007-09-23
Forum posts: 159
Re: Getting APIs from server

If you could get them, then what next?

Fri, 2007-12-14 21:29
Joined: 2003-12-05
Forum posts: 671
Re: Getting APIs from server

I do not understand the use case here. You have a server, but then on the client side you do not know what is the API of the server? Or are you planning an extendable server where client could query the (new) APIs without updating the client API? But then, you'd need to query not just the API functions but also what data gets in and out... Weird discussion, IMHO... Could you explain clearly what are you aiming at?

Mon, 2007-12-17 10:39
Joined: 2007-12-14
Forum posts: 6
Re: Getting APIs from server

I want to write an application(stand alone) which can access any server, which we can get from the serverlist thru TFindServer and then once choosing the server,I want to access the various APIs exported by it. Hope now my objective is clear to you all.

so when we say,the function are exported by ordinal and not by name and how will i be able to get the parameters to each function call. I am not sure about this functionality, can you please point me to any resources which will tell about this concept in detail.

Mon, 2007-12-17 15:25
Joined: 2005-11-20
Forum posts: 1241
Re: Getting APIs from server

Never mind that you won't find the APIs because they are only exported by ordinal, and never mind there is no description of the parameters of the methods anywhere, let's assume for the moment you know somehow that your server has a method "CallMe" that wants to receive a TInt, two TBool, and an pointer to some struct.

Please tell me how on earth you could program a generic call to such a method, in C++? How would you put a TInt, two TBool and a pointer to some struct on the stack properly and then call the method?

You know, only at runtime you would learn the parameters, you would have to "synthesize" the call.

If that's possible at all, it's possible only with very dirty "hacking".

If you ask me, you have now already *two* impossible things, the discovery of the APIs itself that is not possible, and the inability of C++ to call arbitrary methods dynamically at runtime, so if I were you I would put this to rest.


René Brunner

Mon, 2007-12-17 16:32
Joined: 2003-12-05
Forum posts: 671
Re: Getting APIs from server

And finally, if you somehow magically would succeed in finding the right parameters and return values _and_ the order of calling these methods, how would you know the expected behaviour of the server and use this behaviour somehow sensibly from your application...

Imagine a dark room next to the room you are, with an open doorway, you cannot see what is in the dark room. Imagine throwing objects (apple, orange, table cloth, scissors, book, etc) into the room and hoping to receive something back from the room. Imagine trying to find out the logic of what items are thrown back from the dark room. And considering that as soon as you throw in wrong things, the house would immediately fall down because of this. This is what you are trying to do here...

  • Login to reply to this topic.