locked
Setting the IP Address of a Windows machine from Kernel mode RRS feed

  • 問題

  • Hi,

    I am a windows device driver developer. I have a requirement which basically requires me to set the IP address of a machine from the kernel mode. Are there any API's available to do the same. I didnt find any documented API's in the WDK. Also the solution I am writing is a boot time solution. So I need to set the IP address from a windows kenerl mode driver at BOOT start. I tried using the undocumented windows API 'SetAdapterIPAddress' but it doesnt work in kernel mode. Please suggest any other way of doing this.

    Thanks In advance,
    Imtiaz
    2009年1月13日 15:01

解答

  •  Imtiaz Pathan wrote:
    Hi,

    I am a windows device driver developer. I have a requirement which basically requires me to set the IP address of a machine from the kernel mode. Are there any API's available to do the same. I didnt find any documented API's in the WDK. Also the solution I am writing is a boot time solution. So I need to set the IP address from a windows kenerl mode driver at BOOT start. I tried using the undocumented windows API 'SetAdapterIPAddress' but it doesnt work in kernel mode. Please suggest any other way of doing this.

    Thanks In advance,
    Imtiaz

     

    I am afraid the TCP/IP stack is not loaded at kernel mode start up, so that your proposal looks quite likely to have no solution... (under my limited knowledge.)  How about setting drive load dependency such that your drive loads after TCP/IP stack so that IP setting is made feasible by other easy function call?

    2009年1月14日 4:00
  • In Windows Vista and Windows Server 2008, there is a Kernel Mode IP Helpers API,

    http://msdn.microsoft.com/en-us/library/bb756891.aspx

     

    For previous Windows, you may try to use Windows Transport Data interface (TDI) API.

    http://www.pcausa.com/tdisamp/default.htm

     

    2009年1月19日 3:14

所有回覆

  •  Imtiaz Pathan wrote:
    Hi,

    I am a windows device driver developer. I have a requirement which basically requires me to set the IP address of a machine from the kernel mode. Are there any API's available to do the same. I didnt find any documented API's in the WDK. Also the solution I am writing is a boot time solution. So I need to set the IP address from a windows kenerl mode driver at BOOT start. I tried using the undocumented windows API 'SetAdapterIPAddress' but it doesnt work in kernel mode. Please suggest any other way of doing this.

    Thanks In advance,
    Imtiaz

     

    I am afraid the TCP/IP stack is not loaded at kernel mode start up, so that your proposal looks quite likely to have no solution... (under my limited knowledge.)  How about setting drive load dependency such that your drive loads after TCP/IP stack so that IP setting is made feasible by other easy function call?

    2009年1月14日 4:00
  • Hi Lawrence,

    I have the TCP stack up at BOOT TIME. The only thing that is stopping me from transmitting is that my machine doesnt have an IP address. Just need a way to set the IP address on the machine. Static IP will also do fine. Are there any undocumented API's available to do so from KERNEL mode ???
    2009年1月14日 7:05
  • In Windows Vista and Windows Server 2008, there is a Kernel Mode IP Helpers API,

    http://msdn.microsoft.com/en-us/library/bb756891.aspx

     

    For previous Windows, you may try to use Windows Transport Data interface (TDI) API.

    http://www.pcausa.com/tdisamp/default.htm

     

    2009年1月19日 3:14