<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic checking NT-domain in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942967#M17518</link>
    <description>Hello, &lt;BR /&gt; &lt;BR /&gt;I have an application that has to behave differently at different branches of our company. Someone suggested to check on the NT-domain name to find out where the program is running, but I have no idea how to accomplish this. Does any one have an idea how to do this? Or perhaps there is a better method to check where the program is running? &lt;BR /&gt;I prefer not to check on the presence of specific files at certain locations etc.  &lt;BR /&gt; &lt;BR /&gt;Thanks, &lt;BR /&gt; &lt;BR /&gt;Walter Kramer</description>
    <pubDate>Thu, 15 Mar 2001 01:53:34 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2001-03-15T01:53:34Z</dc:date>
    <item>
      <title>checking NT-domain</title>
      <link>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942967#M17518</link>
      <description>Hello, &lt;BR /&gt; &lt;BR /&gt;I have an application that has to behave differently at different branches of our company. Someone suggested to check on the NT-domain name to find out where the program is running, but I have no idea how to accomplish this. Does any one have an idea how to do this? Or perhaps there is a better method to check where the program is running? &lt;BR /&gt;I prefer not to check on the presence of specific files at certain locations etc.  &lt;BR /&gt; &lt;BR /&gt;Thanks, &lt;BR /&gt; &lt;BR /&gt;Walter Kramer</description>
      <pubDate>Thu, 15 Mar 2001 01:53:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942967#M17518</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-03-15T01:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: checking NT-domain</title>
      <link>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942968#M17519</link>
      <description>See if the GetComputerName Win32 API routine does what you want.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 15 Mar 2001 02:37:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942968#M17519</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-03-15T02:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: checking NT-domain</title>
      <link>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942969#M17520</link>
      <description>GetComputerName doesn't do exactly what I wanted, but it got me on the right track.  &lt;BR /&gt;I use the following approach:  &lt;BR /&gt;  &lt;BR /&gt;&lt;PRE&gt;  
USE NETAPI32  
USE DFNLS  
character(MAX_COMPUTERNAME_LENGTH+1) DomainName  
integer(2), dimension($MAXPATH) :: UniStr1  
integer(2), dimension($MAXPATH) :: UniStr2  
POINTER        (P,UniStr2)  
!  
! Check if valid domain name  
!  
 DomainName='FLIPFLOP'C  
 iret=MBConvertMBToUnicode(DomainName,UniStr1)  
 if (.NOT.NetGetAnyDCName(0,LOC(UnisStr1),LOC(P))) then  
   iret=MBConvertUnicodeToMB(UNISTR2,DOMAINNAME)  
   iret=NetApiBufferFree(P)  
 endif  
&lt;/PRE&gt;  &lt;BR /&gt;  &lt;BR /&gt;The NETAPI32 module is defined as follows:  &lt;BR /&gt;  &lt;BR /&gt;&lt;PRE&gt;  
!  
!DEC$ IF .NOT. DEFINED (NETAPI32_ )  
!DEC$ DEFINE NETAPI32_    
!  
module netapi32  
use dfwinty  
!DEC$OBJCOMMENT LIB:"NETAPI32.LIB"  
  
interface !lib=netapi32.lib  
integer function  NetGetDCName (servername,domainname,bufptr)   
!DEC$ ATTRIBUTES DEFAULT :: NetGetDCName  
!DEC$ IF DEFINED(_X86_)  
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_NetGetDCName@12' :: NetGetDCName  
!DEC$ ELSE  
!DEC$ ATTRIBUTES STDCALL, ALIAS :  'NetGetDCName'   :: NetGetDCName  
!DEC$ ENDIF  
integer   servername  
integer   domainname  
integer         bufptr  
end function NetGetDCName  
end interface  
  
interface !lib=netapi32.lib  
integer function  NetGetAnyDCName (servername,domainname,bufptr)   
!DEC$ ATTRIBUTES DEFAULT :: NetGetAnyDCName  
!DEC$ IF DEFINED(_X86_)  
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_NetGetAnyDCName@12' :: NetGetAnyDCName  
!DEC$ ELSE  
!DEC$ ATTRIBUTES STDCALL, ALIAS :  'NetGetAnyDCName'   :: NetGetAnyDCName  
!DEC$ ENDIF  
integer   servername  
integer   domainname  
integer         bufptr  
end function NetGetAnyDCName  
end interface  
  
interface !lib=netapi32.lib  
integer function  NetApiBufferFree (Buffer)  
!DEC$ ATTRIBUTES DEFAULT :: NetApiBufferFree  
!DEC$ IF DEFINED(_X86_)  
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_NetApiBufferFree@4' :: NetApiBufferFree  
!DEC$ ELSE  
!DEC$ ATTRIBUTES STDCALL, ALIAS :  'NetApiBufferFree'   :: NetApiBufferFree  
!DEC$ ENDIF  
integer         buffer  
end function NetApiBufferFree  
end interface  
  
end module  
!DEC$ ENDIF ! /* NETAPI32_ */  
&lt;/PRE&gt;  &lt;BR /&gt;  &lt;BR /&gt;Perhaps a bit elaborate, but it works.  &lt;BR /&gt;  &lt;BR /&gt;Walter</description>
      <pubDate>Fri, 16 Mar 2001 21:26:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942969#M17520</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-03-16T21:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: checking NT-domain</title>
      <link>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942970#M17521</link>
      <description>The checking of the NT-domain works, but now there is a new problem. The program won't run on a computer that isn't attached to a network. &lt;BR /&gt;I get the following messages: &lt;BR /&gt; &lt;BR /&gt;"The file fluppy is linked to missing output NETAPI32.DLL: NetApiBufferFree" &lt;BR /&gt; &lt;BR /&gt;and &lt;BR /&gt; &lt;BR /&gt;"Could not execute: A device attached to the system doesn't work (Win32 error 31)" &lt;BR /&gt; &lt;BR /&gt;(I translated from Dutch, so the exact text might be a bit different in English) &lt;BR /&gt; &lt;BR /&gt; I was hoping  (although deep down I know better) that I could cope with one version of the program. &lt;BR /&gt; &lt;BR /&gt;Is there a way to solve this, or do I have to create different versions of the program through conditional compilation? &lt;BR /&gt; &lt;BR /&gt;Walter</description>
      <pubDate>Tue, 20 Mar 2001 05:37:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942970#M17521</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-03-20T05:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: checking NT-domain</title>
      <link>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942971#M17522</link>
      <description>The documentation for NetGetAnyDCName is a bit terse, but from reading it a bit, it doesn't seem unusual to get an error on a non-networked PC, especially given a non-nulll domainname - although I don't know much about the Dutch translation of the errors you got. ;)  One note you probably already know, the function isn't supported on Win9x. &lt;BR /&gt; &lt;BR /&gt;If it were me, I'd look at &lt;A href="http://msdn.microsoft.com/library/psdk/network/ntlmapi2_07zj.htm" target="_blank"&gt;NetWkstaUserGetInfo&lt;/A&gt; with level equal to 1 - using the &lt;A href="http://msdn.microsoft.com/library/psdk/network/ntlmapi3_0l82.htm" target="_blank"&gt;WKSTA_USER_INFO_1&lt;/A&gt; struct.  For broadest coverage, including server threads running under impersonation (and a link to a Win9x solution) check MS KB article &lt;A href="http://support.microsoft.com/support/kb/articles/Q111/5/44.ASP" target="_blank"&gt;Q111544&lt;/A&gt;. &lt;BR /&gt; &lt;BR /&gt;Good luck, &lt;BR /&gt;John</description>
      <pubDate>Wed, 21 Mar 2001 00:16:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942971#M17522</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-03-21T00:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: checking NT-domain</title>
      <link>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942972#M17523</link>
      <description>I am afraid NetWkstaUserGetInfo gives exactly the same error messages. It seems that all netapi32.dll routines generate an error on a non-networked PC. &lt;BR /&gt; &lt;BR /&gt;Thanks for the input,  &lt;BR /&gt; &lt;BR /&gt;Walter</description>
      <pubDate>Wed, 21 Mar 2001 05:45:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942972#M17523</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-03-21T05:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: checking NT-domain</title>
      <link>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942973#M17524</link>
      <description>Are you sure that the non-networked PC isn't a Win95 machine?  The error messages appear as though netapi32.dll isn't there.  But I'm fairly sure that netapi32.dll is installed on NT4 even if networking is not installed at system installation. &lt;BR /&gt; &lt;BR /&gt;The translated error messages also make me think that this may be the case. &lt;BR /&gt; &lt;BR /&gt;The &lt;FILENAME&gt;.EXE file is linked to missing export NETAPI32.DLL:NetApiBufferFree &lt;BR /&gt;A device attached to the system is not functioning (Win32 error 31) &lt;BR /&gt; &lt;BR /&gt;For example, see MS KB article &lt;A href="http://support.microsoft.com/support/kb/articles/Q134/5/90.asp" target="_blank"&gt;Q134590&lt;/A&gt;.   &lt;BR /&gt; &lt;BR /&gt;If it is a Win9x machine, then the prior posted article (&lt;A href="http://support.microsoft.com/support/kb/articles/Q111/5/44.ASP" target="_blank"&gt;Q111544&lt;/A&gt; with the link to &lt;A href="http://support.microsoft.com/support/kb/articles/Q155/6/98.ASP" target="_blank"&gt;Q155698&lt;/A&gt;) most likely contains the only general solution. &lt;BR /&gt; &lt;BR /&gt;Other than that, I'm out of suggestions.   &lt;BR /&gt; &lt;BR /&gt;-John&lt;/FILENAME&gt;</description>
      <pubDate>Wed, 21 Mar 2001 10:19:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/checking-NT-domain/m-p/942973#M17524</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-03-21T10:19:43Z</dc:date>
    </item>
  </channel>
</rss>

