WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
Pages (2) [1] 2   ( Go to first unread post )

Computer Workgroup name, is there a way the Workgroup name for a computer be obtained without directly reading the registry?

SeaFarer
Quote Post


Extremely Active Member
******

Group: Members
Posts: 1753
Member No.: 1464
Joined: 2-September 05


Hi,

Is there a way the Workgroup name for a computer can 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. mad.gif

Regards
PM
Top
samael
Quote Post


Typo-lord
******

Group: Moderators
Posts: 404
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
Quote Post


Extremely Active Member
******

Group: Members
Posts: 1753
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. laugh.gif

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. cool.gif

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

Thanks Sam.

Excellent reply.
PM
Top
ChillyWilly
Quote Post


Very Very Active Member
*****

Group: Members
Posts: 91
Member No.: 5730
Joined: 5-January 08


i just ran into the same problem
it can easily be obtain using WMI but that would involve using com in asm which is a pain in the butt
i guess im gonna try HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Domain to get the domain if the key has a value
then figure out how to get the workgroup name
PMEmail Poster
Top
SeaFarer
Quote Post


Extremely Active Member
******

Group: Members
Posts: 1753
Member No.: 1464
Joined: 2-September 05


QUOTE (ChillyWilly @ Sep 24 2009, 08:22 PM)
i just ran into the same problem

Hi Will.

Since my original inquiry... I use this key

HKLM\System\CurrentControlSet\Services\VxD\VNETSUP

Then read the String Value named Workgroup to determine the workgroup name.

It works like a champ on 9x.

Incidentally the key "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip" does not even exist on my 9x system.

cheers.gif
PM
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (2) [1] 2  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google