Gathering information about a workstation
Posted
by Christian Amarie
on June 8th, 1999
Some times you need information about a workstation, for example if you want to know if a workstation is not running WindowsNT and you try some NT-specific job without any chance. I think this pseudo-routine can be helpful.
#include <what_you_need.h>
/*Usually:
#include <lmcons.h>
#include <lmwksta.h>
#include <lmserver.h>
#include <lmerr.h>*/
// Network API job - obtain network info about selected machine.
BOOL
_GetWkstaInformation100()
{
LPBYTE lpBuf;
LPCSTR lpcstrWkstaName = (LPCSTR)m_strWkstaName;
int iwLength = 2 * (MAX_COMPUTERNAME_LENGTH + 1);
WCHAR lpwWkstaName[2 * (MAX_COMPUTERNAME_LENGTH + 1)];
lpwWkstaName[0] = '\0';
MultiByteToWideChar(CP_ACP, 0, lpcstrWkstaName, -1, lpwWkstaName, iwLength);
typedef NET_API_STATUS (NET_API_FUNCTION *NETWKPROC)(LPWSTR, DWORD, LPBYTE *);
NETWKPROC _procNetWkstaGetInfo = (NETWKPROC)
(GetProcAddress(theApp.m_hNetDLL, _T("NetWkstaGetInfo")));
if(_procNetWkstaGetInfo)
{
NET_API_STATUS nasRetVal = (*_procNetWkstaGetInfo)(lpwWkstaName, 100, (LPBYTE*)&lpBuf);
if(nasRetVal == NERR_Success)
{
WKSTA_INFO_100 *pWkstaInfo = (WKSTA_INFO_100 *)lpBuf;
DWORD dwPlatformId = pWkstaInfo->wki100_platform_id;
if(dwPlatformId != PLATFORM_ID_NT)
{
//[ERROR]Not a Windows NT Workstation - if useful.
return FALSE;
}
else
return TRUE;
}
else
{
//[ERROR] System error. Call GetLastError, FormatMessage, etc.
return FALSE;
}
}
else
{
//[ERROR]Unable to find procedure NetWkstaGetInfo in netapi32.dll.
return FALSE;
}
}

Comments
Jordan shoes mentioned Gene to buy the brand, a margin of Nike
Posted by TaddyGaffic on 04/24/2013 01:30pmWhere did that get us? A bunch of banks writing loans that they didnt care if poeple would be able to pay for because they were conforming [url=http://markwarren.org.uk/goodbuy.cfm]nike free uk[/url] loans and Fannie and Freddie would back them. And their $150+ billion losses show that they are just as unable to predict or control the market as the rest of us. It won't work because it doesn't reward investors for taking the risks involved. In order to set a good example of following your dreams, you may wish to consider strictly limiting, or eliminating TV from your life. When people are involved in pursuing their dreams they often find that they do not have the time to watch TV. TV just gets in the way of pursuing other dreams.. Take a limousine ride with Aerosmith on one of the fastest rollercoaster you have to face. Live shows throughout the day from Beauty and the Beast [url=http://markwarren.org.uk/property-waet.cfm]nike air max 90[/url] will bring memories flooding back for young and old. You can get closer to the action and feel that he wanted to be in the spotlight. Other technology advancements are the midsole. It has a compression molded EVA for lasting impact protection. A Vibrakill shock-absorber in the heel provides a lot of [url=http://northernroofing.co.uk/roofins.cfm]nike free run[/url] comfort, and the Exact Pro technology combines a pebax plate and a Dynamic camflex in the forefoot for improved energy return on every step. Meindl Borneo Lady Pro - This shoe is just one of my wifes most popular hiking boots. It is appropriate for lengthy outdoor hikes and you can actually do a tiny stretch of hill hiking whilst sporting them. This product also includes memory foam
ReplyLightweight smart â Nike Unshackled TR Befit in spring 2013 3 series
Posted by Tufffruntee on 04/22/2013 06:58amNike Free TR Trim 3 unmistakable features is to exploit the brand-new scheme: Nike Let off 5 soles improved bending Groove; new tractor pattern making training more focused when; lighter preponderance, the permeability is stronger, and more smart shoe designs not only aim for shoes [url=http://markwarren.org.uk/goodbuy.cfm]nike free run[/url] more pleasant wearing, barefoot training feel, but also more in vogue appearance. Nike Relieve TR Fit 3 provides excellent lateral solidity, you can take the legs in the untenable during training. Strong vamp upper breathable mesh, lower soap up's one of a kind lay out can be [url=http://fossilsdirect.co.uk/glossarey.cfm]nike huarache[/url] seen from stem to stern it. Lightweight, demanding, pinched soap up means familiar through entirely only one seams, more flexible, forward is stronger. Need more mainstay, role of a training exercise, froth close in more parts of the need championing give, bubbles loose. Say two-ply tongue moisture wicking synthetic materials, tiresome on your feet, help maintain feet desiccated and comfortable. Phylite [url=http://fossilsdirect.co.uk/glossarey.cfm]nike huarache free[/url] midsole offers lightweight revolt unceasing, outstanding durability and sedate outsole can do to greatly reduce the comprehensive weight of the shoe. Qianzhang pods on the outsole and heel-shaped Grassland rubber enhances the shoe multi-directional drag on different surfaces.
ReplyPlease help with Error 53
Posted by Legacy on 12/25/2002 12:00amOriginally posted by: Maddi
Hi all,
I always get Error 53 back from the Funktions NetWkstaGetInfo or NetServerGetInfo, can somebody give me a hint how to fix that ? I don't know what the Error means (Network Path not found ? But the Path should be correct).
Do I have to initialise something before this ?
Thx,
ReplyMaddi
help in VC project
Posted by Legacy on 10/13/2002 12:00amOriginally posted by: bhushan
i have to make a project in vc++ which will allow a user access to all desktops on the LAN.
Replyi want to know how to go abt it,spclly whch feature to use and reference matrial if avalble
How to find a file from a networked workstation or server?
Posted by Legacy on 06/13/2002 12:00amOriginally posted by: Ken
Very interesting piece of codes, I want to know "How to find a file from a networked workstation or server?"
Replywindows nt administration
Posted by Legacy on 09/25/2000 12:00amOriginally posted by: vikas kumar sharma
there is lot of things that can be done with network api's. we can find out the hardware details of a particular wkstn and the users that use them. info about the users in the n/w can also be found out programatically check the samples in msdn.
ReplyUser have to be an Administrator or print or....
Posted by Legacy on 12/15/1999 12:00amOriginally posted by: Igor Proskuriakov
Just one comment about this utility: you must have Print or Server operator privilege, or be a member of the Administrator or Account local groups to successfully execute the NetWkstaGetInfo function.
Regards,
Igor
Replydoubt
Posted by Legacy on 09/16/1999 12:00amOriginally posted by: s.p.manoj
hello sir,
Is there any any to obtain info of a workstation
from another workstation.if so pls send me some details
through mail.I am doing a project for obtaining info
of a local system.It's all most over.I want to add this capablity to.
Reply