WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Forum

  Reply to this topicStart new topicStart Poll

How to obtain computer Workgroup name, Networking

SeaFarer
Posted: Jan 4 2008, 01:10 PM
Quote Post


GO NAVY!
******

Group: Admins
Posts: 835
Member No.: 1464
Joined: 2-September 05


Hi,

Is there a way the Workgroup name for a computer be obtained without directly reading the registry?

I checked Developers Reference, nothing in the version I have. Plus I am unable to use MSDN at the moment. The bandwidth is too slow for me.

My connects rates are averaging between 33kbps and 56kbs since there are problems with the phone lines here. Same trouble as last year, water is grounding out one of the trunks around here. :angry:

Regards

PMUsers Website
Top
samael
Posted: Jan 5 2008, 04:18 AM
Quote Post


Typo-lord
******

Group: Admins
Posts: 341
Member No.: 5187
Joined: 10-June 07


The Net* family of APIs do the job.
The documented version of them is available from Win2000 Professional and above (Netapi32.dll).

The (undocumented) Net* family of APIs for Win95/98 are burried inside RADMIN32.DLL and RLOCAL32.DLL.

Here are some links to get you started:

Torry's Delphi Pages
This one here is in Delphi, but only uses Win32API, so it won't be too hard to follow up...
It's a cross-platform example of how to determine the user's logon domain (Win9x & NT).


Win32 samples
Look at the Network section (on the left pane) for some examples (C++).

Finally, since these APIs are the predecessors of the Net* APIs, you can gather useful information about them (purpose, arguments etc) from their Netapi32.dll successors, on MSDN.

In other words, what you will need to do, is to create import libraries for RADMIN32.DLL and RLOCAL32.DLL, figure out what functions you'll need to use, and find the prototypes/arguments for those APIs (... and use them).
PM
Top
SeaFarer
Posted: Jan 6 2008, 12:07 AM
Quote Post


GO NAVY!
******

Group: Admins
Posts: 835
Member No.: 1464
Joined: 2-September 05


From a technical view... plenty of information to go on.

Seems more involved than we really need to get for just one or two pieces of static string data. Which reminds me...

As of late I did notice that some API calls, more than likely more often than we realize, get data directly from the registry, or internal tables that are periodically updated or set during start.

Perhaps since we are talking assembly, and simple static REG_SZ data already available, maybe it is better just to fetch this directly from the registry. It sure will be easier, for me anyway. :lol:

Given what the data is, seems the less complex method of getting the Workgroup name for the local computer/network. Especially since the data is for display only and wouldn't be acted upon in my binary.

Less libraries, less work, plus a smaller project and binary. B)

Yes... I do realize the location of this type of information is probably platform dependent.

Thanks Sam.

Excellent reply.
PMUsers Website
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll