Jump to content

gauravkr

Member
  • Posts

    12
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    India

About gauravkr

gauravkr's Achievements

0

Reputation

  1. Does anybody have any suggesttions? Any pointers on this is greatly appreciated. Thanks, ~GK
  2. Hi, I am trying to programmatically set static IPs in a multi NIC multi IP setup (using C++) - 64bit Win2008 Standard Core installation. I am deploying WMI to do the same. However, the behaviour of enableStatic() is un-deterministic. I see that it successfully sets the IPs at times and fails to do the same in few other retry attempts; it fails with error 0x8004A024 = NETCFG_E_NO_WRITE_LOCK, which means some other application is holding the lock on the nic. I got to know of this as a known issue as listed in the KB article: KB950134. As suggested here I tried installing the hotfixes; but the only effect was frequency of this error coming up has reduced, but it is still erroring out. I also tried patching it to SP2 (note that this hotfix has gone into SP2), but even that did not help and am again getting the enableStatic failure with 0x8004A024. I even tried using INetCfg to find the status of Write lock when enableStatic() has failed using WMI and then releasing it, but this doesnt work either (I used INetCfgLock::IsWriteLocked() and then INetCfgLock::ReleaseWriteLock() but this does not seem to work. It is returning success but not able to release the lock). Does anyone have any suggestions on how to get over it? Is there any other way to handle the NETCFG_E_NO_WRITE_LOCK error caused by enableStatic? Any suggestions and pointers will be greatly appreciated. Thanks, ~GK
  3. Hi cluberti, Thanks for your response. So, do you mean we cant differentiate between Vista and Server2K8 wim except for looking into the description field. Will the version info in the xml output (namely, major/minor/build/spbuild or other fields) not help to resolve this. Also, I need to get the exact service pack for the OS in this wim image. As from your earlier post, ARCH=9 or ARCH=0 will help differentiate x64 from x86 images. Similarly, i need to get/resolve the type of OS and the service pack from the "imagex /info <wim_file>" output. My requirement is to get these info from the wim image before starting the installation. Also, a brief detailing on what the following attributes mean will be helpful: VERSION=major,minor,build,spbuild. Any pointers in this regard will be a great help. Thanks, ~Gaurav
  4. Thanks for that info IcemanND. I print the info of the wim file and the OS related info says: <VERSION> <MAJOR>6</MAJOR> <MINOR>0</MINOR> <BUILD>6000</BUILD> <SPBUILD>16386</SPBUILD> </VERSION> major version=6 and minor=0 implies this is Win2K8 or vista image, as from http://msdn.microsoft.com/en-us/library/ms724833(VS.85).aspx I have few questions on this: 1. how do we distinguish if this is a Win2K8 image or a Vista image now. 2. if version 6.0 comes from the major and minor versions what does the "build=6000" attribute imply? 3. what is the SP version installed in this image? Does "SPBUILD=16386" mean its a plain OS with no SPs installed, then what are the other codes/version nos. for other SPs? if not what does SPBUILD attribute say and how do I get the SP installed in this? Thanks again for your help. ~Gaurav
  5. Hi, Is there a way to get the version of OS and ServicePack in a CD/DVD image of vista? I have a DVD image of base Windows Vista and another DVD image of vista-slipstreamed-with-SP1 (say) ... or similar images for win2K8 and win2K8-with-SP1. Is there a command or some win API to get the Vista version ready to be installed. What I am looking for is an equivalent of "winver" command which I can run on an offline OS image (with or without SP installed). (Note: we can run "winver" command on a live system to get the version of OS (vista/2K8 or others) and the level of SP installed) Thanks and Regards, Gaurav
  6. Hi all, Thanks for the suggestions. I implemented this using WMI APIs. However, I am facing issues in the following scenario: 1. I set a static IP using enableStatic() 2. I run enableStatic() for another IP and the new IP gets added to the old one. 3. I run enableDHCP() and it enables DHCP (though the static IPs are still seen if I do ipconfig) 4. I tried ReleaseDHCPLease() and RenewDHCPLease() attempting to release the static IPs and get a DHCP ip. Though this doesnt happen. My Doubts: - In step (2) above, is there a way to replace the already set IP with the new one? Using EnableStatic() it adds to the existing static IP. - In step (3), DHCP is enabled but the IPs shown with ipconfig are still the static IPs. Is there a way to get a DHCP ip and get rid of all the static ones? - not using netsh but using WMIs or other windows APIs. - What effect does step (4) have? It didnt do anything! I expected it to release all the IPs and get a new DHCP one. Kindly comment! Thanks, Gaurav
  7. as I understand WMI again is scripting .. My requirement is to avoid that as well .. thanks anyways! any other suggestions? ~gk
  8. Thanks for the pormpt response. As I said in my original post I want to use some pure win API for this and not use netsh.
  9. Sorry for posting to the wrong forum ... reposted it in Windows Pe forum. Cant find an option to delete the post so sending this reply... Please ignore this and rather reply to the same thread on "Windows PE" forum
  10. Hi, We are moving from WinPe1.6 to WinPe2.0. The problem comes when setting up networking. The network setup is now done using "wpeutil.exe InitializeNetwork" as against "factory.exe -winpe" for Winpe1.6. This brings up the network and assigns a dhcp ip to the card. Now I require to reset this n/w interface and set static IPs onto it. This was achieved by setting the static IP into the (temporary winpe) registry and then calling dhcpNotifyConfigChange() (an undocumented win API) - This updates the in-memory IP table with the IP in the registry without requiring a reboot. This API, however, doesnt work for Winpe2.0 anymore. Does anybody know of any alternative windows API which can serve the purpose? I know netsh command is an alternative but I want some other means to achieve the goal. Following are the challenges: 1. initial DHCP ip which is set when running wpeutil.exe; how do I change that to a static IP? 2. once its ready to take up static IPs how do I set the desired IP? 3. what if I need another set of IPs to be set for the same NIC - This I think can be achieved by calling AddIpAddress() win API 4. If I have added a static IP to the NIC how do I remove that (note that this is the IP *NOT* set using AddIpAddress()) Please note that what I am concerned about is setting the IPs temporarily and it doesnt matter if these are lost after reboot. Thanks in advance! ~gk
  11. Hi, We are moving from WinPe1.6 to WinPe2.0. The problem comes when setting up networking. The network setup is now done using "wpeutil.exe InitializeNetwork" as against "factory.exe -winpe" for Winpe1.6. This brings up the network and assigns a dhcp ip to the card. Now I require to reset this n/w interface and set static IPs onto it. This was achieved by setting the static IP into the (temporary winpe) registry and then calling dhcpNotifyConfigChange() (an undocumented win API) - This updates the in-memory IP table with the IP in the registry without requiring a reboot. This API, however, doesnt work for Winpe2.0 anymore. Does anybody know of any alternative windows API which can serve the purpose? I know netsh command is an alternative but I want some other means to achieve the goal. Following are the challenges: 1. initial DHCP ip which is set when running wpeutil.exe; how do I change that to a static IP? 2. once its ready to take up static IPs how do I set the desired IP? 3. what if I need another set of IPs to be set for the same NIC - This I think can be achieved by calling AddIpAddress() win API 4. If I have added a static IP to the NIC how do I remove that (note that this is the IP *NOT* set using AddIpAddress()) Please note that what I am concerned about is setting the IPs temporarily and it doesnt matter if these are lost after reboot. Thanks in advance! ~gk
×
×
  • Create New...