WNetEnumResource workgroups vs. domains

  • Thread starter Thread starter grimgroups
  • Start date Start date
G

grimgroups

I've seen this question posted numerous times but haven't seen an
answer/solution.

Problem:
I'm using WNetEnumResource to get a list of domains and workgroups from
the Microsoft Windows Network container. I'm currently using
NetGetDCName to get the object's pdc. If the pdc is null, I assume the
object is a workgroup. If the pdc is not null, I assume the object is
a domain. This seems to work. However, when there is a domain called
ACMEUSA and a workgroup called ACMEUSA, I run into trouble. The
original WNetEnumResource call returns only one AMCEUSA and calling
NetGetDCName returns a pdc.

Question:
When on a WindowsXP box, I bring up Network Neighborhood and open the
Microsoft Windows Network provider node. I see ACMEUSA listed once. I
open it and find two computers. I right-click properties on the first
computer. The resulting dialog states "Domain: ACMEUSA". I
right-click properties on the second computer. The resulting dialog
states "Workgroup: ACMEUSA". How does Windows determine whether to
display "Domain:" vs. "Workgroup:" ???

Thanks.
Grim
 
Back
Top