Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

DhcpGetClientInfo and Error 1783 in Vista

microsoft.public.windows.vista.networking sharing






Speedup My PC
Reply
  #1 (permalink)  
Old 09-02-2008
VladZ
 

Posts: n/a
DhcpGetClientInfo and Error 1783 in Vista
Hello,

Sample Code below always returns error code 1783 in Vista (SP1) but works
fine in Windows XP (SP3). Is it bug or my mistake?

I'm use:

1) Windows Software Development Kit (SDK) for Windows Server 2008 and .NET
Framework 3.5
2) VS2005 (SP1)

-------------------------------------

Code Snippet....
#include <windows.h>
#include <dhcpsapi.h>

#pragma comment(lib, "Dhcpsapi.lib")

....

DWORD GetClientInfoByMAC(LPCTSTR pszDhcpServerIP, BYTE* pMac, DWORD
nMacLength, DHCP_CLIENT_INFO** ppInfo)
{
DHCP_SEARCH_INFO query;
query.SearchType = DhcpClientHardwareAddress;
query.SearchInfo.ClientHardwareAddress.DataLength = nMacLength;
query.SearchInfo.ClientHardwareAddress.Data = pMac;
return DhcpGetClientInfo(pszDhcpServerIP, &query, ppInfo);
}

....

BYTE Mac[11] = {0};
//Subnet address in host order. (192.168.1.0)
Mac[0] = 0;
Mac[1] = 1;
Mac[2] = 168;
Mac[3] = 192;
//Hardware address type, this is the default value.
Mac[4] = 0x01;
//My MAC bytes start from here (00:15:60:b0:2d:da)
Mac[5] = 0x00;
Mac[6] = 0x15;
Mac[7] = 0x60;
Mac[8] = 0xb0;
Mac[9] = 0x2d;
Mac[10] =0xda;

DHCP_CLIENT_INFO* pCI_MAC = {0};
DWORD nError = GetClientInfoByMAC(_T("192.168.1.10"), Mac, sizeof(Mac),
&pCI_MAC);
if(nError == ERROR_SUCCESS)
{
//IT WORKS!!!
...
}
else
{
//ERROR!!!
...
}

----------------------
Thanks,
Vlad

Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-02-2008
Jack \(MVP-Networking\).
 

Posts: n/a
Re: DhcpGetClientInfo and Error 1783 in Vista
Hi
Maybe this can Help, http://support.microsoft.com/kb/928233
Jack (MS, MVP-Networking)

"VladZ" <VladZ@discussions.microsoft.com> wrote in message
news:B8CE3DB3-254D-4532-B3AE-B3ACA2D24E96@microsoft.com...
> Hello,
>
> Sample Code below always returns error code 1783 in Vista (SP1) but works
> fine in Windows XP (SP3). Is it bug or my mistake?
>
> I'm use:
>
> 1) Windows Software Development Kit (SDK) for Windows Server 2008 and .NET
> Framework 3.5
> 2) VS2005 (SP1)
>
> -------------------------------------
>
> Code Snippet....
> #include <windows.h>
> #include <dhcpsapi.h>
>
> #pragma comment(lib, "Dhcpsapi.lib")
>
> ...
>
> DWORD GetClientInfoByMAC(LPCTSTR pszDhcpServerIP, BYTE* pMac, DWORD
> nMacLength, DHCP_CLIENT_INFO** ppInfo)
> {
> DHCP_SEARCH_INFO query;
> query.SearchType = DhcpClientHardwareAddress;
> query.SearchInfo.ClientHardwareAddress.DataLength = nMacLength;
> query.SearchInfo.ClientHardwareAddress.Data = pMac;
> return DhcpGetClientInfo(pszDhcpServerIP, &query, ppInfo);
> }
>
> ...
>
> BYTE Mac[11] = {0};
> //Subnet address in host order. (192.168.1.0)
> Mac[0] = 0;
> Mac[1] = 1;
> Mac[2] = 168;
> Mac[3] = 192;
> //Hardware address type, this is the default value.
> Mac[4] = 0x01;
> //My MAC bytes start from here (00:15:60:b0:2d:da)
> Mac[5] = 0x00;
> Mac[6] = 0x15;
> Mac[7] = 0x60;
> Mac[8] = 0xb0;
> Mac[9] = 0x2d;
> Mac[10] =0xda;
>
> DHCP_CLIENT_INFO* pCI_MAC = {0};
> DWORD nError = GetClientInfoByMAC(_T("192.168.1.10"), Mac, sizeof(Mac),
> &pCI_MAC);
> if(nError == ERROR_SUCCESS)
> {
> //IT WORKS!!!
> ...
> }
> else
> {
> //ERROR!!!
> ...
> }
>
> ----------------------
> Thanks,
> Vlad
>


Reply With Quote
  #3 (permalink)  
Old 09-02-2008
VladZ
 

Posts: n/a
Re: DhcpGetClientInfo and Error 1783 in Vista
My Vista gets IP from DHCP very well. And "The DhcpGetClientInfo function
returns information about a specific DHCP client..." (see DHCP API).
Code sample from my first post for search information about client (not
about my computer!) using its MAC address.

--
Vlad


"Jack (MVP-Networking)." wrote:

> Hi
> Maybe this can Help, http://support.microsoft.com/kb/928233
> Jack (MS, MVP-Networking)
>
> "VladZ" <VladZ@discussions.microsoft.com> wrote in message
> news:B8CE3DB3-254D-4532-B3AE-B3ACA2D24E96@microsoft.com...
> > Hello,
> >
> > Sample Code below always returns error code 1783 in Vista (SP1) but works
> > fine in Windows XP (SP3). Is it bug or my mistake?
> >


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with windows vista mail, Socket Error: 10053, Error Number: 0x800CCC0F ASM microsoft.public.windows.vista.mail 5 02-18-2009 08:23
July 15, 1783: Marquis Invents Steamboat, Misses Esteem Boat Steve General Technology News 0 07-15-2008 05:10
Vista Error: Event ID 412, Task Scheduler - Error Value 2147942402 Gyula Mester microsoft.public.windows.vista.general 1 05-30-2008 03:23
vista x64 RTM + Office 2007 = Error 1310.Error writing to file c:\ =?Utf-8?B?cGxhbmV0ZjE=?= microsoft.public.windows.vista.general 3 03-24-2007 11:53




All times are GMT +1. The time now is 04:47.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120