Error using CreateProxyArpEntry

Hello

I am trying to create a proxy ARP entry using CreateProxyArpEntry() call.
Though the parameters seem to be correct, it is always returning error
code ERROR_INVALID_PARAMETER. Pls help me out !!!

I am using Win 2000 SP4. Following is the code :

#include “pcap.h”
#include “IPHlpApi.h”
#include <winsock.h>
#include <stdio.h>

void main(int argc, char argv)
{
IP_ADAPTER_INFO AdapterInfo;
ULONG buffLen;

IPAddr ipAddr;
ULONG pulMac[2];

char szMac[20]={0};
PBYTE pbHexMac = (PBYTE) pulMac;

DWORD address=0,mask=0,j;

char str[1000]={0};
ULONG index=0;

buffLen=sizeof(AdapterInfo);

GetAdaptersInfo(&AdapterInfo,&buffLen);

ipAddr = inet_addr(“172.16.77.152”);
mask = inet_addr(“255.255.255.0”);

//j=CreateProxyArpEntry(ipAddr,mask,AdapterInfo.Index);
j=CreateProxyArpEntry(ipAddr,mask,10);
if(!j)
{
printf(“\nSuccess\n”);
}
else
{
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
j,
LANG_NEUTRAL,
(LPTSTR)&str,
1000,
NULL);
printf(“\nFailure : %s\n”,str);
}

}

********************* HSS-Unclassified *********************** </stdio.h></winsock.h>