Re: How can I get WINS?
Re: How can I get WINS?
- Subject: Re: How can I get WINS?
- From: Quinn <email@hidden>
- Date: Fri, 7 May 2004 13:35:00 +0100
At 2:32 +0400 4/5/04, Igor garnov wrote:
Is it possible for an application run by a user without
administrative privileges to GET the address of WINS, which is set
in a "Directory Access" utility?
AFAICT there's no supported API for getting this. You have a couple
of choices.
1. You can go poking around in the file system to see what file this
gets stored in, and then read the information from there.
2. You can use the Directory Services API dsDoPlugInCustomCall to
issue a custom call to the SMB directory services plug-in. You can
determine the selector value (kReadSMBConfigData) and the format of
the response from the Darwin source.
<
http://www.opensource.apple.com/darwinsource/Current/DSNSLPlugins-79.4/SMB/CSMBPlugin.h>
<
http://www.opensource.apple.com/darwinsource/Current/DSNSLPlugins-79.4/SMB/CSMBPlugin.cpp>
[These links require an APSL <
http://www.opensource.apple.com/apsl/>
account.]
This is how the Directory Services application gets this information.
Neither of these represent a supported API, so I strongly recommend
that you file a bug requesting an official API for getting this
information. Please include a discussion of why you need this
information. Resolving this bug could be as simple as documented the
existing dsDoPlugInCustomCall selector and response.
<
http://developer.apple.com/bugreporter/>
Please email me the bug number so that I can keep tabs on it.
This leaves the question of which approach to take. Normally I'd
recommend calling an API, even an undocumented one, over reading a
private configuration file. However, in this case the 'private'
configuration file is, in fact, quite well known (it's
"/etc/smb.conf"). My instinct is to still to recommend the call, but
that decision is a lot harder to justify when the file has a "man"
page. So, *shrug*, I dunno.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.