Ahojte, po deklaracii premennych dostavam chyby pri preklade. Vedeli by ste niekto pomoct co s tym?
stat.c
#include <ntddk.h>
#include <ndis.h>
#include "stat.h"
VOID DriverUnload(IN PDRIVER_OBJECT driverObject){
UNREFERENCED_PARAMETER(driverObject);
}
NTSTATUS DriverEntry( IN PDRIVER_OBJECT driverObject,
IN PUNICODE_STRING registryPath)
{
NTSTATUS status = STATUS_SUCCESS;
PNDF__ETH_HEADER pEthHeader;
PNDF_IPV4_HEADER pIPv4Header;
ULONG DataOffset = 0;
if (driverObject != NULL)
driverObject->DriverUnload = DriverUnload;
return status;
}
stat.h
#ifndef STAT_H_
#define STAT_H_
#define ETHERTYPE_IP 0x0800
typedef struct _NDF_ETH_HEADER
{
UCHAR dmac[6];
UCHAR smac[6];
USHORT type;
} NDF_ETH_HEADER, *PNDF_ETH_HEADER;
C_ASSERT( sizeof( NDF_ETH_HEADER) == 14 );
typedef struct _NDF_IPV4_HEADER
{
UCHAR ver_ihl; // Version (4 bits) + Internet header length (4 bits)
UCHAR tos; // Type of service
USHORT length; // Total length
USHORT id; // Identification
USHORT flags_fo; // Flags (3 bits) + Fragment offset (13 bits)
UCHAR ttl; // Time to live
UCHAR protocol; // Protocol
USHORT checksum; // Header checksum
UCHAR saddr[4]; // Source address
UCHAR daddr[4]; // Destination address
} NDF_IPV4_HEADER, *PNDF_IPV4_HEADER;
C_ASSERT( sizeof( NDF_IPV4_HEADER)== 20 );
#endif // _STAT_H_
SOURCES
TARGETNAME=stat
TARGETPATH=obj
TARGETTYPE=DRIVER
SOURCES= stat.c
INCLUDES=.
TARGETLIBS=\
$(DDK_LIB_PATH)\ntoskrnl.lib \
$(DDK_LIB_PATH)\ndis.lib \
$(DDK_LIB_PATH)\fwpkclnt.lib \
$(SDK_LIB_PATH)\uuid.lib
C_DEFINES=$(C_DEFINES) -DBINARY_COMPATIBLE=0 -DNT -DUNICODE -D_UNICODE -DNDIS60 -DNDIS_SUPPORT_NDIS6
.c(16) : error C2065: 'PNDF__ETH_HEADER' : undeclared identifier
.c(16) : error C2146: syntax error : missing ';' before identifier 'pEthHeader'
.c(16) : error C2065: 'pEthHeader' : undeclared identifier
.c(17) : error C2275: 'PNDF_IPV4_HEADER' : illegal use of this type as an expression
.c(17) : error C2146: syntax error : missing ';' before identifier 'pIPv4Header'
.c(17) : error C2065: 'pIPv4Header' : undeclared identifier
.c(18) : error C2275: 'ULONG' : illegal use of this type as an expression
.c(18) : error C2146: syntax error : missing ';' before identifier 'DataOffset'
.c(18) : error C2065: 'DataOffset' : undeclared identifier
Diki za rady