diff --git a/winpcap_oem/.gitignore b/winpcap_oem/.gitignore new file mode 100644 index 00000000..40caffa8 --- /dev/null +++ b/winpcap_oem/.gitignore @@ -0,0 +1,28 @@ +# CVS default ignores begin +tags +TAGS +.make.state +.nse_depinfo +*~ +#* +.#* +,* +_$* +*$ +*.old +*.bak +*.BAK +*.orig +*.rej +.del-* +*.a +*.olb +*.o +*.obj +*.so +*.exe +*.Z +*.elc +*.ln +core +# CVS default ignores end diff --git a/winpcap_oem/Examples-pcap.diff b/winpcap_oem/Examples-pcap.diff new file mode 100644 index 00000000..53d366d8 --- /dev/null +++ b/winpcap_oem/Examples-pcap.diff @@ -0,0 +1,255 @@ +diff -urb ..\WinPcap\Examples-pcap/UDPdump/udpdump.c .\Examples-pcap/UDPdump/udpdump.c +--- ..\WinPcap\Examples-pcap/UDPdump/udpdump.c 2008-12-23 02:54:49.000000000 -0800 ++++ .\Examples-pcap/UDPdump/udpdump.c 2009-07-14 16:51:15.796875000 -0700 +@@ -39,6 +39,8 @@ + #define _CRT_SECURE_NO_WARNINGS + #endif + ++#define WPCAP //this is needed to use pcap_start_oem ++ + #include "pcap.h" + + /* 4 bytes IP address */ +@@ -91,6 +93,13 @@ + char packet_filter[] = "ip and udp"; + struct bpf_program fcode; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Retrieve the device list */ + if(pcap_findalldevs(&alldevs, errbuf) == -1) + { +diff -urb ..\WinPcap\Examples-pcap/basic_dump/basic_dump.c .\Examples-pcap/basic_dump/basic_dump.c +--- ..\WinPcap\Examples-pcap/basic_dump/basic_dump.c 2008-12-23 02:54:48.000000000 -0800 ++++ .\Examples-pcap/basic_dump/basic_dump.c 2009-07-14 16:48:44.203125000 -0700 +@@ -6,6 +6,8 @@ + #define _CRT_SECURE_NO_WARNINGS + #endif + ++#define WPCAP //this is needed to use pcap_start_oem ++ + #include "pcap.h" + + /* prototype of the packet handler */ +@@ -20,6 +22,13 @@ + pcap_t *adhandle; + char errbuf[PCAP_ERRBUF_SIZE]; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Retrieve the device list */ + if(pcap_findalldevs(&alldevs, errbuf) == -1) + { +diff -urb ..\WinPcap\Examples-pcap/basic_dump_ex/basic_dump_ex.c .\Examples-pcap/basic_dump_ex/basic_dump_ex.c +--- ..\WinPcap\Examples-pcap/basic_dump_ex/basic_dump_ex.c 2008-12-23 02:54:48.000000000 -0800 ++++ .\Examples-pcap/basic_dump_ex/basic_dump_ex.c 2009-07-14 16:49:28.671875000 -0700 +@@ -6,6 +6,8 @@ + #define _CRT_SECURE_NO_WARNINGS + #endif + ++#define WPCAP //this is needed to use pcap_start_oem ++ + #include "pcap.h" + + int main() +@@ -23,6 +25,12 @@ + const u_char *pkt_data; + time_t local_tv_sec; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } + + /* Retrieve the device list */ + if(pcap_findalldevs(&alldevs, errbuf) == -1) +diff -urb ..\WinPcap\Examples-pcap/iflist/iflist.c .\Examples-pcap/iflist/iflist.c +--- ..\WinPcap\Examples-pcap/iflist/iflist.c 2008-12-23 02:54:48.000000000 -0800 ++++ .\Examples-pcap/iflist/iflist.c 2009-07-14 16:49:28.625000000 -0700 +@@ -39,6 +39,8 @@ + #define _CRT_SECURE_NO_WARNINGS + #endif + ++#define WPCAP //this is needed to use pcap_start_oem ++ + #include "pcap.h" + + #ifndef WIN32 +@@ -61,6 +63,13 @@ + pcap_if_t *d; + char errbuf[PCAP_ERRBUF_SIZE+1]; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Retrieve the device list */ + if(pcap_findalldevs(&alldevs, errbuf) == -1) + { +diff -urb ..\WinPcap\Examples-pcap/pcap_filter/pcap_filter.c .\Examples-pcap/pcap_filter/pcap_filter.c +--- ..\WinPcap\Examples-pcap/pcap_filter/pcap_filter.c 2006-02-22 09:28:33.000000000 -0800 ++++ .\Examples-pcap/pcap_filter/pcap_filter.c 2009-07-14 16:49:28.593750000 -0700 +@@ -35,6 +35,8 @@ + #include + #include + ++#define WPCAP //this is needed to use pcap_start_oem ++ + #include + + #define MAX_PRINT 80 +@@ -90,6 +92,13 @@ + } + } + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + // open a capture from the network + if (source != NULL) + { +diff -urb ..\WinPcap\Examples-pcap/pktdump_ex/pktdump_ex.c .\Examples-pcap/pktdump_ex/pktdump_ex.c +--- ..\WinPcap\Examples-pcap/pktdump_ex/pktdump_ex.c 2008-12-23 02:54:49.000000000 -0800 ++++ .\Examples-pcap/pktdump_ex/pktdump_ex.c 2009-07-14 16:50:29.265625000 -0700 +@@ -42,6 +42,8 @@ + #include + #include + ++#define WPCAP //this is needed to use pcap_start_oem ++ + #include + + #define LINE_LEN 16 +@@ -63,6 +65,13 @@ + " pktdump_ex -s file.acp\n" + " pktdump_ex -s \\Device\\NPF_{C8736017-F3C3-4373-94AC-9A34B7DAD998}\n\n"); + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + if(argc < 3) + { + printf("\nNo adapter selected: printing the device list:\n"); +diff -urb ..\WinPcap\Examples-pcap/readfile/readfile.c .\Examples-pcap/readfile/readfile.c +--- ..\WinPcap\Examples-pcap/readfile/readfile.c 2008-12-23 02:54:49.000000000 -0800 ++++ .\Examples-pcap/readfile/readfile.c 2009-07-14 16:48:44.187500000 -0700 +@@ -1,4 +1,5 @@ + #include ++#define WPCAP //this is needed to use pcap_start_oem + #include + + #define LINE_LEN 16 +@@ -17,6 +18,13 @@ + + } + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Open the capture file */ + if ((fp = pcap_open_offline(argv[1], // name of the device + errbuf // error buffer +diff -urb ..\WinPcap\Examples-pcap/readfile_ex/readfile_ex.c .\Examples-pcap/readfile_ex/readfile_ex.c +--- ..\WinPcap\Examples-pcap/readfile_ex/readfile_ex.c 2005-07-20 16:02:59.000000000 -0700 ++++ .\Examples-pcap/readfile_ex/readfile_ex.c 2009-07-14 16:50:47.281250000 -0700 +@@ -1,4 +1,7 @@ + #include ++ ++#define WPCAP //this is needed to use pcap_start_oem ++ + #include + + #define LINE_LEN 16 +@@ -19,6 +22,13 @@ + + } + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Open the capture file */ + if ((fp = pcap_open_offline(argv[1], // name of the device + errbuf // error buffer +diff -urb ..\WinPcap\Examples-pcap/savedump/savedump.c .\Examples-pcap/savedump/savedump.c +--- ..\WinPcap\Examples-pcap/savedump/savedump.c 2008-12-23 02:54:49.000000000 -0800 ++++ .\Examples-pcap/savedump/savedump.c 2009-07-14 16:50:56.765625000 -0700 +@@ -6,6 +6,8 @@ + #define _CRT_SECURE_NO_WARNINGS + #endif + ++#define WPCAP //this is needed to use pcap_start_oem ++ + #include "pcap.h" + + /* prototype of the packet handler */ +@@ -29,6 +31,13 @@ + return -1; + } + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Retrieve the device list on the local machine */ + if (pcap_findalldevs(&alldevs, errbuf) == -1) + { +diff -urb ..\WinPcap\Examples-pcap/sendpack/sendpack.c .\Examples-pcap/sendpack/sendpack.c +--- ..\WinPcap\Examples-pcap/sendpack/sendpack.c 2008-12-23 02:54:49.000000000 -0800 ++++ .\Examples-pcap/sendpack/sendpack.c 2009-07-14 16:51:04.453125000 -0700 +@@ -1,6 +1,8 @@ + #include + #include + ++#define WPCAP //this is needed to use pcap_start_oem ++ + #include + + +@@ -18,6 +20,13 @@ + return 1; + } + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Open the adapter */ + if ((fp = pcap_open_live(argv[1], // name of the device + 65536, // portion of the packet to capture. It doesn't matter in this case diff --git a/winpcap_oem/Examples.diff b/winpcap_oem/Examples.diff new file mode 100644 index 00000000..5003693b --- /dev/null +++ b/winpcap_oem/Examples.diff @@ -0,0 +1,270 @@ +diff -urb ..\winpcap\Examples\/PacketDriver/GetMacAddress/GetMacAddress.c .\Examples/PacketDriver/GetMacAddress/GetMacAddress.c +--- ..\winpcap\Examples\/PacketDriver/GetMacAddress/GetMacAddress.c 2008-12-23 02:43:56.000000000 -0800 ++++ .\Examples/PacketDriver/GetMacAddress/GetMacAddress.c 2009-07-14 15:59:25.765625000 -0700 +@@ -50,6 +50,16 @@ + ULONG AdapterLength; + PPACKET_OID_DATA OidData; + BOOLEAN Status; ++ CHAR ErrBuffer[1024]; ++ ++ // ++ // start WinPcap Professional ++ // ++ if(PacketStartOem(ErrBuffer, sizeof(ErrBuffer)) == FALSE) ++ { ++ printf("Cannot start WinPcap Professional: %s\n", ErrBuffer); ++ return -1; ++ } + + // + // Obtain the name of the adapters installed on this machine +diff -urb ..\winpcap\Examples\/PacketDriver/TestPacketCapture/TestPacketCapture.c .\Examples/PacketDriver/TestPacketCapture/TestPacketCapture.c +--- ..\winpcap\Examples\/PacketDriver/TestPacketCapture/TestPacketCapture.c 2008-12-23 02:43:58.000000000 -0800 ++++ .\Examples/PacketDriver/TestPacketCapture/TestPacketCapture.c 2009-07-14 15:59:25.781250000 -0700 +@@ -72,6 +72,17 @@ + + struct bpf_stat stat; + ++ CHAR ErrBuffer[1024]; ++ ++ // ++ // start WinPcap Professional ++ // ++ if(PacketStartOem(ErrBuffer, sizeof(ErrBuffer)) == FALSE) ++ { ++ printf("Cannot start WinPcap Professional: %s\n", ErrBuffer); ++ return -1; ++ } ++ + // + // Obtain the name of the adapters installed on this machine + // +diff -urb ..\winpcap\Examples\/PacketDriver/TestPacketSend/TestPacketSend.c .\Examples/PacketDriver/TestPacketSend/TestPacketSend.c +--- ..\winpcap\Examples\/PacketDriver/TestPacketSend/TestPacketSend.c 2008-12-23 02:43:58.000000000 -0800 ++++ .\Examples/PacketDriver/TestPacketSend/TestPacketSend.c 2009-07-14 15:59:25.781250000 -0700 +@@ -71,6 +71,7 @@ + ULONG AdapterLength; + + float cpu_time; ++CHAR ErrBuffer[1024]; + + printf("Traffic Generator v 0.9999\nCopyright 1999 Loris Degioanni (loris@netgroup-serv.polito.it)"); + printf("\nSends a set of packets to the network using packet.dll API.\n"); +@@ -81,6 +82,14 @@ + return -1; + } + ++ // ++ // start WinPcap Professional ++ // ++ if(PacketStartOem(ErrBuffer, sizeof(ErrBuffer)) == FALSE) ++ { ++ printf("Cannot start WinPcap Professional: %s\n", ErrBuffer); ++ return -1; ++ } + + AdapterName[0]=0; + +diff -urb ..\winpcap\Examples\/UDPdump/udpdump.c .\Examples/UDPdump/udpdump.c +--- ..\winpcap\Examples\/UDPdump/udpdump.c 2008-12-23 02:43:58.000000000 -0800 ++++ .\Examples/UDPdump/udpdump.c 2009-07-14 15:59:25.781250000 -0700 +@@ -80,6 +80,13 @@ + char packet_filter[] = "ip and udp"; + struct bpf_program fcode; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Retrieve the device list */ + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) + { +diff -urb ..\winpcap\Examples\/UserLevelBridge/UserBridge.c .\Examples/UserLevelBridge/UserBridge.c +--- ..\winpcap\Examples\/UserLevelBridge/UserBridge.c 2008-12-23 02:43:59.000000000 -0800 ++++ .\Examples/UserLevelBridge/UserBridge.c 2009-07-14 15:59:25.796875000 -0700 +@@ -78,6 +78,13 @@ + struct bpf_program fcode; + in_out_adapters couple0, couple1; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* + * Retrieve the device list + */ +diff -urb ..\winpcap\Examples\/iflist/iflist.c .\Examples/iflist/iflist.c +--- ..\winpcap\Examples\/iflist/iflist.c 2008-12-23 02:43:57.000000000 -0800 ++++ .\Examples/iflist/iflist.c 2009-07-14 15:59:25.796875000 -0700 +@@ -56,6 +56,13 @@ + char errbuf[PCAP_ERRBUF_SIZE+1]; + char source[PCAP_ERRBUF_SIZE+1]; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + printf("Enter the device you want to list:\n" + "rpcap:// ==> lists interfaces in the local machine\n" + "rpcap://hostname:port ==> lists interfaces in a remote machine\n" +diff -urb ..\winpcap\Examples\/misc/basic_dump.c .\Examples/misc/basic_dump.c +--- ..\winpcap\Examples\/misc/basic_dump.c 2008-12-23 02:43:55.000000000 -0800 ++++ .\Examples/misc/basic_dump.c 2009-07-14 15:59:25.812500000 -0700 +@@ -12,6 +12,13 @@ + pcap_t *adhandle; + char errbuf[PCAP_ERRBUF_SIZE]; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Retrieve the device list on the local machine */ + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) + { +diff -urb ..\winpcap\Examples\/misc/basic_dump_ex.c .\Examples/misc/basic_dump_ex.c +--- ..\winpcap\Examples\/misc/basic_dump_ex.c 2008-12-23 02:43:55.000000000 -0800 ++++ .\Examples/misc/basic_dump_ex.c 2009-07-14 15:59:25.812500000 -0700 +@@ -16,6 +16,12 @@ + const u_char *pkt_data; + time_t local_tv_sec; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } + + /* Retrieve the device list on the local machine */ + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) +diff -urb ..\winpcap\Examples\/misc/savedump.c .\Examples/misc/savedump.c +--- ..\winpcap\Examples\/misc/savedump.c 2008-12-23 02:43:55.000000000 -0800 ++++ .\Examples/misc/savedump.c 2009-07-14 15:59:25.828125000 -0700 +@@ -14,6 +14,12 @@ + pcap_dumper_t *dumpfile; + + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ return -1; ++ } + + /* Check command line */ + if(argc != 2) +diff -urb ..\winpcap\Examples\/misc/sendpack.c .\Examples/misc/sendpack.c +--- ..\winpcap\Examples\/misc/sendpack.c 2008-12-23 02:43:55.000000000 -0800 ++++ .\Examples/misc/sendpack.c 2009-07-14 15:59:25.859375000 -0700 +@@ -11,6 +11,14 @@ + u_char packet[100]; + int i; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ return; ++ } ++ ++ + /* Check the validity of the command line */ + if (argc != 2) + { +diff -urb ..\winpcap\Examples\/pcap_filter/pcap_filter.c .\Examples/pcap_filter/pcap_filter.c +--- ..\winpcap\Examples\/pcap_filter/pcap_filter.c 2006-07-24 14:08:27.000000000 -0700 ++++ .\Examples/pcap_filter/pcap_filter.c 2009-07-14 15:59:25.812500000 -0700 +@@ -90,6 +90,13 @@ + } + } + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + // open a capture from the network + if (source != NULL) + { +diff -urb ..\winpcap\Examples\/pktdump_ex/pktdump_ex.c .\Examples/pktdump_ex/pktdump_ex.c +--- ..\winpcap\Examples\/pktdump_ex/pktdump_ex.c 2008-12-23 02:43:57.000000000 -0800 ++++ .\Examples/pktdump_ex/pktdump_ex.c 2009-07-14 15:59:25.828125000 -0700 +@@ -60,6 +60,13 @@ + " pktdump_ex -s file://c:/temp/file.acp\n" + " pktdump_ex -s rpcap://\\Device\\NPF_{C8736017-F3C3-4373-94AC-9A34B7DAD998}\n\n"); + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + if(argc < 3) + { + +diff -urb ..\winpcap\Examples\/sendcap/sendcap.c .\Examples/sendcap/sendcap.c +--- ..\winpcap\Examples\/sendcap/sendcap.c 2008-12-23 02:43:57.000000000 -0800 ++++ .\Examples/sendcap/sendcap.c 2009-07-14 16:00:48.468750000 -0700 +@@ -53,6 +53,13 @@ + u_int npacks = 0; + errno_t fopen_error; + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Check the validity of the command line */ + if (argc <= 2 || argc >= 5) + { +diff -urb ..\winpcap\Examples\/smp_1/smp_1.c .\Examples/smp_1/smp_1.c +--- ..\winpcap\Examples\/smp_1/smp_1.c 2008-12-23 02:43:57.000000000 -0800 ++++ .\Examples/smp_1/smp_1.c 2009-07-14 15:59:25.828125000 -0700 +@@ -56,6 +56,13 @@ + printf("and that the caplen is equal to the packet length.\n"); + printf("If there is an error, it will print out a message saying \"Inconsistent XXX\"\n"); + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); +diff -urb ..\winpcap\Examples\/tcptop/tcptop.c .\Examples/tcptop/tcptop.c +--- ..\winpcap\Examples\/tcptop/tcptop.c 2008-12-23 02:43:57.000000000 -0800 ++++ .\Examples/tcptop/tcptop.c 2009-07-14 15:59:25.843750000 -0700 +@@ -56,6 +56,13 @@ + return; + } + ++ /* start WinPcap Professional */ ++ if (pcap_start_oem(errbuf, 0) == -1) ++ { ++ fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); ++ exit(1); ++ } ++ + /* Open the output adapter */ + if ( (fp= pcap_open(argv[1], 100, PCAP_OPENFLAG_PROMISCUOUS, 1000, NULL, errbuf) ) == NULL) + { diff --git a/winpcap_oem/MakeAll.sln b/winpcap_oem/MakeAll.sln new file mode 100644 index 00000000..6cfb32b4 --- /dev/null +++ b/winpcap_oem/MakeAll.sln @@ -0,0 +1,172 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Packet (NT4)", "packetNtx\Dll\Project\PacketNT4.vcproj", "{33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinpcapOem", "OEM\WinpcapOem\WinpcapOem.vcproj", "{E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}" + ProjectSection(ProjectDependencies) = postProject + {0FF1984E-927D-4C8D-AF70-8D53FC745209} = {0FF1984E-927D-4C8D-AF70-8D53FC745209} + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B} = {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wpcap", "wpcap\PRJ\wpcap.vcproj", "{CAEF56E3-4959-4C10-81F5-06C8E86C301E}" + ProjectSection(ProjectDependencies) = postProject + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D} = {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Packet (NoNetMon)", "packetNtx\Dll\Project\PacketVista.vcproj", "{8D305FC1-A748-4C63-B419-585BF03165D9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Packet (NetMon)", "packetNtx\Dll\Project\PacketNetMon.vcproj", "{A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CopyEmbeddedFiles", "OEM\WinpcapOem\CopyEmbeddedFiles.vcproj", "{59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}" + ProjectSection(ProjectDependencies) = postProject + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2} = {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2} + {0FF1984E-927D-4C8D-AF70-8D53FC745209} = {0FF1984E-927D-4C8D-AF70-8D53FC745209} + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D} = {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D} + {8D305FC1-A748-4C63-B419-585BF03165D9} = {8D305FC1-A748-4C63-B419-585BF03165D9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinPcap NTx Driver", "packetNtx\Driver\Driver.vcproj", "{0FF1984E-927D-4C8D-AF70-8D53FC745209}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug_TNT|Win32 = Debug_TNT|Win32 + Debug_TNT|x64 = Debug_TNT|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release STEP2|Win32 = Release STEP2|Win32 + Release STEP2|x64 = Release STEP2|x64 + Release_TNT|Win32 = Release_TNT|Win32 + Release_TNT|x64 = Release_TNT|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug_TNT|Win32.ActiveCfg = Debug|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug_TNT|Win32.Build.0 = Debug|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug_TNT|x64.ActiveCfg = Debug|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug|Win32.ActiveCfg = Debug|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug|Win32.Build.0 = Debug|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug|x64.ActiveCfg = Debug|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release STEP2|x64.ActiveCfg = Release|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release_TNT|Win32.ActiveCfg = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release_TNT|Win32.Build.0 = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release_TNT|x64.ActiveCfg = Release SIGNED|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release|Win32.ActiveCfg = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release|Win32.Build.0 = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release|x64.ActiveCfg = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|Win32.ActiveCfg = Debug_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|Win32.Build.0 = Debug_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|x64.ActiveCfg = Debug_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|x64.Build.0 = Debug_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|Win32.ActiveCfg = Debug|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|Win32.Build.0 = Debug|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|x64.ActiveCfg = Debug|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|x64.Build.0 = Debug|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP2|Win32.Build.0 = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP2|x64.ActiveCfg = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP2|x64.Build.0 = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|Win32.ActiveCfg = Release_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|Win32.Build.0 = Release_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|x64.ActiveCfg = Release_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|x64.Build.0 = Release_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|Win32.ActiveCfg = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|Win32.Build.0 = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|x64.ActiveCfg = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|x64.Build.0 = Release|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug_TNT|Win32.ActiveCfg = Debug REMOTE TNT|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug_TNT|Win32.Build.0 = Debug REMOTE TNT|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug_TNT|x64.ActiveCfg = Debug REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug_TNT|x64.Build.0 = Debug REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug|Win32.ActiveCfg = Debug REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug|Win32.Build.0 = Debug REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug|x64.ActiveCfg = Debug REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug|x64.Build.0 = Debug REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release STEP2|Win32.ActiveCfg = Release REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release STEP2|Win32.Build.0 = Release REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release STEP2|x64.ActiveCfg = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release STEP2|x64.Build.0 = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release_TNT|Win32.ActiveCfg = Release REMOTE TNT|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release_TNT|Win32.Build.0 = Release REMOTE TNT|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release_TNT|x64.ActiveCfg = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release_TNT|x64.Build.0 = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release|Win32.ActiveCfg = Release REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release|Win32.Build.0 = Release REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release|x64.ActiveCfg = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release|x64.Build.0 = Release REMOTE|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug_TNT|Win32.ActiveCfg = Debug|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug_TNT|Win32.Build.0 = Debug|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug_TNT|x64.ActiveCfg = Debug|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug_TNT|x64.Build.0 = Debug|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug|Win32.ActiveCfg = Debug|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug|Win32.Build.0 = Debug|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug|x64.ActiveCfg = Debug|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug|x64.Build.0 = Debug|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release STEP2|x64.ActiveCfg = Release|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release_TNT|Win32.ActiveCfg = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release_TNT|Win32.Build.0 = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release_TNT|x64.ActiveCfg = Release SIGNED|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release_TNT|x64.Build.0 = Release SIGNED|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release|Win32.ActiveCfg = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release|Win32.Build.0 = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release|x64.ActiveCfg = Release|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release|x64.Build.0 = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug_TNT|Win32.ActiveCfg = Debug|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug_TNT|Win32.Build.0 = Debug|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug_TNT|x64.ActiveCfg = Debug|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug_TNT|x64.Build.0 = Debug|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug|Win32.ActiveCfg = Debug|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug|Win32.Build.0 = Debug|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug|x64.ActiveCfg = Debug|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug|x64.Build.0 = Debug|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release STEP2|x64.ActiveCfg = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release_TNT|Win32.ActiveCfg = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release_TNT|Win32.Build.0 = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release_TNT|x64.ActiveCfg = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release_TNT|x64.Build.0 = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release|Win32.ActiveCfg = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release|Win32.Build.0 = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release|x64.ActiveCfg = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release|x64.Build.0 = Release|x64 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Debug_TNT|Win32.ActiveCfg = Debug|Win32 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Debug_TNT|Win32.Build.0 = Debug|Win32 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Debug_TNT|x64.ActiveCfg = Debug|x64 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Debug_TNT|x64.Build.0 = Debug|x64 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Debug|Win32.ActiveCfg = Debug|Win32 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Debug|Win32.Build.0 = Debug|Win32 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Debug|x64.ActiveCfg = Debug|x64 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Debug|x64.Build.0 = Debug|x64 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Release STEP2|x64.ActiveCfg = Release|x64 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Release_TNT|Win32.ActiveCfg = Release|Win32 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Release_TNT|Win32.Build.0 = Release|Win32 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Release_TNT|x64.ActiveCfg = Release|x64 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Release_TNT|x64.Build.0 = Release|x64 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Release|Win32.ActiveCfg = Release|Win32 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Release|Win32.Build.0 = Release|Win32 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Release|x64.ActiveCfg = Release|x64 + {59BDDA0D-E009-4EFC-AE87-64AF3DC17E5B}.Release|x64.Build.0 = Release|x64 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Debug_TNT|Win32.ActiveCfg = Debug|x64 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Debug_TNT|x64.ActiveCfg = Debug|x64 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Debug_TNT|x64.Build.0 = Debug|x64 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Debug|Win32.ActiveCfg = Debug|Win32 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Debug|Win32.Build.0 = Debug|Win32 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Debug|x64.ActiveCfg = Debug|x64 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Debug|x64.Build.0 = Debug|x64 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Release STEP2|x64.ActiveCfg = Release|x64 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Release_TNT|Win32.ActiveCfg = Release|Win32 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Release_TNT|x64.ActiveCfg = Release|x64 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Release_TNT|x64.Build.0 = Release|x64 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Release|Win32.ActiveCfg = Release|Win32 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Release|Win32.Build.0 = Release|Win32 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Release|x64.ActiveCfg = Release|x64 + {0FF1984E-927D-4C8D-AF70-8D53FC745209}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/winpcap_oem/OEM/WinpcapOem/CopyEmbeddedFiles.vcproj b/winpcap_oem/OEM/WinpcapOem/CopyEmbeddedFiles.vcproj new file mode 100644 index 00000000..6005acf0 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/CopyEmbeddedFiles.vcproj @@ -0,0 +1,331 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winpcap_oem/OEM/WinpcapOem/Crypto.cpp b/winpcap_oem/OEM/WinpcapOem/Crypto.cpp new file mode 100644 index 00000000..3acf1144 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/Crypto.cpp @@ -0,0 +1,120 @@ +/* + * Copyright 2015 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Riverbed Technology nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include + +#include "Crypto.h" +#include "WoemDebug.h" + +BOOL GetHash(LPCBYTE lpbData, DWORD dwDataLen, LPBYTE lpValue, DWORD dwValueLength) { + DWORD dwBufferSize = sizeof(DWORD); + DWORD dwHashSize; + HCRYPTPROV hCryptProv = NULL; + HCRYPTHASH hHash = NULL; + + TRACE_ENTER("GetHash"); + + // initialize hash object + if ( CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ) == FALSE ) + { + TRACE_MESSAGE("GetHash, Error in CryptAcquireContext [%.08x]", GetLastError()); + + TRACE_EXIT("GetHash"); + return FALSE; + } + + + + if ( CryptCreateHash(hCryptProv, CALG_MD5, 0, 0, &hHash) == FALSE ) + { + TRACE_MESSAGE("GetHash, Error in CryptCreateHash [%.08x]", GetLastError()); + + CryptReleaseContext(hCryptProv, 0); + + TRACE_EXIT("GetHash"); + return FALSE; + } + + // add dump to hash object + if ( CryptHashData(hHash, lpbData, dwDataLen, 0) == FALSE ) + { + TRACE_MESSAGE("GetHash, Error in CryptHashData [%.08x]", GetLastError()); + + CryptDestroyHash(hHash); + CryptReleaseContext(hCryptProv, 0); + + TRACE_EXIT("GetHash"); + return FALSE; + } + + // get the size of the hash + if ( CryptGetHashParam(hHash, HP_HASHSIZE, (BYTE*)&dwHashSize, &dwBufferSize, 0) == FALSE ) + { + TRACE_MESSAGE("GetHash, Error in CryptGetHashParam [%.08x]", GetLastError()); + + CryptDestroyHash(hHash); + CryptReleaseContext(hCryptProv, 0); + + TRACE_EXIT("GetHash"); + return FALSE; + } + + if ( dwHashSize != CREDENTIAL_LEN || dwValueLength != CREDENTIAL_LEN ) + { + TRACE_MESSAGE("GetHash, Error for different size of hash value (CryptAPI says %d, we have %d)", dwHashSize, CREDENTIAL_LEN ); + + CryptDestroyHash(hHash); + CryptReleaseContext(hCryptProv, 0); + + TRACE_EXIT("GetHash"); + return FALSE; + } + + // get the hash of dump + if ( CryptGetHashParam(hHash, HP_HASHVAL, lpValue, &dwHashSize, 0) == FALSE ) + { + TRACE_MESSAGE("GetHash, Error in CryptGetHashParam [%.08x]", GetLastError()); + + CryptDestroyHash(hHash); + CryptReleaseContext(hCryptProv, 0); + + TRACE_EXIT("GetHash"); + return FALSE; + } + + // terminate hash object + CryptDestroyHash(hHash); + CryptReleaseContext(hCryptProv, 0); + + TRACE_EXIT("GetHash"); + return TRUE; +} diff --git a/winpcap_oem/OEM/WinpcapOem/Crypto.h b/winpcap_oem/OEM/WinpcapOem/Crypto.h new file mode 100644 index 00000000..80534071 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/Crypto.h @@ -0,0 +1,41 @@ +/* + * Copyright 2015 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Riverbed Technology nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __CRYPTO_H_0C32B20D_A87D_429D_A7E1_A4353B74F21A +#define __CRYPTO_H_0C32B20D_A87D_429D_A7E1_A4353B74F21A + +#include + +#define CREDENTIAL_LEN 16 + +INT GetHash(LPCBYTE lpbData, DWORD dwDataLen, LPBYTE lpValue, DWORD dwValueLength); + +#endif //__CRYPTO_H_0C32B20D_A87D_429D_A7E1_A4353B74F21A diff --git a/winpcap_oem/OEM/WinpcapOem/NetMonInstaller.h b/winpcap_oem/OEM/WinpcapOem/NetMonInstaller.h new file mode 100644 index 00000000..6e0b8892 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/NetMonInstaller.h @@ -0,0 +1,38 @@ +//+--------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (C) Microsoft Corporation, 1997. +// +// File: S N E T C F G . H +// +// Contents: Sample code that demonstrates how to: +// - find out if a component is installed +// - install a net component +// - install an OEM net component +// - uninstall a net component +// - enumerate net components +// - enumerate net adapters using Setup API +// - enumerate binding paths of a component +// +// Notes: +// +// Author: kumarp 26-March-98 +// +//---------------------------------------------------------------------------- + +#pragma once + +enum NetClass +{ + NC_NetAdapter=0, + NC_NetProtocol, + NC_NetService, + NC_NetClient, + NC_Unknown +}; + +void FindIfComponentInstalled(IN PCWSTR szComponentId); + +HRESULT HrInstallNetMonProtocol(); +HRESULT HrUninstallNetMonProtocol(); + diff --git a/winpcap_oem/OEM/WinpcapOem/PacketWrapper.cpp b/winpcap_oem/OEM/WinpcapOem/PacketWrapper.cpp new file mode 100644 index 00000000..affedbd6 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/PacketWrapper.cpp @@ -0,0 +1,1283 @@ +/* + * Copyright 2015 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Riverbed Technology nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include "Packet32.h" +#include "WinpcapOem.h" +#include "WoemDebug.h" + +volatile BOOL g_StillToInit = TRUE; +volatile BOOL g_OemActive = FALSE; + +HMODULE g_PacketLib; + +__inline BOOL WoemInitialize(HINSTANCE hDllHandle); + + +//--------------------------------------------------------------------------- +// PUBLIC PACKET.DLL API WRAPPERS - HANDLERS +//--------------------------------------------------------------------------- +typedef PCHAR (*PacketGetVersionHandler)(); +typedef PCHAR (*PacketGetDriverVersionHandler)(); +typedef BOOL (*PacketStopDriverHandler)(); +typedef LPADAPTER (*PacketOpenAdapterHandler)(PCHAR AdapterName); +typedef VOID (*PacketCloseAdapterHandler)(LPADAPTER lpAdapter); +typedef LPPACKET (*PacketAllocatePacketHandler)(void); +typedef VOID (*PacketFreePacketHandler)(LPPACKET lpPacket); +typedef VOID (*PacketInitPacketHandler)(LPPACKET lpPacket,PVOID Buffer,UINT Length); +typedef BOOLEAN (*PacketReceivePacketHandler)(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync); +typedef BOOLEAN (*PacketSendPacketHandler)(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync); +typedef INT (*PacketSendPacketsHandler)(LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOOLEAN Sync); +typedef BOOLEAN (*PacketSetMinToCopyHandler)(LPADAPTER AdapterObject,int nbytes); +typedef BOOLEAN (*PacketSetModeHandler)(LPADAPTER AdapterObject,int mode); +typedef BOOLEAN (*PacketSetDumpNameHandler)(LPADAPTER AdapterObject, void *name, int len); +typedef BOOLEAN (*PacketSetDumpLimitsHandler)(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks); +typedef BOOLEAN (*PacketIsDumpEndedHandler)(LPADAPTER AdapterObject, BOOLEAN sync); +typedef HANDLE (*PacketGetReadEventHandler)(LPADAPTER AdapterObject); +typedef BOOLEAN (*PacketSetNumWritesHandler)(LPADAPTER AdapterObject,int nwrites); +typedef BOOLEAN (*PacketSetReadTimeoutHandler)(LPADAPTER AdapterObject,int timeout); +typedef BOOLEAN (*PacketSetBuffHandler)(LPADAPTER AdapterObject,int dim); +typedef BOOLEAN (*PacketSetBpfHandler)(LPADAPTER AdapterObject, struct bpf_program *fp); +typedef INT (*PacketSetSnapLenHandler)(LPADAPTER AdapterObject, int snaplen); +typedef BOOLEAN (*PacketGetStatsHandler)(LPADAPTER AdapterObject,struct bpf_stat *s); +typedef BOOLEAN (*PacketGetStatsExHandler)(LPADAPTER AdapterObject,struct bpf_stat *s); +typedef BOOLEAN (*PacketRequestHandler)(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA OidData); +typedef BOOLEAN (*PacketSetHwFilterHandler)(LPADAPTER AdapterObject,ULONG Filter); +typedef BOOLEAN (*PacketGetAdapterNamesHandler)(PTSTR pStr,PULONG BufferSize); +typedef BOOLEAN (*PacketGetNetInfoExHandler)(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries); +typedef BOOLEAN (*PacketGetNetTypeHandler)(LPADAPTER AdapterObject, NetType *type); +typedef VOID (*PacketRegWoemLeaveHandlerHandler) (PVOID Handler); +typedef BOOLEAN (*PacketSetLoopbackBehaviorHandler)(LPADAPTER AdapterObject, UINT LoopbackBehavior); +typedef PAirpcapHandle (*PacketGetAirPcapHandleHandler)(LPADAPTER AdapterObject); + + +PacketGetVersionHandler PacketGetVersionH = NULL; +PacketGetDriverVersionHandler PacketGetDriverVersionH = NULL; +PacketStopDriverHandler PacketStopDriverH = NULL; +PacketOpenAdapterHandler PacketOpenAdapterH = NULL; +PacketCloseAdapterHandler PacketCloseAdapterH = NULL; +PacketAllocatePacketHandler PacketAllocatePacketH = NULL; +PacketFreePacketHandler PacketFreePacketH = NULL; +PacketInitPacketHandler PacketInitPacketH = NULL; +PacketReceivePacketHandler PacketReceivePacketH = NULL; +PacketSendPacketHandler PacketSendPacketH = NULL; +PacketSendPacketsHandler PacketSendPacketsH = NULL; +PacketSetMinToCopyHandler PacketSetMinToCopyH = NULL; +PacketSetModeHandler PacketSetModeH = NULL; +PacketSetDumpNameHandler PacketSetDumpNameH = NULL; +PacketSetDumpLimitsHandler PacketSetDumpLimitsH = NULL; +PacketIsDumpEndedHandler PacketIsDumpEndedH = NULL; +PacketGetReadEventHandler PacketGetReadEventH = NULL; +PacketSetNumWritesHandler PacketSetNumWritesH = NULL; +PacketSetReadTimeoutHandler PacketSetReadTimeoutH = NULL; +PacketSetBuffHandler PacketSetBuffH = NULL; +PacketSetBpfHandler PacketSetBpfH = NULL; +PacketSetSnapLenHandler PacketSetSnapLenH = NULL; +PacketGetStatsHandler PacketGetStatsH = NULL; +PacketGetStatsExHandler PacketGetStatsExH = NULL; +PacketRequestHandler PacketRequestH = NULL; +PacketSetHwFilterHandler PacketSetHwFilterH = NULL; +PacketGetAdapterNamesHandler PacketGetAdapterNamesH = NULL; +PacketGetNetInfoExHandler PacketGetNetInfoExH = NULL; +PacketGetNetTypeHandler PacketGetNetTypeH = NULL; +PacketSetLoopbackBehaviorHandler PacketSetLoopbackBehaviorH = NULL; +PacketGetAirPcapHandleHandler PacketGetAirPcapHandleH = NULL; + +PacketRegWoemLeaveHandlerHandler PacketRegWoemLeaveHandlerH = NULL; + +//--------------------------------------------------------------------------- +// PUBLIC PACKET.DLL API WRAPPERS - IMPLEMENTATIONS +//--------------------------------------------------------------------------- +PCHAR PacketGetVersion() +{ + PCHAR returnValue; + + TRACE_ENTER("PacketGetVersion"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + returnValue = ""; + } + else + { + returnValue = PacketGetVersionH(); + } + + TRACE_EXIT("PacketGetVersion"); + return returnValue; +} + +PCHAR PacketGetDriverVersion() +{ + PCHAR returnValue; + + TRACE_ENTER("PacketGetDriverVersion"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + returnValue = ""; + } + else + { + // + // We don't have the driver binary, but we are sure that driver and dll + // versions are identical + // + returnValue = PacketGetVersionH(); + } + + TRACE_EXIT("PacketGetDriverVersion"); + return returnValue; +} + +BOOL PacketStopDriver() +{ + BOOL returnValue; + + TRACE_ENTER("PacketStopDriver"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + returnValue = FALSE; + SetLastError(ERROR_INVALID_FUNCTION); + } + else + { + returnValue = PacketStopDriverH(); + } + + TRACE_EXIT("PacketStopDriver"); + + return returnValue; +} + +LPADAPTER PacketOpenAdapter(PCHAR AdapterName) +{ + LPADAPTER returnValue; + + TRACE_ENTER("PacketOpenAdapter"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = NULL; + } + else + { + returnValue = PacketOpenAdapterH(AdapterName); + } + + if (returnValue != NULL) + { + if (RegisterPacketHandleForDllUnloadHandlesSweep(returnValue) == FALSE) + { + PacketCloseAdapterH(returnValue); + SetLastError(ERROR_OUTOFMEMORY); + returnValue = FALSE; + } + } + + TRACE_EXIT("PacketOpenAdapter"); + return returnValue; +} + +VOID PacketCloseAdapter(LPADAPTER lpAdapter) +{ + TRACE_ENTER("PacketCloseAdapter"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + } + else + { + DeregisterPacketHandleForDllUnloadHandlesSweep(lpAdapter); + + PacketCloseAdapterH(lpAdapter); + + } + + TRACE_EXIT("PacketCloseAdapter"); +} + +LPPACKET PacketAllocatePacket(void) +{ + LPPACKET returnValue; + + TRACE_ENTER("PacketAllocatePacket"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + returnValue = NULL; + SetLastError(ERROR_INVALID_FUNCTION); + } + else + { + returnValue = PacketAllocatePacketH(); + } + + TRACE_EXIT("PacketAllocatePacket"); + return returnValue; +} + +VOID PacketFreePacket(LPPACKET lpPacket) +{ + TRACE_ENTER("PacketFreePacket"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + } + else + { + PacketFreePacketH(lpPacket); + } + + TRACE_EXIT("PacketFreePacket"); +} + +VOID PacketInitPacket(LPPACKET lpPacket,PVOID Buffer,UINT Length) +{ + TRACE_ENTER("PacketInitPacket"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + } + else + { + PacketInitPacketH(lpPacket, Buffer, Length); + } + + TRACE_EXIT("PacketInitPacket"); +} + +BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketReceivePacket"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketReceivePacketH(AdapterObject, lpPacket, Sync); + } + + TRACE_EXIT("PacketReceivePacket"); + return returnValue; +} + +BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSendPacket"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketSendPacketH(AdapterObject, lpPacket, Sync); + } + + TRACE_EXIT("PacketSendPacket"); + return returnValue; +} + +INT PacketSendPackets(LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOOLEAN Sync) +{ + INT returnValue; + + TRACE_ENTER("PacketSendPackets"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = 0; + } +else +{ + returnValue = PacketSendPacketsH(AdapterObject, PacketBuff, Size, Sync); +} + + TRACE_EXIT("PacketSendPackets"); + return returnValue; +} + +BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSetMinToCopy"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketSetMinToCopyH(AdapterObject, nbytes); + } + + TRACE_EXIT("PacketSetMinToCopy"); + return returnValue; +} + +BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSetMode"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketSetModeH(AdapterObject, mode); + } + + TRACE_EXIT("PacketSetMode"); + return returnValue; +} + +BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSetDumpName"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketSetDumpNameH(AdapterObject, name, len); + } + + TRACE_EXIT("PacketSetDumpName"); + return returnValue; +} + +BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSetDumpLimits"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketSetDumpLimitsH(AdapterObject, maxfilesize, maxnpacks); + } + + TRACE_EXIT("PacketSetDumpLimits"); + return returnValue; +} + +BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketIsDumpEnded"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketIsDumpEndedH(AdapterObject, sync); + } + + TRACE_EXIT("PacketIsDumpEnded"); + return returnValue; +} + +HANDLE PacketGetReadEvent(LPADAPTER AdapterObject) +{ + HANDLE returnValue; + + TRACE_ENTER("PacketGetReadEvent"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = NULL; + } + else + { + returnValue = PacketGetReadEventH(AdapterObject); + } + + TRACE_EXIT("PacketGetReadEvent"); + return returnValue; +} + +BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSetNumWrites"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketSetNumWritesH(AdapterObject, nwrites); + } + + TRACE_EXIT("PacketSetNumWrites"); + return returnValue; +} + +BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSetReadTimeout"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketSetReadTimeoutH(AdapterObject, timeout); + } + + TRACE_EXIT("PacketSetReadTimeout"); + return returnValue; +} + +BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSetBuff"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketSetBuffH(AdapterObject, dim); + } + + TRACE_EXIT("PacketSetBuff"); + return returnValue; +} + +BOOLEAN PacketSetBpf(LPADAPTER AdapterObject, struct bpf_program *fp) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSetBpf"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketSetBpfH(AdapterObject, fp); + } + + TRACE_EXIT("PacketSetBpf"); + return returnValue; +} + +BOOLEAN PacketSetLoopbackBehavior(LPADAPTER AdapterObject, UINT LoopbackBehavior) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSetLoopbackBehavior"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketSetLoopbackBehaviorH(AdapterObject, LoopbackBehavior); + } + + TRACE_EXIT("PacketSetLoopbackBehavior"); + return returnValue; +} + +INT PacketSetSnapLen(LPADAPTER AdapterObject, int snaplen) +{ + INT returnValue; + + TRACE_ENTER("PacketSetSnapLen"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = 0; + } + else + { + returnValue = PacketSetSnapLenH(AdapterObject, snaplen); + } + + TRACE_EXIT("PacketSetSnapLen"); + return returnValue; +} + +BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketGetStats"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + returnValue = FALSE; + SetLastError(ERROR_INVALID_FUNCTION); + } + else + { + returnValue = PacketGetStatsH(AdapterObject, s); + } + + TRACE_EXIT("PacketGetStats"); + return returnValue; +} + +BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketGetStatsEx"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + returnValue = FALSE; + SetLastError(ERROR_INVALID_FUNCTION); + } + else + { + returnValue = PacketGetStatsExH(AdapterObject, s); + } + + TRACE_EXIT("PacketGetStatsEx"); + return returnValue; +} + +BOOLEAN PacketRequest(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA OidData) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketRequest"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + returnValue = FALSE; + SetLastError(ERROR_INVALID_FUNCTION); + } + else + { + returnValue = PacketRequestH(AdapterObject, Set, OidData); + } + + TRACE_EXIT("PacketRequest"); + return returnValue; +} + +BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketSetHwFilter"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + returnValue = FALSE; + SetLastError(ERROR_INVALID_FUNCTION); + } + else + { + returnValue = PacketSetHwFilterH(AdapterObject, Filter); + } + + TRACE_EXIT("PacketSetHwFilter"); + return returnValue; +} + +BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG BufferSize) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketGetAdapterNames"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + *BufferSize = 0; + SetLastError(ERROR_INVALID_FUNCTION); + + TRACE_EXIT("PacketGetAdapterNames"); + return FALSE; + } + else + { + returnValue = PacketGetAdapterNamesH(pStr, BufferSize); + } + + TRACE_EXIT("PacketGetAdapterNames"); + return returnValue; +} + +BOOLEAN PacketGetNetInfoEx(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketGetNetInfoEx"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketGetNetInfoExH(AdapterName, buffer, NEntries); + } + + TRACE_EXIT("PacketGetNetInfoEx"); + return returnValue; +} + +BOOLEAN PacketGetNetType(LPADAPTER AdapterObject, NetType *type) +{ + BOOLEAN returnValue; + + TRACE_ENTER("PacketGetNetType"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + returnValue = FALSE; + } + else + { + returnValue = PacketGetNetTypeH(AdapterObject, type); + } + + TRACE_EXIT("PacketGetNetType"); + return returnValue; +} + +PAirpcapHandle PacketGetAirPcapHandle(LPADAPTER AdapterObject) +{ + PAirpcapHandle pHandle; + + TRACE_ENTER("PacketGetAirPcapHandle"); + + // + // Check if we are the first instance and Init everything accordingly + // + if(!WoemInitialize(g_DllHandle)) + { + SetLastError(ERROR_INVALID_FUNCTION); + pHandle = NULL; + } + else + { + pHandle = PacketGetAirPcapHandleH(AdapterObject); + } + + TRACE_EXIT("PacketGetAirPcapHandle"); + return pHandle; +} + + + +//--------------------------------------------------------------------------- +// ADDITIONAL EXPORTS NOT PRESENT IN STANDARD PACKET.DLL +//--------------------------------------------------------------------------- + +// This public function enables winpcap oem +BOOLEAN PacketStartOemEx(PCHAR errorString, UINT errorStringLength, ULONG flags) +{ + CHAR internalErrorString[PACKET_ERRSTR_SIZE]; + + TRACE_ENTER("PacketStartOemEx"); + + + if (WoemEnterDll(g_DllHandle, internalErrorString, flags) == TRUE) + { + g_OemActive = TRUE; + TRACE_EXIT("PacketStartOemEx"); + return TRUE; + } + else + { + errorString[errorStringLength - 1] = '\0'; + + strncpy(errorString, internalErrorString, errorStringLength - 1); + + TRACE_EXIT("PacketStartOemEx"); + return FALSE; + } +} + +BOOLEAN PacketStartOem(PCHAR errorString, UINT errorStringLength) +{ + BOOLEAN result; + TRACE_ENTER("PacketStartOem"); + + result = PacketStartOemEx(errorString, errorStringLength, 0); + + TRACE_EXIT("PacketStartOem"); + + return result; +} + + +//--------------------------------------------------------------------------- +// FUNCTIONS +//--------------------------------------------------------------------------- + + +__inline BOOL WoemInitialize(HINSTANCE hDllHandle) +{ + BOOL returnValue; + char errorString[PACKET_ERRSTR_SIZE]; + + TRACE_ENTER("WoemInitialize"); + + if (g_StillToInit == FALSE) + { + TRACE_EXIT("WoemInitialize"); + return TRUE; + } + + if (g_OemActive == FALSE) + { + TRACE_MESSAGE("WinPcap Professional not active"); + + TRACE_EXIT("WoemInitialize"); + return FALSE; + } + + // NOTE: this function changes the value of g_StillInit!! + // we cannot do it here because we need to change this value + // while holding the global lock! + // + // Also, we reach this point if we are using WinPcap Professional from within TNT. + // Within TNT we initialize OEM without any flags + returnValue = WoemEnterDll(hDllHandle, errorString, 0); + + TRACE_EXIT("WoemInitialize"); + + return returnValue; +} + + + +#define LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR(_msg) do{strncpy(errorString, _msg, PACKET_ERRSTR_SIZE - 1); TRACE_MESSAGE(_msg);}while(0) + + +//////////////////////////////////////////////////////////////////// +// Load the packet.dll binary with the specifed name +//////////////////////////////////////////////////////////////////// +BOOL LoadPacketDll(char *PacketDllFileName, char *errorString) +{ + TRACE_ENTER("LoadPacketDll"); + + errorString[PACKET_ERRSTR_SIZE - 1] = '\0'; + // + // Dinamically load the packet.dll library with loadlibrary + // + if((g_PacketLib = LoadLibrary(PacketDllFileName)) == NULL) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to initialize the Packet.dll dynamic library"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + // + // Get the entry points of the just loaded library + // + PacketGetVersionH = (PacketGetVersionHandler) GetProcAddress(g_PacketLib, "PacketGetVersion"); + if(!PacketGetVersionH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 1)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketGetDriverVersionH = (PacketGetDriverVersionHandler) GetProcAddress(g_PacketLib, "PacketGetDriverVersion"); + if(!PacketGetDriverVersionH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 2)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketStopDriverH = (PacketStopDriverHandler) GetProcAddress(g_PacketLib, "PacketStopDriver"); + if(!PacketStopDriverH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 3)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketOpenAdapterH = (PacketOpenAdapterHandler) GetProcAddress(g_PacketLib, "PacketOpenAdapter"); + if(!PacketOpenAdapterH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 4)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketCloseAdapterH = (PacketCloseAdapterHandler) GetProcAddress(g_PacketLib, "PacketCloseAdapter"); + if(!PacketCloseAdapterH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 5)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketAllocatePacketH = (PacketAllocatePacketHandler) GetProcAddress(g_PacketLib, "PacketAllocatePacket"); + if(!PacketAllocatePacketH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 6)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketFreePacketH = (PacketFreePacketHandler) GetProcAddress(g_PacketLib, "PacketFreePacket"); + if(!PacketFreePacketH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 7)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketInitPacketH = (PacketInitPacketHandler) GetProcAddress(g_PacketLib, "PacketInitPacket"); + if(!PacketInitPacketH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 8)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketReceivePacketH = (PacketReceivePacketHandler) GetProcAddress(g_PacketLib, "PacketReceivePacket"); + if(!PacketReceivePacketH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 9)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSendPacketH = (PacketSendPacketHandler) GetProcAddress(g_PacketLib, "PacketSendPacket"); + if(!PacketSendPacketH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 10)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSendPacketsH = (PacketSendPacketsHandler) GetProcAddress(g_PacketLib, "PacketSendPackets"); + if(!PacketSendPacketsH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 11)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetMinToCopyH = (PacketSetMinToCopyHandler) GetProcAddress(g_PacketLib, "PacketSetMinToCopy"); + if(!PacketSetMinToCopyH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 12)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetModeH = (PacketSetModeHandler) GetProcAddress(g_PacketLib, "PacketSetMode"); + if(!PacketSetModeH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 12a)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetDumpNameH = (PacketSetDumpNameHandler) GetProcAddress(g_PacketLib, "PacketSetDumpName"); + if(!PacketSetDumpNameH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 13)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetDumpLimitsH = (PacketSetDumpLimitsHandler) GetProcAddress(g_PacketLib, "PacketSetDumpLimits"); + if(!PacketSetDumpLimitsH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 14)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketIsDumpEndedH = (PacketIsDumpEndedHandler) GetProcAddress(g_PacketLib, "PacketIsDumpEnded"); + if(!PacketIsDumpEndedH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 15)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketGetReadEventH = (PacketGetReadEventHandler) GetProcAddress(g_PacketLib, "PacketGetReadEvent"); + if(!PacketGetReadEventH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 16)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetNumWritesH = (PacketSetNumWritesHandler) GetProcAddress(g_PacketLib, "PacketSetNumWrites"); + if(!PacketSetNumWritesH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 17)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetReadTimeoutH = (PacketSetReadTimeoutHandler) GetProcAddress(g_PacketLib, "PacketSetReadTimeout"); + if(!PacketSetReadTimeoutH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 18)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetBuffH = (PacketSetBuffHandler) GetProcAddress(g_PacketLib, "PacketSetBuff"); + if(!PacketSetBuffH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 19)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetBpfH = (PacketSetBpfHandler) GetProcAddress(g_PacketLib, "PacketSetBpf"); + if(!PacketSetBpfH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 20)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetSnapLenH = (PacketSetSnapLenHandler) GetProcAddress(g_PacketLib, "PacketSetSnapLen"); + if(!PacketSetSnapLenH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 21)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketGetStatsH = (PacketGetStatsHandler) GetProcAddress(g_PacketLib, "PacketGetStats"); + if(!PacketGetStatsH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 22)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketGetStatsExH = (PacketGetStatsExHandler) GetProcAddress(g_PacketLib, "PacketGetStatsEx"); + if(!PacketGetStatsExH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 23)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketRequestH = (PacketRequestHandler) GetProcAddress(g_PacketLib, "PacketRequest"); + if(!PacketRequestH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 24)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetHwFilterH = (PacketSetHwFilterHandler) GetProcAddress(g_PacketLib, "PacketSetHwFilter"); + if(!PacketSetHwFilterH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 25)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketGetAdapterNamesH = (PacketGetAdapterNamesHandler) GetProcAddress(g_PacketLib, "PacketGetAdapterNames"); + if(!PacketGetAdapterNamesH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 26)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketGetNetInfoExH = (PacketGetNetInfoExHandler) GetProcAddress(g_PacketLib, "PacketGetNetInfoEx"); + if(!PacketGetNetInfoExH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 27)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketGetNetTypeH = (PacketGetNetTypeHandler) GetProcAddress(g_PacketLib, "PacketGetNetType"); + if(!PacketGetNetTypeH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 28)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketSetLoopbackBehaviorH = (PacketSetLoopbackBehaviorHandler) GetProcAddress(g_PacketLib, "PacketSetLoopbackBehavior"); + if(!PacketSetLoopbackBehaviorH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 29)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + PacketGetAirPcapHandleH = (PacketGetAirPcapHandleHandler) GetProcAddress(g_PacketLib, "PacketGetAirPcapHandle"); + if(!PacketGetAirPcapHandleH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 30)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } + + +#ifdef STATIC_LIB + PacketRegWoemLeaveHandlerH = (PacketRegWoemLeaveHandlerHandler) GetProcAddress(g_PacketLib, "PacketRegWoemLeaveHandler"); + if(!PacketRegWoemLeaveHandlerH) + { + LOAD_PACKET_DLL_TRACE_AND_COPY_ERROR("Unable to load Packet.dll (internal error 30)"); + + TRACE_EXIT("LoadPacketDll"); + return FALSE; + } +#endif + + TRACE_EXIT("LoadPacketDll"); + return TRUE; +} + +#ifdef STATIC_LIB +//////////////////////////////////////////////////////////////////// +// Register an unload handler that will be called by packet.dll +// DllMain. +//////////////////////////////////////////////////////////////////// +void RegisterPacketUnloadHandler(void* Handler) +{ + TRACE_ENTER("RegisterPacketUnloadHandler"); + PacketRegWoemLeaveHandlerH(Handler); + TRACE_EXIT("RegisterPacketUnloadHandler"); + +} +#endif // STATIC_LIB + +//////////////////////////////////////////////////////////////////// +// Unload the packet.dll binary we loaded on startup, and delete +// the file on disk. +//////////////////////////////////////////////////////////////////// +void DeleteDll(char *DllFileName) +{ + TRACE_ENTER("RegisterPacketUnloadHandler"); + // BOOL FRes; + + // + // We don't check return values because in every case we want to go on with cleanup + // + + // FRes = FreeLibrary(g_g_PacketLib); + + // + // We cannot delete the library immediately, because we're using it. Therefore, we delay + // its deletion to the next reboot. + // + MoveFileEx( + DllFileName, + NULL, + MOVEFILE_DELAY_UNTIL_REBOOT); + + TRACE_EXIT("RegisterPacketUnloadHandler"); +} diff --git a/winpcap_oem/OEM/WinpcapOem/Resources.cpp b/winpcap_oem/OEM/WinpcapOem/Resources.cpp new file mode 100644 index 00000000..36246110 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/Resources.cpp @@ -0,0 +1,267 @@ +/* + * Copyright 2015 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Riverbed Technology nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include "WinpcapOem.h" +#include "WoemDebug.h" + +//////////////////////////////////////////////////////////////////// +// This function locates one of the binary resources embedded in the +// dll and saves it to disk +//////////////////////////////////////////////////////////////////// +BOOL WoemSaveResourceToDisk(HINSTANCE hInst, int ResID, char* FileName, BOOL bDisableFsRedirector) +{ + DWORD dwLastError = ERROR_SUCCESS; + HANDLE hFile = INVALID_HANDLE_VALUE; + +#ifdef _X86_ + PVOID OldFsRedirectorValue = NULL; + HMODULE hKernel32Dll = NULL; + Wow64DisableWow64FsRedirectionHandler DisableFsRedirector = NULL; + Wow64RevertWow64FsRedirectionHandler RevertFsRedirector = NULL; +#endif + CHAR ResName[100]; + +#ifdef STATIC_LIB + hInst = NULL; +#endif + + TRACE_ENTER("WoemSaveResourceToDisk"); + + StringCchPrintfA(ResName, sizeof(ResName), "#%d", ResID); + + TRACE_MESSAGE("Decompressing to file %s", FileName); + + do + { +#ifdef _X86_ + if (bDisableFsRedirector) + { + // + // load the FS redirector function dynamically + // + hKernel32Dll = LoadLibrary("kernel32.dll"); + + if (hKernel32Dll == NULL) + { + dwLastError = GetLastError(); + TRACE_MESSAGE("Cannot load kernel32.dll to disable the FS redirector"); + break; + } + + DisableFsRedirector = + (Wow64DisableWow64FsRedirectionHandler)GetProcAddress( + hKernel32Dll, + "Wow64DisableWow64FsRedirection"); + + RevertFsRedirector = + (Wow64RevertWow64FsRedirectionHandler)GetProcAddress( + hKernel32Dll, + "Wow64RevertWow64FsRedirection"); + + if (DisableFsRedirector == NULL || RevertFsRedirector == NULL) + { + dwLastError = ERROR_OUTOFMEMORY; + break; + } + + if (DisableFsRedirector(&OldFsRedirectorValue) == FALSE) + { + dwLastError = GetLastError(); + break; + } + } + +#endif // _X86_ + + // + // Find the resource + // + HRSRC hRes = FindResource(hInst, ResName, RT_RCDATA); + if(hRes == NULL) + { + dwLastError = GetLastError(); + break; + } + + // + // Get the size of the resource + // + DWORD dwResSize = SizeofResource(hInst, hRes); + if(dwResSize == 0) + { + dwLastError = GetLastError(); + break; + } + + TRACE_MESSAGE("The resource has a size of %u bytes", dwResSize); + // + // Load the resource + // + HGLOBAL hResGlobal = LoadResource(hInst, hRes); + if( hResGlobal == NULL) + { + dwLastError = GetLastError(); + break; + } + + // + // Get the address of the resource + // Note: according to MSDN it's not necessary to unlock the resource + // + LPVOID lpResMem = LockResource(hResGlobal); + if(!hRes) + { + dwLastError = GetLastError(); + break; + } + + hFile = CreateFile(FileName, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, 0, NULL); + + if (hFile == INVALID_HANDLE_VALUE) + { + dwLastError = GetLastError(); + TRACE_MESSAGE("Cannot open file %8.8x", dwLastError); + } + +#ifdef _X86_ + if (bDisableFsRedirector) + { + if (RevertFsRedirector(OldFsRedirectorValue) == FALSE) + { + dwLastError = GetLastError(); + break; + } + } +#endif //_X86_ + + if (hFile == INVALID_HANDLE_VALUE) + { + break; + } + + // + // Save the resource to disk + // + DWORD writtenBytes = 0; + do + { + DWORD localWrittenBytes; + + if (WriteFile(hFile, lpResMem, dwResSize - writtenBytes, &localWrittenBytes, NULL) == FALSE) + { + dwLastError = GetLastError(); + break; + } + TRACE_MESSAGE("Written %u bytes", localWrittenBytes); + writtenBytes += localWrittenBytes; + } + while(writtenBytes < dwResSize); + + }while(FALSE); + +#ifdef _X86_ + if (hKernel32Dll != NULL) FreeLibrary(hKernel32Dll); +#endif //_X86_ + + if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile); + + if (hFile != INVALID_HANDLE_VALUE && dwLastError != ERROR_SUCCESS) DeleteFileA(FileName); + + if (dwLastError != ERROR_SUCCESS) SetLastError(dwLastError); + + TRACE_EXIT("WoemSaveResourceToDisk"); + + return (dwLastError == ERROR_SUCCESS); +} + +BOOL WoemGetResource(HINSTANCE hInst, int ResID, LPVOID * lpResMem, LPDWORD dwResSize) +{ + char ResName[100]; + HRSRC hRes; + BOOL bResult = FALSE; + + TRACE_ENTER("WoemGetResource"); + +#ifdef STATIC_LIB + hInst = NULL; +#endif + + StringCchPrintfA(ResName, sizeof(ResName), "#%d", ResID); + + do + { + + // + // Find the resource + // + hRes = FindResource(hInst, ResName, RT_RCDATA); + if(!hRes) + { + break; + } + + // + // Get the size of the resource + // + *dwResSize = SizeofResource(hInst, hRes); + if(dwResSize == 0) + { + break; + } + + // + // Load the resource + // + HGLOBAL hResGlobal = LoadResource(hInst, hRes); + if(!hResGlobal) + { + break; + } + + // + // Get the address of the resource + // Note: according to MSDN it's not necessary to unlock the resource + // + *lpResMem = LockResource(hResGlobal); + if(!hRes) + { + break; + } + + bResult = TRUE; + }while(FALSE); + + TRACE_EXIT("WoemGetResource"); + + return bResult; +} diff --git a/winpcap_oem/OEM/WinpcapOem/Security.cpp b/winpcap_oem/OEM/WinpcapOem/Security.cpp new file mode 100644 index 00000000..2923d159 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/Security.cpp @@ -0,0 +1,282 @@ +/* + * Copyright 2015 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Riverbed Technology nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include +#include + +#include "Security.h" +#include "resource.h" +#include "Crypto.h" + +#include "WinPcapOem.h" +#include "WoemDebug.h" + +#define BUF_LEN 256 +#define DUMP_LEN 1024*10 + +extern HINSTANCE g_DllHandle; + +static BOOL GetFileCredential(LPCSTR lpFilename, LPBYTE credential, DWORD credentialLength, char* errString); +static INT IsCredentialValid(LPBYTE credential, DWORD credentialLength); +static BOOL GetFileDump(LPCSTR lpFilename, LPBYTE dump, INT *pMaxDumpLen); + +/*! + \brief verify if the current process is authorized to use WOEM + + \param errString A caller allocated string (with a minimum size of + \ref PACKET_ERRSTR_SIZE bytes), that will return a meaningful error + message in case the function returns WOEM_PROC_AUTHORIZATION_FAILURE. + + \return Possible return values are + - \ref WOEM_PROC_AUTHORIZATION_FAILURE An error occurred verifying the + authoerization. A more detailed error is detailed in errString + - \ref WOEM_PROC_AUTHORIZATION_OK The current process is authorized + - \ref WOEM_PROC_AUTHORIZATION_DENIED The current process is not authorized +*/ +INT WoemGetCurrentProcessAuthorization(char *errString) +{ + CHAR filename[MAX_PATH]; + HMODULE procHandle; + BYTE credential[CREDENTIAL_LEN]; + INT result; + + TRACE_ENTER("WoemGetCurrentProcessAuthorization"); + + //handle of the process, NULL means "this process" + procHandle = NULL; + + // get the name of the process image file + if ( GetModuleFileName(procHandle, filename, MAX_PATH) == FALSE ) + { + _snprintf(errString, PACKET_ERRSTR_SIZE - 1,"WoemGetCurrentProcessAuthorization, Error retrieving the module filename with GetModuleFileName [%d].", GetLastError()); + errString[PACKET_ERRSTR_SIZE - 1] = 0; + + TRACE_MESSAGE(errString); + + TRACE_EXIT("WoemGetCurrentProcessAuthorization"); + return WOEM_PROC_AUTHORIZATION_FAILURE; + } + + // get the credential of the process + if (GetFileCredential(filename, credential, sizeof(credential), errString) == FALSE) + { + TRACE_EXIT("WoemGetCurrentProcessAuthorization"); + return WOEM_PROC_AUTHORIZATION_FAILURE; + } + + // set the authorization flag + result = IsCredentialValid(credential, sizeof(credential)); + + if (result == WOEM_PROC_AUTHORIZATION_FAILURE) + { + _snprintf(errString, PACKET_ERRSTR_SIZE - 1,"WoemGetCurrentProcessAuthorization, Error verifying the credentials of the current process"); + errString[PACKET_ERRSTR_SIZE - 1] = 0; + } + + TRACE_EXIT("WoemGetCurrentProcessAuthorization"); + + return result; +} + +// get file credential +BOOL GetFileCredential(LPCSTR lpFilename, LPBYTE credential, DWORD credentialLength, char* errString) +{ + BYTE dump[DUMP_LEN]; + INT dumpSize; + + TRACE_ENTER("GetFileCredential"); + TRACE_MESSAGE("Getting the dump of the file %s...", lpFilename); + + // get the dump of the file + dumpSize = sizeof(dump); + + if (GetFileDump(lpFilename, dump, &dumpSize) == FALSE) + { + _snprintf(errString, PACKET_ERRSTR_SIZE - 1,"GetFileCredential, error analyzing the process file."); + errString[PACKET_ERRSTR_SIZE - 1] = 0; + + TRACE_MESSAGE("GetFileCredential, error getting the file dump."); + TRACE_EXIT("GetFileCredential"); + return FALSE; + } + + TRACE_MESSAGE("GetFileCredential, Getting the hash of the dump..."); + + // get the hash of the dump + if ( GetHash(dump, dumpSize, credential, credentialLength) == FALSE ) + { + _snprintf(errString, PACKET_ERRSTR_SIZE - 1,"GetFileCredential, error analyzing the process file."); + errString[PACKET_ERRSTR_SIZE - 1] = 0; + + TRACE_MESSAGE("GetFileCredential, error in getHash!"); + TRACE_EXIT("GetFileCredential"); + return FALSE; + } + + TRACE_MESSAGE("GetFileCredential, Got the hash %.08x... of the file %s!", *((DWORD*)credential), lpFilename); + + TRACE_EXIT("GetFileCredential"); + return TRUE; +} + +/*! + \brief Verify that the given credential is valid, i.e. it's in the list + of valid ones in the resource file. + + \param credential Caller allocated buffer containing the credential to be verified + \param credentialLength Length of the credential to be verified + + \return Possible return values are + - \ref WOEM_PROC_AUTHORIZATION_FAILURE An error occurred verifying the + authoerization. + - \ref WOEM_PROC_AUTHORIZATION_OK The credential is authorized + - \ref WOEM_PROC_AUTHORIZATION_DENIED The credential is not authorized +*/ +INT IsCredentialValid(LPBYTE credential, DWORD credentialLength) +{ + LPBYTE lpResMem; + DWORD dwResSize; + + DWORD numCredentials; + DWORD credentialIndex; + + TRACE_ENTER("IsCredentialValid"); + + if (credentialLength != CREDENTIAL_LEN) + { + TRACE_MESSAGE("Security.IsCredentialValid, the credential does not have the right length!"); + TRACE_EXIT("IsCredentialValid"); + + return WOEM_PROC_AUTHORIZATION_FAILURE; + } + + // get the stored credential of the file + if (WoemGetResource(g_DllHandle, HSH_AUTH_PROC, (void**)&lpResMem, &dwResSize) == FALSE ) + { + TRACE_MESSAGE("Security.IsCredentialValid, Error in WoemGetResource [%.08x]!\n", GetLastError()); + TRACE_EXIT("IsCredentialValid"); + + return WOEM_PROC_AUTHORIZATION_FAILURE; + } + + numCredentials = dwResSize/CREDENTIAL_LEN; + + TRACE_MESSAGE("Read %d credentials (%d bytes) from resources!", numCredentials, dwResSize); + + // compare the two credentials + for (credentialIndex = 0; credentialIndex < numCredentials; credentialIndex++) + { + TRACE_MESSAGE("IsCredentialValie, Analyzing credential #%d (%.08x)...", credentialIndex, *((DWORD*)(lpResMem+credentialIndex*CREDENTIAL_LEN))); + + if ( memcmp(credential, lpResMem+(credentialIndex * CREDENTIAL_LEN), CREDENTIAL_LEN) == 0 ) + { + TRACE_MESSAGE("Security.isCredentialValid, Found equal credential!"); + + TRACE_EXIT("IsCredentialValid"); + return WOEM_PROC_AUTHORIZATION_OK; + } + } + + TRACE_EXIT("IsCredentialValid"); + return WOEM_PROC_AUTHORIZATION_DENIED; +} + +// get the dump of the file +BOOL GetFileDump(LPCSTR lpFilename, LPBYTE dump, INT *pMaxDumpLen) +{ + FILE * fileHandle; + size_t byteRead; + BOOL fileError; + + TRACE_ENTER("GetFileDump"); + + if (*pMaxDumpLen <= 0) + { + TRACE_MESSAGE("GetFileDump, MacDumpLen <= 0"); + TRACE_EXIT("GetFileDump"); + + return FALSE; + } + + TRACE_MESSAGE("Opening the file %s...", lpFilename); + + if ( (fileHandle = fopen(lpFilename, "rb")) == FALSE) + { + TRACE_MESSAGE("GetFileDump, Error in fopen [%.08x]!", GetLastError()); + TRACE_EXIT("GetFileDump"); + + return FALSE; + } + + byteRead = 0; + fileError = FALSE; + + TRACE_MESSAGE("Reading the file %s...", lpFilename); + + do + { + size_t localBytesRead = fread(dump + byteRead, 1, *pMaxDumpLen - byteRead, fileHandle); + byteRead += localBytesRead; + + if (localBytesRead == 0) + { + if (feof(fileHandle)) + fileError = FALSE; + else + fileError = TRUE; + + break; + } + + } + while (byteRead < *pMaxDumpLen); + + fclose(fileHandle); + + TRACE_MESSAGE("GetFileDump, Read %d bytes from the file...", byteRead); + + if (fileError) + { + TRACE_MESSAGE("Error reading the bytes from the file."); + + TRACE_EXIT("GetFileDump"); + + return FALSE; + } + + *pMaxDumpLen = (INT)byteRead; + + TRACE_EXIT("GetFileDump"); + + return TRUE; +} diff --git a/winpcap_oem/OEM/WinpcapOem/Security.h b/winpcap_oem/OEM/WinpcapOem/Security.h new file mode 100644 index 00000000..c5eacc88 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/Security.h @@ -0,0 +1,59 @@ +/* + * Copyright 2015 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Riverbed Technology nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __SECURITY_H_820D0C9F_A563_489b_834A_23FBB6C892F7 +#define __SECURITY_H_820D0C9F_A563_489b_834A_23FBB6C892F7 + +#include + +enum +{ + WOEM_PROC_AUTHORIZATION_OK, + WOEM_PROC_AUTHORIZATION_DENIED, + WOEM_PROC_AUTHORIZATION_FAILURE, +}; + +/*! + \brief verify if the current process is authorized to use WOEM + + \param errString A caller allocated string (with a minimum size of + \ref PACKET_ERRSTR_SIZE bytes), that will return a meaningful error + message in case the function returns WOEM_PROC_AUTHORIZATION_FAILURE. + + \return Possible return values are + - \ref WOEM_PROC_AUTHORIZATION_FAILURE An error occurred verifying the + authoerization. A more detailed error is detailed in errString + - \ref WOEM_PROC_AUTHORIZATION_OK The current process is authorized + - \ref WOEM_PROC_AUTHORIZATION_DENIED The current process is not authorized +*/ +INT WoemGetCurrentProcessAuthorization(char *errString); + +#endif //#ifndef __SECURITY_H_820D0C9F_A563_489b_834A_23FBB6C892F7 diff --git a/winpcap_oem/OEM/WinpcapOem/SerivcesInstallers.cpp b/winpcap_oem/OEM/WinpcapOem/SerivcesInstallers.cpp new file mode 100644 index 00000000..f7982b89 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/SerivcesInstallers.cpp @@ -0,0 +1,1082 @@ +/* + * Copyright (c) 2003 - 2005 NetGroup, Politecnico di Torino (Italy). + * Copyright (c) 2005 -2011 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +//+--------------------------------------------------------------------------- +// +// This file includes code shipped with (c) Microsoft Windows DDK (build 2600) +// Copyright (C) Microsoft Corporation, 1997. +// +//---------------------------------------------------------------------------- + +#define _WIN32_DCOM + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + + +#include "pch.h" +#pragma hdrstop +#include "NetMonInstaller.h" +//#define DEBUGTRACE +#include "WinpcapOem.h" +#include "WoemDebug.h" + +//---------------------------------------------------------------------------- +// Globals +// +static const GUID* c_aguidClass[] = +{ + &GUID_DEVCLASS_NET, + &GUID_DEVCLASS_NETTRANS, + &GUID_DEVCLASS_NETSERVICE, + &GUID_DEVCLASS_NETCLIENT +}; + +//---------------------------------------------------------------------------- +// Prototypes of helper functions +// +HRESULT HrInstallNetComponent(IN INetCfg* pnc, + IN PCWSTR szComponentId, + IN const GUID* pguidClass); + +HRESULT HrUninstallNetComponent(IN INetCfg* pnc, IN PCWSTR szComponentId); +HRESULT HrGetINetCfg(IN BOOL fGetWriteLock, INetCfg** ppnc); +HRESULT HrReleaseINetCfg(BOOL fHasWriteLock, INetCfg* pnc); +inline ULONG ReleaseObj(IUnknown* punk) +{ + return (punk) ? punk->Release () : 0; +} + +void DisplayErrorText(DWORD dwLastError); +static void ConvertLastErrorToString(DWORD dwLastError, char *errorString, size_t length); + + +/////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////// +// Netmon-related functions // +/////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////// + +//+--------------------------------------------------------------------------- +// +// Function: HrIsComponentInstalled +// +// Purpose: Find out if a component is installed +// +// Arguments: +// szComponentId [in] id of component to search +// +// Returns: S_OK if installed, +// S_FALSE if not installed, +// otherwise an error code +// +// Author: kumarp 11-February-99 +// +// Notes: +// +HRESULT HrIsComponentInstalled(IN PCWSTR szComponentId) +{ + HRESULT hr=S_OK; + INetCfg* pnc; + INetCfgComponent* pncc; + + hr = HrGetINetCfg(FALSE, &pnc); + if (S_OK == hr) + { + hr = pnc->FindComponent(szComponentId, &pncc); + if (S_OK == hr) + { + ReleaseObj(pncc); + } + (void) HrReleaseINetCfg(FALSE, pnc); + } + + return hr; +} + +//+--------------------------------------------------------------------------- +// +// Function: HrInstallNetComponent +// +// Purpose: Install the specified net component +// +// Arguments: +// szComponentId [in] component to install +// nc [in] class of the component +// szInfFullPath [in] full path to primary INF file +// required if the primary INF and other +// associated files are not pre-copied to +// the right destination dirs. +// Not required when installing MS components +// since the files are pre-copied by +// Windows NT Setup. +// +// Returns: S_OK or NETCFG_S_REBOOT on success, otherwise an error code +// +// Notes: +// + +HRESULT HrInstallNetMonProtocol() +{ + HRESULT hr=S_OK; + INetCfg* pnc; + + hr = HrGetINetCfg(TRUE, &pnc); + + if (SUCCEEDED(hr)) + { + // install szComponentId + hr = HrInstallNetComponent(pnc, L"MS_NetMon", &GUID_DEVCLASS_NETTRANS); + if (SUCCEEDED(hr)) + { + // Apply the changes + hr = pnc->Apply(); + } + + // release INetCfg + (void) HrReleaseINetCfg(TRUE, pnc); + } + return hr; +} + +//+--------------------------------------------------------------------------- +// +// Function: HrInstallNetComponent +// +// Purpose: Install the specified net component +// +// Arguments: +// pnc [in] pointer to INetCfg object +// szComponentId [in] component to install +// pguidClass [in] class guid of the component +// +// Returns: S_OK or NETCFG_S_REBOOT on success, otherwise an error code +// +// Notes: +// +HRESULT HrInstallNetComponent(IN INetCfg* pnc, + IN PCWSTR szComponentId, + IN const GUID* pguidClass) +{ + HRESULT hr=S_OK; + OBO_TOKEN OboToken; + INetCfgClassSetup* pncClassSetup; + INetCfgComponent* pncc; + + // OBO_TOKEN specifies the entity on whose behalf this + // component is being installed + + // set it to OBO_USER so that szComponentId will be installed + // On-Behalf-Of "user" + ZeroMemory (&OboToken, sizeof(OboToken)); + OboToken.Type = OBO_USER; + + hr = pnc->QueryNetCfgClass (pguidClass, IID_INetCfgClassSetup, + (void**)&pncClassSetup); + if (SUCCEEDED(hr)) + { + hr = pncClassSetup->Install(szComponentId, + &OboToken, + NSF_POSTSYSINSTALL, + 0, // + NULL, // answerfile name + NULL, // answerfile section name + &pncc); + if (S_OK == hr) + { + // we dont want to use pncc (INetCfgComponent), release it + ReleaseObj(pncc); + } + + ReleaseObj(pncClassSetup); + } + + return hr; +} + +//+--------------------------------------------------------------------------- +// +// Function: HrUninstallNetComponent +// +// Purpose: Initialize INetCfg and uninstall a component +// +// Arguments: +// szComponentId [in] InfId of component to uninstall (e.g. MS_TCPIP) +// +// Returns: S_OK or NETCFG_S_REBOOT on success, otherwise an error code +// +// Notes: +// +HRESULT HrUninstallNetMonProtocol() +{ + HRESULT hr=S_OK; + INetCfg* pnc; + + // get INetCfg interface + hr = HrGetINetCfg(TRUE, &pnc); + + if (SUCCEEDED(hr)) + { + // uninstall szComponentId + hr = HrUninstallNetComponent(pnc, L"MS_NetMon"); + + if (S_OK == hr) + { + // Apply the changes + hr = pnc->Apply(); + } + // release INetCfg + (void) HrReleaseINetCfg(TRUE, pnc); + } + + return hr; +} + +//+--------------------------------------------------------------------------- +// +// Function: HrUninstallNetComponent +// +// Purpose: Uninstall the specified component. +// +// Arguments: +// pnc [in] pointer to INetCfg object +// szComponentId [in] component to uninstall +// +// Returns: S_OK or NETCFG_S_REBOOT on success, otherwise an error code +// +// Notes: +// +HRESULT HrUninstallNetComponent(IN INetCfg* pnc, IN PCWSTR szComponentId) +{ + HRESULT hr=S_OK; + OBO_TOKEN OboToken; + INetCfgComponent* pncc; + GUID guidClass; + INetCfgClass* pncClass; + INetCfgClassSetup* pncClassSetup; + + // OBO_TOKEN specifies the entity on whose behalf this + // component is being uninstalld + + // set it to OBO_USER so that szComponentId will be uninstalld + // On-Behalf-Of "user" + ZeroMemory (&OboToken, sizeof(OboToken)); + OboToken.Type = OBO_USER; + + // see if the component is really installed + hr = pnc->FindComponent(szComponentId, &pncc); + + if (S_OK == hr) + { + // yes, it is installed. obtain INetCfgClassSetup and DeInstall + + hr = pncc->GetClassGuid(&guidClass); + + if (S_OK == hr) + { + hr = pnc->QueryNetCfgClass(&guidClass, IID_INetCfgClass, + (void**)&pncClass); + if (SUCCEEDED(hr)) + { + hr = pncClass->QueryInterface(IID_INetCfgClassSetup, + (void**)&pncClassSetup); + if (SUCCEEDED(hr)) + { + hr = pncClassSetup->DeInstall (pncc, &OboToken, NULL); + + ReleaseObj (pncClassSetup); + } + ReleaseObj(pncClass); + } + } + ReleaseObj(pncc); + } + + return hr; +} + + +//+--------------------------------------------------------------------------- +// +// Function: HrGetINetCfg +// +// Purpose: Initialize COM, create and initialize INetCfg. +// Obtain write lock if indicated. +// +// Arguments: +// fGetWriteLock [in] whether to get write lock +// ppnc [in] pointer to pointer to INetCfg object +// +// Returns: S_OK on success, otherwise an error code +// +// Notes: +// +HRESULT HrGetINetCfg(IN BOOL fGetWriteLock, + INetCfg** ppnc) +{ + HRESULT hr=S_OK; + + // Initialize the output parameters. + *ppnc = NULL; + + // initialize COM + hr = CoInitializeEx(NULL, + COINIT_DISABLE_OLE1DDE | COINIT_APARTMENTTHREADED ); + + if (SUCCEEDED(hr)) + { + // Create the object implementing INetCfg. + // + INetCfg* pnc; + hr = CoCreateInstance(CLSID_CNetCfg, NULL, CLSCTX_INPROC_SERVER, + IID_INetCfg, (void**)&pnc); + if (SUCCEEDED(hr)) + { + INetCfgLock * pncLock = NULL; + if (fGetWriteLock) + { + // Get the locking interface + hr = pnc->QueryInterface(IID_INetCfgLock, + (LPVOID *)&pncLock); + if (SUCCEEDED(hr)) + { + // Attempt to lock the INetCfg for read/write + static const ULONG c_cmsTimeout = 15000; + static const WCHAR c_szSampleNetcfgApp[] = + L"Sample Netcfg Application (netcfg.exe)"; + PWSTR szLockedBy; + + hr = pncLock->AcquireWriteLock(c_cmsTimeout, + c_szSampleNetcfgApp, + &szLockedBy); + if (S_FALSE == hr) + { + hr = NETCFG_E_NO_WRITE_LOCK; + } + } + } + + if (SUCCEEDED(hr)) + { + // Initialize the INetCfg object. + // + hr = pnc->Initialize(NULL); + if (SUCCEEDED(hr)) + { + *ppnc = pnc; + pnc->AddRef(); + } + else + { + // initialize failed, if obtained lock, release it + if (pncLock) + { + pncLock->ReleaseWriteLock(); + } + } + } + ReleaseObj(pncLock); + ReleaseObj(pnc); + } + + if (FAILED(hr)) + { + CoUninitialize(); + } + } + + return hr; +} + +//+--------------------------------------------------------------------------- +// +// Function: HrReleaseINetCfg +// +// Purpose: Uninitialize INetCfg, release write lock (if present) +// and uninitialize COM. +// +// Arguments: +// fHasWriteLock [in] whether write lock needs to be released. +// pnc [in] pointer to INetCfg object +// +// Returns: S_OK on success, otherwise an error code +// +// Notes: +// +HRESULT HrReleaseINetCfg(BOOL fHasWriteLock, INetCfg* pnc) +{ + HRESULT hr = S_OK; + + // uninitialize INetCfg + hr = pnc->Uninitialize(); + + // if write lock is present, unlock it + if (SUCCEEDED(hr) && fHasWriteLock) + { + INetCfgLock* pncLock; + + // Get the locking interface + hr = pnc->QueryInterface(IID_INetCfgLock, + (LPVOID *)&pncLock); + if (SUCCEEDED(hr)) + { + hr = pncLock->ReleaseWriteLock(); + ReleaseObj(pncLock); + } + } + + ReleaseObj(pnc); + + CoUninitialize(); + + return hr; +} + +#define MAX_DELAY_STOP_SERVICE 3000 //ms + +/////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////// +// NPF-related functions // +/////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////// +int delete_service(LPCTSTR ServiceName) +{ + SC_HANDLE SCM_Handle; + SC_HANDLE ServiceHandle; + SERVICE_STATUS ServiceStatus; + ULONG delay; + + DWORD ReturnValue; + + SCM_Handle=OpenSCManager(NULL, /*local machine */ + NULL, /*active database*/ + SC_MANAGER_ALL_ACCESS); + + if (SCM_Handle==NULL) + { + TRACE_MESSAGE("Error opening Service Control Manager: "); + DisplayErrorText(GetLastError()); + return -1; + } + + ServiceHandle=OpenService(SCM_Handle, + ServiceName, + SERVICE_ALL_ACCESS); + + + if (ServiceHandle==NULL) + { + TRACE_MESSAGE("Error opening Service Control Manager: "); + DisplayErrorText(GetLastError()); + + if (!CloseServiceHandle(SCM_Handle)) + TRACE_MESSAGE("Error closing Service control Manager\n"); + + return -1; + } + + ReturnValue=0; + + if(!ControlService(ServiceHandle,SERVICE_CONTROL_STOP,&ServiceStatus)) + { + DWORD Err=GetLastError(); + + if (Err != ERROR_SERVICE_NOT_ACTIVE) + { + TRACE_MESSAGE("Error stopping service %s: ",ServiceName); + DisplayErrorText(Err); + ReturnValue=-1; + } + } + else + TRACE_MESSAGE("Service %s successfully stopped\n",ServiceName); + + // + // We can delete the service only if it's stopped. If the service is not stopped, it will be marked for deletion, + // which is a pain in the butt. Please see the long explanation about this problem in DllMain + // + delay = 0; + while((QueryServiceStatus(ServiceHandle, &ServiceStatus) == TRUE) && (ServiceStatus.dwCurrentState != SERVICE_STOPPED) && delay < MAX_DELAY_STOP_SERVICE) + { + TRACE_MESSAGE("The service status is now %u", ServiceStatus.dwCurrentState); + Sleep(100); + delay += 100; + } + + // + // If by this time the service is not stopped, just fail to delete the service + // + if (ServiceStatus.dwCurrentState != SERVICE_STOPPED) + { + TRACE_MESSAGE("The service cannot be stopped (pending handles?)"); + return -1; + } + + if(!DeleteService(ServiceHandle)) + { + TRACE_MESSAGE("Error deleting service %s: ",ServiceName); + DisplayErrorText(GetLastError()); + ReturnValue=-1; + + } + else + TRACE_MESSAGE("Service %s successfully deleted\n",ServiceName); + + if(!CloseServiceHandle(ServiceHandle)) + { + TRACE_MESSAGE("Error closing service %s: ",ServiceName); + DisplayErrorText(GetLastError()); + ReturnValue=-1; + } + + if(!CloseServiceHandle(SCM_Handle)) + { + TRACE_MESSAGE("Error closing Service control Manager\n"); + ReturnValue=-1; + } + + return ReturnValue; + +} + +int stop_service(LPCTSTR ServiceName) +{ + SC_HANDLE SCM_Handle; + SC_HANDLE ServiceHandle; + SERVICE_STATUS ServiceStatus; + DWORD ReturnValue; + + SCM_Handle=OpenSCManager(NULL, /*local machine */ + NULL, /*active database*/ + SC_MANAGER_ALL_ACCESS); + + if (SCM_Handle==NULL) + { + TRACE_MESSAGE("Error opening Service Control Manager: "); + DisplayErrorText(GetLastError()); + + return -1; + } + + ServiceHandle=OpenService(SCM_Handle, + ServiceName, + SERVICE_ALL_ACCESS); + + + if (ServiceHandle==NULL) + { + TRACE_MESSAGE("Error opening service %s:",ServiceName); + DisplayErrorText(GetLastError()); + + if (!CloseServiceHandle(SCM_Handle)) + TRACE_MESSAGE("Error closing Service control Manager\n"); + + return -1; + } + + ReturnValue=0; + + if (!ControlService(ServiceHandle,SERVICE_CONTROL_STOP,&ServiceStatus)) + { + TRACE_MESSAGE("Error stopping service %s: ",ServiceName); + DisplayErrorText(GetLastError()); + ReturnValue=-1; + + } + else + TRACE_MESSAGE("Service %s successfully stopped\n",ServiceName); + + if (!CloseServiceHandle(ServiceHandle)) + { + TRACE_MESSAGE("Error closing service %s: ",ServiceName); + DisplayErrorText(GetLastError()); + + ReturnValue=-1; + } + + if (!CloseServiceHandle(SCM_Handle)) + { + TRACE_MESSAGE("Error closing Service control Manager\n"); + ReturnValue=-1; + } + + return ReturnValue; + +} + +int change_start_type_service(LPCTSTR ServiceName, DWORD StartType) +{ + SC_HANDLE SCM_Handle; + SC_HANDLE ServiceHandle; + DWORD ReturnValue; + + SCM_Handle=OpenSCManager(NULL, /*local machine */ + NULL, /*active database*/ + SC_MANAGER_ALL_ACCESS); + + if (SCM_Handle == NULL) + { + TRACE_MESSAGE("Error opening Service Control Manager: "); + DisplayErrorText(GetLastError()); + return -1; + } + + ServiceHandle=OpenService(SCM_Handle, + ServiceName, + SERVICE_ALL_ACCESS); + + + if (ServiceHandle == NULL) + { + TRACE_MESSAGE("Error opening service %s: ",ServiceName); + DisplayErrorText(GetLastError()); + + if (!CloseServiceHandle(SCM_Handle)) + TRACE_MESSAGE("Error closing Service control Manager\n"); + + return -1; + } + + ReturnValue=0; + + if (!ChangeServiceConfig(ServiceHandle, + SERVICE_NO_CHANGE, + StartType, + SERVICE_NO_CHANGE, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL)) + { + TRACE_MESSAGE("Error changing start type for service %s:",ServiceName); + DisplayErrorText(GetLastError()); + ReturnValue=-1; + + } + else + TRACE_MESSAGE("Successfully changed start-type for service %s\n",ServiceName); + + if (!CloseServiceHandle(ServiceHandle)) + { + TRACE_MESSAGE("Error closing service %s\n",ServiceName); + ReturnValue=-1; + } + + + if (!CloseServiceHandle(SCM_Handle)) + { + TRACE_MESSAGE("Error closing Service control Manager\n"); + ReturnValue=-1; + } + + return ReturnValue; + +} + + +int start_service(LPCTSTR ServiceName, char* ErrorString, size_t Length) +{ + SC_HANDLE SCM_Handle; + SC_HANDLE ServiceHandle; + DWORD ReturnValue; + DWORD LastError; + char InternalErrorMsg[PACKET_ERRSTR_SIZE]; + + SCM_Handle=OpenSCManager(NULL, /*local machine */ + NULL, /*active database*/ + SC_MANAGER_ALL_ACCESS); + + if (SCM_Handle == NULL) + { + LastError = GetLastError(); + ::ConvertLastErrorToString(LastError, InternalErrorMsg, PACKET_ERRSTR_SIZE); + if (Length > 0) + { + ErrorString[Length - 1] = '\0'; + _snprintf(ErrorString, Length, "Error opening Service Control Manager: %s", InternalErrorMsg); + } + TRACE_MESSAGE("Error opening Service Control Manager: %s", InternalErrorMsg); + + return -1; + } + + ServiceHandle=OpenService(SCM_Handle, + ServiceName, + SERVICE_ALL_ACCESS); + + + if (ServiceHandle == NULL) + { + LastError = GetLastError(); + ::ConvertLastErrorToString(LastError, InternalErrorMsg, PACKET_ERRSTR_SIZE); + if (Length > 0) + { + ErrorString[Length - 1] = '\0'; + _snprintf(ErrorString, Length, "Error opening service %s: %s", ServiceName, InternalErrorMsg); + } + TRACE_MESSAGE("Error opening service %s: %s", ServiceName, InternalErrorMsg); + + if (!CloseServiceHandle(SCM_Handle)) + TRACE_MESSAGE("Error closing Service control Manager\n"); + + return -1; + } + + ReturnValue=0; + + if (!StartService(ServiceHandle,0,NULL)) + { + LastError = GetLastError(); + ::ConvertLastErrorToString(LastError, InternalErrorMsg, PACKET_ERRSTR_SIZE); + if (Length > 0) + { + ErrorString[Length - 1] = '\0'; + _snprintf(ErrorString, Length, "Error starting service %s: %s", ServiceName, InternalErrorMsg); + } + TRACE_MESSAGE("Error starting service %s: %s", ServiceName, InternalErrorMsg); + ReturnValue=-1; + + } + else + TRACE_MESSAGE("Service %s successfully started\n",ServiceName); + + if (!CloseServiceHandle(ServiceHandle)) + { + LastError = GetLastError(); + ::ConvertLastErrorToString(LastError, InternalErrorMsg, PACKET_ERRSTR_SIZE); + if (Length > 0) + { + ErrorString[Length - 1] = '\0'; + _snprintf(ErrorString, Length, "Error closing service handle %s: %s", ServiceName, InternalErrorMsg); + } + TRACE_MESSAGE("Error closing service handle %s: %s", ServiceName, InternalErrorMsg); + ReturnValue=-1; + } + + + if (!CloseServiceHandle(SCM_Handle)) + { + LastError = GetLastError(); + ::ConvertLastErrorToString(LastError, InternalErrorMsg, PACKET_ERRSTR_SIZE); + if (Length > 0) + { + ErrorString[Length - 1] = '\0'; + _snprintf(ErrorString, Length, "Error closing Service Control Manager: %s", InternalErrorMsg); + } + TRACE_MESSAGE("Error closing Service Control Manager: %s", InternalErrorMsg); + ReturnValue=-1; + } + + return ReturnValue; +} + + +int create_driver_service(LPCTSTR ServiceName,LPCTSTR ServiceDescription,LPCTSTR ServicePath, char *ErrorString, size_t Length) +{ + SC_HANDLE SCM_Handle; + SC_HANDLE ServiceHandle; + DWORD LastError; + char InternalErrorMsg[PACKET_ERRSTR_SIZE]; + int ReturnValue; + + SCM_Handle=OpenSCManager(NULL, /*local machine */ + NULL, /*active database*/ + SC_MANAGER_ALL_ACCESS); + + if (SCM_Handle==NULL) + { + LastError = GetLastError(); + ::ConvertLastErrorToString(LastError, InternalErrorMsg, PACKET_ERRSTR_SIZE); + if (Length > 0) + { + ErrorString[Length-1] = '\0'; + _snprintf(ErrorString, Length, "Error opening Service Control Manager: %s", InternalErrorMsg); + } + TRACE_MESSAGE("Error opening Service Control Manager: %s", InternalErrorMsg); + return -1; + } + + ServiceHandle=CreateService(SCM_Handle, + ServiceName, + ServiceDescription, + SERVICE_ALL_ACCESS, + SERVICE_KERNEL_DRIVER, + SERVICE_DEMAND_START, + SERVICE_ERROR_NORMAL, + ServicePath, + NULL, + NULL, + NULL, + NULL, + NULL); + + if (ServiceHandle==NULL) + { + LastError = GetLastError(); + if(LastError == ERROR_SERVICE_EXISTS) + { + if (!CloseServiceHandle(SCM_Handle)) + if (stdout != NULL) + TRACE_MESSAGE("Error closing Service control Manager\n"); + + return 0; + } + + ::ConvertLastErrorToString(LastError, InternalErrorMsg, PACKET_ERRSTR_SIZE); + if (Length > 0) + { + ErrorString[Length - 1] = '\0'; + _snprintf(ErrorString, Length, "Error creating service %s: %s", ServiceName, InternalErrorMsg); + } + TRACE_MESSAGE("%s", ErrorString); + + if (!CloseServiceHandle(SCM_Handle)) + if (stdout != NULL) + TRACE_MESSAGE("Error closing Service control Manager\n"); + + return -1; + } + + TRACE_MESSAGE("Service %s successfully created.\n",ServiceName); + + ReturnValue=0; + + if (!CloseServiceHandle(ServiceHandle)) + { + ::ConvertLastErrorToString(GetLastError(), InternalErrorMsg, PACKET_ERRSTR_SIZE); + if (Length > 0) + { + ErrorString[Length - 1] = '\0'; + _snprintf(ErrorString, Length, "Error closing service %s: %s", ServiceName, InternalErrorMsg); + } + TRACE_MESSAGE("Error closing service %s: %s", ServiceName, InternalErrorMsg); + ReturnValue=-1; + } + + + if (!CloseServiceHandle(SCM_Handle)) + { + ::ConvertLastErrorToString(GetLastError(), InternalErrorMsg, PACKET_ERRSTR_SIZE); + if (Length > 0) + { + ErrorString[Length - 1] = '\0'; + _snprintf(ErrorString, Length, "Error closing Service Control Manager: %s", InternalErrorMsg); + } + TRACE_MESSAGE("Error closing Service Control Manager: %s", InternalErrorMsg); + ReturnValue=-1; + } + + return ReturnValue; + +} + + +int check_if_service_is_running(LPCTSTR ServiceName) +{ + SC_HANDLE SCM_Handle; + SC_HANDLE ServiceHandle; + SERVICE_STATUS ServiceStatus; + + SCM_Handle=OpenSCManager(NULL, /*local machine */ + NULL, /*active database*/ + SC_MANAGER_ALL_ACCESS); + + if (SCM_Handle == NULL) + { + TRACE_MESSAGE("Error opening Service Control Manager: "); + DisplayErrorText(GetLastError()); + return -1; + } + + ServiceHandle = OpenService(SCM_Handle, + ServiceName, + SERVICE_ALL_ACCESS); + + if (ServiceHandle == NULL) + { + // Requested service not existing + CloseServiceHandle(SCM_Handle); + return -1; + } + + if(!ControlService(ServiceHandle, SERVICE_CONTROL_INTERROGATE, &ServiceStatus)) + { + // We get here if service's not been started + + DisplayErrorText(GetLastError()); + + // Close handles + CloseServiceHandle(ServiceHandle); + CloseServiceHandle(SCM_Handle); + + return -1; + } + + // Close handles + CloseServiceHandle(ServiceHandle); + CloseServiceHandle(SCM_Handle); + + if(ServiceStatus.dwCurrentState == SERVICE_RUNNING) + return 0; + else + return -1; +} + + +int check_if_service_is_present(LPCTSTR ServiceName) +{ + SC_HANDLE SCM_Handle; + SC_HANDLE ServiceHandle; + + SCM_Handle=OpenSCManager(NULL, /*local machine */ + NULL, /*active database*/ + SC_MANAGER_ALL_ACCESS); + + if (SCM_Handle == NULL) + { + TRACE_MESSAGE("Error opening Service Control Manager: "); + DisplayErrorText(GetLastError()); + return -1; + } + + ServiceHandle = OpenService(SCM_Handle, + ServiceName, + SERVICE_ALL_ACCESS); + + if (ServiceHandle == NULL) + { + // Requested service not existing + CloseServiceHandle(SCM_Handle); + return -1; + } + + + // Close handles + CloseServiceHandle(ServiceHandle); + CloseServiceHandle(SCM_Handle); + + return 0; +} + +void ConvertLastErrorToString(DWORD dwLastError, char *errorString, size_t length) +{ + LPSTR MessageBuffer; + DWORD dwBufferLength; + + DWORD dwFormatFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_FROM_SYSTEM ; + + // + // Call FormatMessage() to allow for message + // text to be acquired from the system + // or from the supplied module handle. + // + + if(dwBufferLength = FormatMessageA( + dwFormatFlags, + NULL, // module to get message from (NULL == system) + dwLastError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // default language + (LPSTR) &MessageBuffer, + 0, + NULL + )) + { + if (length > 0) + { + errorString[length-1] = '\0'; + strncpy(errorString, MessageBuffer, length-1); + } + // + // Free the buffer allocated by the system. + // + LocalFree(MessageBuffer); + } +} + +void DisplayErrorText(DWORD dwLastError) +{ + HMODULE hModule = NULL; // default to system source + LPSTR MessageBuffer; + DWORD dwBufferLength; + + DWORD dwFormatFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_IGNORE_INSERTS | + FORMAT_MESSAGE_FROM_SYSTEM ; + + // + // Call FormatMessage() to allow for message + // text to be acquired from the system + // or from the supplied module handle. + // + + if(dwBufferLength = FormatMessageA( + dwFormatFlags, + hModule, // module to get message from (NULL == system) + dwLastError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // default language + (LPSTR) &MessageBuffer, + 0, + NULL + )) + { + TRACE_MESSAGE("%s",MessageBuffer); + + // + // Free the buffer allocated by the system. + // + LocalFree(MessageBuffer); + } + + // + // If we loaded a message source, unload it. + // + if(hModule != NULL) + FreeLibrary(hModule); +} + diff --git a/winpcap_oem/OEM/WinpcapOem/StaticWinpcapOem.dsp b/winpcap_oem/OEM/WinpcapOem/StaticWinpcapOem.dsp new file mode 100644 index 00000000..603f6e25 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/StaticWinpcapOem.dsp @@ -0,0 +1,475 @@ +# Microsoft Developer Studio Project File - Name="StaticWinpcapOem" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=StaticWinpcapOem - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "StaticWinpcapOem.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "StaticWinpcapOem.mak" CFG="StaticWinpcapOem - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "StaticWinpcapOem - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "StaticWinpcapOem - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "StaticWinpcapOem - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "./" /I "../../../winpcap/common" /I "../../../common" /I "../../../winpcap/wpcap/libpcap" /I "../../../winpcap/wpcap/libpcap/lbl/" /I "../../../winpcap/wpcap/libpcap/bpf/" /I "../../../winpcap/wpcap/libpcap/win32/include/" /I "../../../winpcap/wpcap/Win32-Extensions" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "STATIC_LIB" /D "YY_NEVER_INTERACTIVE" /D yylval=pcap_lval /D "_USRDLL" /D "LIBPCAP_EXPORTS" /D "HAVE_STRERROR" /D "__STDC__" /D "INET6" /D "_WINDOWS" /D SIZEOF_CHAR=1 /D SIZEOF_SHORT=2 /D SIZEOF_INT=4 /D "HAVE_ADDRINFO" /D _U_= /D "HAVE_SNPRINTF" /D "HAVE_VSNPRINTF" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Release\wpcap.lib" + +!ELSEIF "$(CFG)" == "StaticWinpcapOem - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "./" /I "../../../winpcap/common" /I "../../../common" /I "../../../winpcap/wpcap/libpcap" /I "../../../winpcap/wpcap/libpcap/lbl/" /I "../../../winpcap/wpcap/libpcap/bpf/" /I "../../../winpcap/wpcap/libpcap/win32/include/" /I "../../../winpcap/wpcap/Win32-Extensions" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "STATIC_LIB" /D "YY_NEVER_INTERACTIVE" /D yylval=pcap_lval /D "_USRDLL" /D "LIBPCAP_EXPORTS" /D "HAVE_STRERROR" /D "__STDC__" /D "INET6" /D "_WINDOWS" /D SIZEOF_CHAR=1 /D SIZEOF_SHORT=2 /D SIZEOF_INT=4 /D "HAVE_ADDRINFO" /D _U_= /D "HAVE_SNPRINTF" /D "HAVE_VSNPRINTF" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Debug\wpcap.lib" + +!ENDIF + +# Begin Target + +# Name "StaticWinpcapOem - Win32 Release" +# Name "StaticWinpcapOem - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Crypto.cpp +# End Source File +# Begin Source File + +SOURCE=.\PacketWrapper.cpp +# End Source File +# Begin Source File + +SOURCE=.\Resources.cpp +# End Source File +# Begin Source File + +SOURCE=.\Security.cpp +# End Source File +# Begin Source File + +SOURCE=.\SerivcesInstallers.cpp +# End Source File +# Begin Source File + +SOURCE=.\WinPcapOem.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\Crypto.h +# End Source File +# Begin Source File + +SOURCE=.\idls.h +# End Source File +# Begin Source File + +SOURCE=.\netcfgn.h +# End Source File +# Begin Source File + +SOURCE=.\netcfgx.h +# End Source File +# Begin Source File + +SOURCE=.\NetMonInstaller.h +# End Source File +# Begin Source File + +SOURCE=.\Npf2k.h + +!IF "$(CFG)" == "StaticWinpcapOem - Win32 Release" + +# PROP Ignore_Default_Tool 1 +USERDEP__NPF2K="$(WkspDir)\binaries\npf2k.sys" +# Begin Custom Build - Building the include file from npf2k.sys +WkspDir=. +InputPath=.\Npf2k.h + +"Npf2k.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(WkspDir)\..\bin2c\BIN2C.exe binaries\npf2k.sys Npf2k Npf2k + +# End Custom Build + +!ELSEIF "$(CFG)" == "StaticWinpcapOem - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +USERDEP__NPF2K="$(WkspDir)\binaries\npf2k.sys" +# Begin Custom Build - Building the include file from npf2k.sys +WkspDir=. +InputPath=.\Npf2k.h + +"Npf2k.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(WkspDir)\..\bin2c\BIN2C.exe binaries\npf2k.sys Npf2k Npf2k + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Npfnt.h + +!IF "$(CFG)" == "StaticWinpcapOem - Win32 Release" + +# PROP Ignore_Default_Tool 1 +USERDEP__NPFNT="$(WkspDir)\binaries\npfnt.sys" +# Begin Custom Build - Building the include file from npfnt.sys +WkspDir=. +InputPath=.\Npfnt.h + +"Npfnt.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(WkspDir)\..\bin2c\BIN2C.exe binaries\npfnt.sys NpfNT NpfNT + +# End Custom Build + +!ELSEIF "$(CFG)" == "StaticWinpcapOem - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +USERDEP__NPFNT="$(WkspDir)\binaries\npfnt.sys" +# Begin Custom Build - Building the include file from npfnt.sys +WkspDir=. +InputPath=.\Npfnt.h + +"Npfnt.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(WkspDir)\..\bin2c\BIN2C.exe binaries\npfnt.sys NpfNT NpfNT + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\Packet2k.h + +!IF "$(CFG)" == "StaticWinpcapOem - Win32 Release" + +# PROP Ignore_Default_Tool 1 +USERDEP__PACKE="$(WkspDir)\binaries\packet2k.dll" +# Begin Custom Build - Building the include file from packet2k.dll +WkspDir=. +InputPath=.\Packet2k.h + +"Packet2k.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(WkspDir)\..\bin2c\BIN2C.exe binaries\Packet2k.dll Packet2k Packet2k + +# End Custom Build + +!ELSEIF "$(CFG)" == "StaticWinpcapOem - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +USERDEP__PACKE="$(WkspDir)\binaries\packet2k.dll" +# Begin Custom Build - Building the include file from packet2k.dll +WkspDir=. +InputPath=.\Packet2k.h + +"Packet2k.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(WkspDir)\..\bin2c\BIN2C.exe binaries\Packet2k.dll Packet2k Packet2k + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\PacketNT.h + +!IF "$(CFG)" == "StaticWinpcapOem - Win32 Release" + +USERDEP__PACKET="$(WkspDir)\binaries\packetnt.dll" +# Begin Custom Build - Building the include file from packetnt.dll +WkspDir=. +InputPath=.\PacketNT.h + +"PacketNT.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(WkspDir)\..\bin2c\BIN2C.exe binaries\Packetnt.dll PacketNT PacketNT + +# End Custom Build + +!ELSEIF "$(CFG)" == "StaticWinpcapOem - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +USERDEP__PACKET="$(WkspDir)\binaries\packetnt.dll" +# Begin Custom Build - Building the include file from packetnt.dll +WkspDir=. +InputPath=.\PacketNT.h + +"PacketNT.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(WkspDir)\..\bin2c\BIN2C.exe binaries\Packetnt.dll PacketNT PacketNT + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\pch.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# Begin Source File + +SOURCE=.\resrc1.h +# End Source File +# Begin Source File + +SOURCE=.\Security.h +# End Source File +# Begin Source File + +SOURCE=.\version.h +# End Source File +# Begin Source File + +SOURCE=.\WinpcapOem.h +# End Source File +# End Group +# Begin Group "Wpcap Files" + +# PROP Default_Filter "" +# Begin Group "Wpcap Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\bpf_dump.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\bpf_image.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\etherent.c +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\fad-win32.c" +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\gencode.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\grammar.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\inet.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\nametoaddr.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\optimize.c +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-new.c" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-remote.c" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-win32.c" +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\pcap.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\savefile.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\scanner.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\sockutils.c +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\Win32-Extensions\Win32-Extensions.c" +# End Source File +# End Group +# Begin Group "Wpcap Include Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\acconfig.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\arcnet.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\atmuni31.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\ethertype.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\gencode.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\llc.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\nlpid.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-bpf.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-dag.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-dos.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-int.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-namedb.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-nit.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-pf.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-remote.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-septel.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\pcap-stdinc.h" +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\pcap.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\pcap1.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\pf.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\ppp.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\winpcap\wpcap\libpcap\remote-ext.h" +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\sll.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\sockutils.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\sunatmpos.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\tokdefs.h +# End Source File +# End Group +# End Group +# End Target +# End Project diff --git a/winpcap_oem/OEM/WinpcapOem/StaticWinpcapOem.dsw b/winpcap_oem/OEM/WinpcapOem/StaticWinpcapOem.dsw new file mode 100644 index 00000000..94ba7a53 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/StaticWinpcapOem.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "StaticWinpcapOem"=.\StaticWinpcapOem.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/winpcap_oem/OEM/WinpcapOem/WinPcapOem.cpp b/winpcap_oem/OEM/WinpcapOem/WinPcapOem.cpp new file mode 100644 index 00000000..61cf3a88 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/WinPcapOem.cpp @@ -0,0 +1,1748 @@ +/* + * Copyright 2015 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Riverbed Technology nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include "Packet32.h" +#include "WpcapNames.h" +#include "WinpcapOem.h" +#include "resource.h" +#include "WoemDebug.h" + +#ifdef TNT_BUILD +#include "Security.h" +#endif + +HANDLE g_hGlobalMutex = NULL; +HANDLE g_hGlobalSemaphore = NULL; +char g_GlobalSemaphoreName[MAX_OBJNAME_LEN]; +char g_DllFullPathNm[MAX_PATH + 16]; +char g_DllFullPathNoNm[MAX_PATH + 16]; +char *g_DllFullPath; +char g_DriverFullPath[MAX_PATH + 16]; +HINSTANCE g_DllHandle = NULL; +char g_LastWoemError[PACKET_ERRSTR_SIZE]; +volatile BOOL g_InitError = FALSE; +BOOL g_IsProcAuthorized = FALSE; +BOOL g_DisableNetMon = FALSE; + +CRITICAL_SECTION g_CritSectionProtectingWoemEnterDll; + +static VOID InitializePacketHandleForDllUnloadHandlesSweep(); +static VOID SweepPacketHandles(); + +//////////////////////////////////////////////////////////////////// +// DLL Entry point +//////////////////////////////////////////////////////////////////// +BOOL APIENTRY DllMain(HINSTANCE Dllh, DWORD Reason, LPVOID lpReserved) +{ + switch(Reason) + { + + case DLL_PROCESS_ATTACH: + + g_DllHandle = Dllh; + InitializeCriticalSection(&g_CritSectionProtectingWoemEnterDll); + InitializePacketHandleForDllUnloadHandlesSweep(); + +#ifdef TNT_BUILD + // + // the version with security enabled doesn't need to be activated with PacketStartOem() + // + g_OemActive = TRUE; +#endif + + break; + + case DLL_PROCESS_DETACH: + + // + // Before trying to tear down any driver, we need to make sure that all the open handles + // to the NPF driver has been closed. The reason for this is quite complex. If there's even + // single open handle to the NPF driver, the driver cannot be unloaded. When you try to stop + // the driver service with the SCM (ControlService), the service will go into the SERVICE_STOP_PENDING + // status until the last handle gets closed. But ControlService returns immediately, way before the service + // has been stopped. + // If after this you call DeleteService, the service is still running and is marked for deletion. When a service + // is marked for deletion, you cannot reinstall it until it gets completely deleted. It's true that when the process + // is killed by the OS, all the open handles are closed (hence the NPF driver is unloaded). But it takes a bit of time + // between when the process is closed (hence the handles are closed) and when the driver is actually unloaded and the service + // deleted. If in the meanwhile someone tries to restart the winpcap-pro based app, the attempt to reinstall the driver + // may fail because the driver is still in the "marked for deletion" status. + // + // What we do here is closing the handles, and then the delete_service function makes sure that the service is stopped before deleting it, + // waiting for a certain amount of time. If by the timeout the service is not stopped, we do not delete the service. + // + SweepPacketHandles(); + WoemLeaveDll(); + + break; + + default: + break; + } + + return TRUE; +} + +//////////////////////////////////////////////////////////////////// +// Function called when a process loads the dll. +// If this is the first time the dll is loaded, we start the driver +// service +//////////////////////////////////////////////////////////////////// +PCHAR getObjectName(PCHAR systemObjectName, UINT strlen) +{ + OSVERSIONINFO osVer; + char TmpName[MAX_OBJNAME_LEN]; + + ZeroMemory(&osVer,sizeof(OSVERSIONINFO)); + osVer.dwOSVersionInfoSize=sizeof(OSVERSIONINFO); + + if (GetVersionEx(&osVer)==0) + { + return NULL; + } + + //Version prior to 2000 does not accept any / character for system object name + //and they does not understand it + if (osVer.dwMajorVersion > 4) + { + _snprintf(TmpName, strlen, "Global\\%s", systemObjectName); + memcpy(systemObjectName, TmpName, strlen); + } + + return systemObjectName; +} + + +static BOOL WoemEnterDllInternal(HINSTANCE DllHandle, char *WoemErrorString); + +#define WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR(_msg) do{strncpy(WoemErrorString, _msg, PACKET_ERRSTR_SIZE - 1); TRACE_MESSAGE(_msg);}while(0) + +BOOL WoemEnterDll(HINSTANCE DllHandle, char *WoemErrorString, ULONG flags) +{ + BOOL returnValue = TRUE; + + TRACE_ENTER("WoemEnterDll"); + + if ((flags & (~PACKET_START_OEM_NO_NETMON)) != 0) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unsupported flags passed as parameter."); + returnValue = FALSE; + } + else + { + EnterCriticalSection(&g_CritSectionProtectingWoemEnterDll); + + if (g_StillToInit) + { + if (flags & PACKET_START_OEM_NO_NETMON) + { + g_DisableNetMon = TRUE; + } + else + { + g_DisableNetMon = FALSE; + } + + returnValue = WoemEnterDllInternal(DllHandle, WoemErrorString); + if (returnValue == TRUE) + { + g_StillToInit = FALSE; + } + } + else + { + if (flags & PACKET_START_OEM_NO_NETMON) + { + if (g_DisableNetMon == FALSE) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Already started WinPcap Professional with support for NetMon. Cannot restart it without NetMon support."); + returnValue = FALSE; + } + } + else + { + if (g_DisableNetMon == TRUE) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Already started WinPcap Professional without support for NetMon. Cannot restart it with NetMon support."); + returnValue = TRUE; + } + } + } + } + + LeaveCriticalSection(&g_CritSectionProtectingWoemEnterDll); + + TRACE_EXIT("WoemEnterDll"); + + return returnValue; +} + + +//////////////////////////////////////////////////////////////////// +// Function called when a process loads the dll. +// If this is the first time the dll is loaded, we start the driver +// service +// +// NOTE: this function has logging/tracing code, do NOT call it +// from within DllMain! +// NOTE: this internal function does not protect the access to +// the global variables (in particular g_hGlobalMutex. +//////////////////////////////////////////////////////////////////// +BOOL WoemEnterDllInternal(HINSTANCE DllHandle, char *WoemErrorString) +{ + SECURITY_DESCRIPTOR sd; + SECURITY_ATTRIBUTES sa; + LONG lold; + char ObjName[MAX_OBJNAME_LEN]; + UINT i; + OSVERSIONINFO osVer; + CHAR osArchitecture[256]; + HKEY environmentKey = NULL; + DWORD keyType; + DWORD bufSize; + HRESULT hr; + BOOL npfDriverIsAlreadyRunning = FALSE; +#ifdef TNT_BUILD + DWORD Result; +#endif + BOOL is64BitOs = FALSE; + BOOL bLoadDriverResult; + BOOL bUseNetMonPacket; + char errorString[PACKET_ERRSTR_SIZE]; + + TRACE_ENTER("WoemEnterDllInternal"); + + errorString[PACKET_ERRSTR_SIZE - 1] = '\0'; + WoemErrorString[PACKET_ERRSTR_SIZE - 1] = '\0'; + +#ifdef TNT_BUILD + + TRACE_MESSAGE("Process bound Woem, checking if the process is authorized..."); + if (!g_IsProcAuthorized) + { + // + Result = WoemGetCurrentProcessAuthorization(WoemErrorString); + + if (Result == WOEM_PROC_AUTHORIZATION_FAILURE) + { + g_IsProcAuthorized = FALSE; + //the error string has been already set by WoemGetCurrentProcessAuthorization + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + + } + else + if (Result == WOEM_PROC_AUTHORIZATION_OK) + { + g_IsProcAuthorized = TRUE; + } + else + { + g_IsProcAuthorized = FALSE; + + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("This version of WinPcap Professional can be only run in conjunction with CACE Technologies Network Toolkit. This program is not recognized as part of The Network Toolkit, and therefore WinPcap Professional will not work."); + + MessageBox(NULL, "This version of WinPcap Professional can be only run in conjunction with CACE Technologies Network Toolkit.\nThis program is not recognized as part of The Network Toolkit, and therefore WinPcap Professional will not work.", "Error", MB_ICONERROR); + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + } +#endif + +#ifndef STATIC_LIB + // + // This should REALLY never happen + // + if(!g_DllHandle) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("NULL DLL Handle"); + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } +#endif + + // + // Get the OS we're running on + // + ZeroMemory(&osVer, sizeof(OSVERSIONINFO)); + osVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + if (GetVersionEx(&osVer) == 0) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to determine OS version"); + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + // + // Get the OS architecture + // + bufSize = sizeof(osArchitecture); + if (RegOpenKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", &environmentKey) != ERROR_SUCCESS + || RegQueryValueEx(environmentKey, "PROCESSOR_ARCHITECTURE", NULL,&keyType,(LPBYTE)&osArchitecture,&bufSize) != ERROR_SUCCESS + || keyType != REG_SZ) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to determine OS architecture"); + + if (environmentKey != NULL) + RegCloseKey(environmentKey); + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + if (_stricmp("x86", osArchitecture) == 0) + { + is64BitOs = FALSE; + } + else + if (_stricmp("AMD64", osArchitecture) == 0) + { + is64BitOs = TRUE; + } + else + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unsupported Operating System architecture (only x86 and AMD64 are supported)"); + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + if(g_hGlobalMutex) + { + // + // This should never happen, but better to be sure... + // + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Double initialization"); + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + // + // Create a Security Descriptor with NULL DACL to turn off all security checks. + // This allows to share the Mutex among different users. + // + InitializeSecurityDescriptor(&sd,SECURITY_DESCRIPTOR_REVISION); + SetSecurityDescriptorDacl(&sd, TRUE, 0, FALSE); + sa.bInheritHandle = FALSE; + sa.lpSecurityDescriptor = &sd; + sa.nLength = sizeof(sa); + + // + // Get the MUTEX + // + _snprintf(ObjName, MAX_OBJNAME_LEN, MUTEX_NAME); + g_hGlobalMutex = CreateMutex(&sa, FALSE, getObjectName(ObjName, MAX_OBJNAME_LEN)); + + if (g_hGlobalMutex == NULL) + { + if (GetLastError() == ERROR_ACCESS_DENIED) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Not enough priviles to create the global mutex."); + } + else + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to create the global mutex."); + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + // + // Try to acquire the ownership of the mutex + // + DWORD result = WaitForSingleObject(g_hGlobalMutex, 10000); + switch(result) + { + case WAIT_FAILED: + + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Error trying to acquire the global mutex."); + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + + case WAIT_TIMEOUT: + + CloseHandle(g_hGlobalMutex); + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Timeout on the global mutex"); + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + + case WAIT_OBJECT_0: + case WAIT_ABANDONED: + break; + + } + + // + // Create a Security Descriptor with NULL DACL to turn off all security checks. + // This allows to share the Semaphore among different users. + // + InitializeSecurityDescriptor(&sd,SECURITY_DESCRIPTOR_REVISION); + SetSecurityDescriptorDacl(&sd, TRUE, 0, FALSE); + sa.bInheritHandle = FALSE; + sa.lpSecurityDescriptor = &sd; + sa.nLength =sizeof(sa); + + // + // Get the semaphore + // + _snprintf(g_GlobalSemaphoreName, MAX_OBJNAME_LEN, SEMAPHORE_NAME); + g_hGlobalSemaphore = CreateSemaphore(&sa, 0, MAX_VALUE_SEMAPHORE, getObjectName(g_GlobalSemaphoreName, MAX_OBJNAME_LEN)); + + if (g_hGlobalSemaphore == NULL) + { + if (GetLastError() == ERROR_ACCESS_DENIED) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Not enough priviles to create the global semaphore."); + } + else + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to create the global semaphore."); + } + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + // + // Check the value of the semaphore + // + if(ReleaseSemaphore(g_hGlobalSemaphore, 1, &lold)==FALSE) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to release the semaphore"); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + if (lold == 0) + { + // + // IF WE ARE HERE, THE DLL IS BEING LOADED FOR THE FIRST TIME. + // + + if (g_DisableNetMon == TRUE) + { + bUseNetMonPacket = FALSE; + } + else + { + if(osVer.dwMajorVersion == 5) + { + // + // Windows 2000, XP, 2003 + // + if (is64BitOs) + { + bUseNetMonPacket = FALSE; + } + else + { + bUseNetMonPacket = TRUE; + } + } + else + { + // + // all the other OSes, including NT4 and Vista + // + bUseNetMonPacket = FALSE; + } + + } + + if(!WoemCreateBinaryNames()) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to create binary names"); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + if (bUseNetMonPacket) + { + g_DllFullPath = g_DllFullPathNm; + } + else + { + g_DllFullPath = g_DllFullPathNoNm; + } + + if(check_if_service_is_running(NPF_DRIVER_NAME) == 0) + { + // + // if the service is running, just skip restarting it + // + TRACE_MESSAGE("The NPF driver (service " NPF_DRIVER_NAME ") is still running, do not reinstall it"); + npfDriverIsAlreadyRunning = TRUE; + } + + // + // Now perform system-dependent operations + // + if(osVer.dwMajorVersion == 4) + { + // + // Windows NT4 + // + + // + // Extract packet.dll to disk + // + if(!WoemSaveResourceToDisk(g_DllHandle, IDP_DLLNT, g_DllFullPath, FALSE)) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to copy the WinPcap Professional files. Administrative privileges are required for this operation."); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + // + // Extract the driver to disk + // + if(!WoemSaveResourceToDisk(g_DllHandle, IDP_DRINT, g_DriverFullPath, FALSE)) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to copy the WinPcap Professional files. Administrative privileges are required for this operation."); + + _unlink(g_DllFullPath); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + } + else if(osVer.dwMajorVersion == 5) + { + BOOL bExtractDllResult; + + // + // Windows 2000, XP, 2003 + // + + if (g_DisableNetMon == FALSE) + { + // + // Install Netmon + // + if(check_if_service_is_present("nm") != 0) + { + hr = HrInstallNetMonProtocol(); + if (hr != S_OK) + { + TRACE_MESSAGE("Warning: unable to load the netmon driver, ndiswan captures will not be available"); + } + } + else + { + // printf("netmon already here!!!\n"); + } + } + + // + // Extract packet.dll to disk, both ones + // + bExtractDllResult = WoemSaveResourceToDisk(g_DllHandle, IDP_DLL2K, g_DllFullPathNm, FALSE); + bExtractDllResult &=WoemSaveResourceToDisk(g_DllHandle, IDP_DLLVISTA, g_DllFullPathNoNm, FALSE); + + if (!bExtractDllResult) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to copy the WinPcap Professional files. Administrative privileges are required for this operation."); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + // + // Extract the driver to disk + // + if (is64BitOs) + { + bLoadDriverResult = WoemSaveResourceToDisk(g_DllHandle, IDP_DRIx64, g_DriverFullPath, TRUE); + } + else + { + bLoadDriverResult = WoemSaveResourceToDisk(g_DllHandle, IDP_DRI2K, g_DriverFullPath, FALSE); + } + + if(!bLoadDriverResult) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to copy the WinPcap Professional files. Administrative privileges are required for this operation."); + + _unlink(g_DllFullPath); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + } + else if(osVer.dwMajorVersion == 6) + { + // + // Windows Vista or Win7 (6.1) + // + + // + // note: this will not work on vista 64 bit!! + // + + // + // Extract packet.dll to disk + // + if(!WoemSaveResourceToDisk(g_DllHandle, IDP_DLLVISTA, g_DllFullPath, FALSE)) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to copy the WinPcap Professional files. Administrative privileges are required for this operation."); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + // + // Extract the driver to disk + // + // + // Extract the driver to disk + // + if (is64BitOs) + { + bLoadDriverResult = WoemSaveResourceToDisk(g_DllHandle, IDP_DRIx64, g_DriverFullPath, TRUE); + } + else + { + bLoadDriverResult = WoemSaveResourceToDisk(g_DllHandle, IDP_DRI2K, g_DriverFullPath, FALSE); + } + if(!bLoadDriverResult) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("Unable to copy the WinPcap Professional files. Administrative privileges are required for this operation."); + + _unlink(g_DllFullPathNm); + _unlink(g_DllFullPathNoNm); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + } + + if (!npfDriverIsAlreadyRunning) + { + + // + // Create the driver service + // + if(create_driver_service(NPF_DRIVER_NAME, + NPF_SERVICE_DESC, + NPF_DRIVER_COMPLETE_PATH, + errorString, PACKET_ERRSTR_SIZE) == -1) + { + _snprintf(WoemErrorString, PACKET_ERRSTR_SIZE - 1, "unable to create the packet driver service: %s", errorString); + TRACE_MESSAGE("%s", WoemErrorString); + + _unlink(g_DllFullPathNm); + _unlink(g_DllFullPathNoNm); + _unlink(g_DriverFullPath); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + // + // Load the driver + // + if(start_service(NPF_DRIVER_NAME, errorString, PACKET_ERRSTR_SIZE) == -1) + { + + _snprintf(WoemErrorString, PACKET_ERRSTR_SIZE - 1, "unable to start the packet driver service: %s", errorString); + TRACE_MESSAGE("%s", WoemErrorString); + + delete_service(NPF_DRIVER_NAME); + _unlink(g_DllFullPathNm); + _unlink(g_DllFullPathNoNm); + WoemDeleteDriverBinary(g_DriverFullPath, is64BitOs); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + // + // Wait until the service is running + // + i = 0; + while(TRUE) + { + if(check_if_service_is_running(NPF_DRIVER_NAME) == 0) + { + break; + } + + i++; + if(i == 300) + { + WOEM_ENTER_DLL_TRACE_AND_COPY_ERROR("timeout while starting the packet driver"); + + delete_service(NPF_DRIVER_NAME); + _unlink(g_DllFullPath); + + WoemDeleteDriverBinary(g_DriverFullPath, is64BitOs); + + _unlink(g_DriverFullPath); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + + } + + Sleep(100); + } + + } + // + // We've loaded the driver, we can delete its binary + // +// +// MCAFEE +// +// WoemDeleteDriverBinary(g_DriverFullPath, is64BitOs); + } + else + { + if (g_DisableNetMon == TRUE) + { + bUseNetMonPacket = FALSE; + } + else + { + if(osVer.dwMajorVersion == 5) + { + // + // Windows 2000, XP, 2003 + // + if (is64BitOs) + { + bUseNetMonPacket = FALSE; + } + else + { + bUseNetMonPacket = TRUE; + } + } + else + { + // + // all the other OSes, including NT4 and Vista + // + bUseNetMonPacket = FALSE; + } + + } + + if(!WoemCreateBinaryNames()) + { + delete_service(NPF_DRIVER_NAME); + _unlink(g_DllFullPathNm); + _unlink(g_DllFullPathNoNm); + + WoemDeleteDriverBinary(g_DriverFullPath, is64BitOs); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + if (bUseNetMonPacket) + { + g_DllFullPath = g_DllFullPathNm; + } + else + { + g_DllFullPath = g_DllFullPathNoNm; + } + } + + // + // Load packet.dll and intercept all the calls + // + if(!LoadPacketDll(g_DllFullPath, WoemErrorString)) + { + delete_service(NPF_DRIVER_NAME); + _unlink(g_DllFullPathNm); + _unlink(g_DllFullPathNoNm); + WoemDeleteDriverBinary(g_DriverFullPath, is64BitOs); + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + TRACE_EXIT("WoemEnterDllInternal"); + return FALSE; + } + + // + // Register an unload handler with packet.dll + // +#ifdef STATIC_LIB + RegisterPacketUnloadHandler(WoemLeaveDll); +#endif // STATIC_LIB + + // + // Schedule the deletion of the dll. It will go away at the next reboot + // + DeleteDll(g_DllFullPathNoNm); + DeleteDll(g_DllFullPathNm); + + // + // Done. We can release the MUTEX + // + ReleaseMutex(g_hGlobalMutex); + + TRACE_EXIT("WoemEnterDllInternal"); + return TRUE; +} + +//////////////////////////////////////////////////////////////////// +// Function called when a process loads the dll. +// +// NOTE: we cannot use tracing in this function, since it's called +// in the context of DllMain (MSDN clearly states that only the +// functions exported by kernel32.dll can be called within the +// DllMain). +//////////////////////////////////////////////////////////////////// +BOOL WoemLeaveDll() +{ + DWORD result; + BOOLEAN retry; +/// MCAFEE +/// + BOOLEAN is64BitOs = FALSE; + CHAR osArchitecture[256]; + HKEY environmentKey = NULL; + DWORD keyType; + DWORD bufSize; + + bufSize = sizeof(osArchitecture); + if (RegOpenKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", &environmentKey) != ERROR_SUCCESS + || RegQueryValueEx(environmentKey, "PROCESSOR_ARCHITECTURE", NULL,&keyType,(LPBYTE)&osArchitecture,&bufSize) != ERROR_SUCCESS + || keyType != REG_SZ) + { + // + // we ignore the error and assume it's x86 + // + } + else + if (_stricmp("AMD64", osArchitecture) == 0) + { + is64BitOs = TRUE; + } + + if (environmentKey != NULL) + { + RegCloseKey(environmentKey); + } + +/// +/// MCAFEE +/// + + // + // Try to acquire the ownership of the mutex + // + retry = TRUE; + do + { + DWORD result=WaitForSingleObject(g_hGlobalMutex, 10000); + switch(result) + { + case WAIT_FAILED: + + if(g_hGlobalMutex != 0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + return FALSE; + + case WAIT_TIMEOUT: + + break; + + default: + retry = FALSE; + break; + } + } while (retry); + + + // + // See if the semaphore count is 1 + // + if(WaitForSingleObject(g_hGlobalSemaphore, 0) == WAIT_FAILED) + { + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + return FALSE; + } + + // + // Now check if we would block on the semaphore + // + result = WaitForSingleObject(g_hGlobalSemaphore, 0); + + switch (result) + { + case WAIT_TIMEOUT: + + // + // IF WE ARE HERE, THE DLL IS BEING UNLOADED FOR THE LAST TIME. + // + + delete_service(NPF_DRIVER_NAME); + +/// +/// MCAFEE +/// + WoemDeleteDriverBinary(g_DriverFullPath, is64BitOs); +/// +/// MCAFEE +/// + +// +// Old registry based WinPcap names +// +// WoemDeleteNameRegistryEntries(); + + break; + + case WAIT_FAILED: + + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + return FALSE; + + case WAIT_OBJECT_0: + if (ReleaseSemaphore(g_hGlobalSemaphore,1,NULL) == FALSE) + { + ReleaseMutex(g_hGlobalMutex); + + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + return FALSE; + } + + break; + } + + // + // Release the MUTEX + // + ReleaseMutex(g_hGlobalMutex); + + // + // We're done, close the handles + // + if(g_hGlobalMutex!=0) + { + CloseHandle(g_hGlobalMutex); + g_hGlobalMutex = NULL; + + } + if (g_hGlobalSemaphore!=0) + { + CloseHandle(g_hGlobalSemaphore); + g_hGlobalSemaphore = NULL; + } + + return TRUE; +} + +#if 0 +// +// Old registry based WinPcap names +// + +//////////////////////////////////////////////////////////////////// +// Create the temporary registry key with the name that all the +// WinPcap components will use +//////////////////////////////////////////////////////////////////// +BOOL WoemCreateNameRegistryEntries() +{ + HKEY WinpcapKey; + OSVERSIONINFO osVer; + + ZeroMemory(&osVer,sizeof(OSVERSIONINFO)); + osVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + if (GetVersionEx(&osVer)==0) + { + TRACE_MESSAGE("Impossible to retrieve the OS version Info"); + return FALSE; + } + + // + // Do a cleanup, just to be sure + // + RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY); + + // + // Create the global WinPcap key + // + if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, + WINPCAP_INSTANCE_KEY, + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, + NULL, + &WinpcapKey, + 0) != ERROR_SUCCESS) + { + return FALSE; + } + + // + // Add subkeys with the strings + // + + // + // NpfDriverName (e.g. "NPF") -- HHH + // + if(RegSetValueEx(WinpcapKey, + NPF_DRIVER_NAME_REG_KEY, + 0, + REG_SZ, + (LPBYTE)NPF_DRIVER_NAME, + sizeof(NPF_DRIVER_NAME)) != ERROR_SUCCESS) + { + RegCloseKey(WinpcapKey); + + RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY); + return FALSE; + } + + // + // NpfServiceDescription (e.g. "WinPcap Packet Driver ( NPF )") -- FFF + // + if(RegSetValueEx(WinpcapKey, + NPF_SERVICE_DESC_REG_KEY, + 0, + REG_SZ, + (LPBYTE)NPF_SERVICE_DESC, + sizeof(NPF_SERVICE_DESC)) != ERROR_SUCCESS) + { + RegCloseKey(WinpcapKey); + + RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY); + return FALSE; + } + + // + // NpfDeviceNamesPrefix (e.g. "NPF_") -- AAA + // + if(RegSetValueEx(WinpcapKey, + NPF_DEVICES_PREFIX_REG_KEY, + 0, + REG_SZ, + (LPBYTE)NPF_DEVICE_NAMES_PREFIX, + sizeof(NPF_DEVICE_NAMES_PREFIX)) != ERROR_SUCCESS) + { + RegCloseKey(WinpcapKey); + + RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY); + return FALSE; + } + +#if 0 + // npf_user_events_names + + memset(KeyValBuf, sizeof(KeyValBuf), 0); + memset(KeyValBufW, sizeof(KeyValBufW), 0); + + _snwprintf(KeyValBufW, + sizeof(KeyValBufW) / sizeof(WCHAR) - 1, + L"%ws0000000000", + g_NpfDriverNameIdW); + + if(RegSetValueEx(WinpcapKey, + NPF_USER_EVENTS_NAMES_REG_KEY, + 0, + REG_SZ, + (LPBYTE)KeyValBufW, + (wcslen(KeyValBufW) + 1) * sizeof(WCHAR)) != ERROR_SUCCESS) + { + RegCloseKey(WinpcapKey); + + RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY); + return FALSE; + } +#endif + + // + // NpfEventsNames (e.g. "NPF") -- BBB + // + if(RegSetValueEx(WinpcapKey, + NPF_EVENTS_NAMES_REG_KEY, + 0, + REG_SZ, + (LPBYTE)NPF_EVENTS_NAMES, + sizeof(NPF_EVENTS_NAMES)) != ERROR_SUCCESS) + { + RegCloseKey(WinpcapKey); + + RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY); + return FALSE; + } + + // + // NdiswanAdapterName (e.g. "\\Device\\NPF_GenericDialupAdapter") -- CCC + // + if(RegSetValueEx(WinpcapKey, + NPF_FAKE_NDISWAN_ADAPTER_NAME_REG_KEY, + 0, + REG_SZ, + (LPBYTE)FAKE_NDISWAN_ADAPTER_NAME, + sizeof(FAKE_NDISWAN_ADAPTER_NAME)) != ERROR_SUCCESS) + { + RegCloseKey(WinpcapKey); + + RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY); + return FALSE; + } + + // + // NdiswanAdapterDescription (e.g. "Adapter for generic dialup and VPN capture") -- DDD + // + if(RegSetValueEx(WinpcapKey, + NPF_FAKE_NDISWAN_ADAPTER_DESC_REG_KEY, + 0, + REG_SZ, + (LPBYTE)FAKE_NDISWAN_ADAPTER_DESCRIPTION, + sizeof(FAKE_NDISWAN_ADAPTER_DESCRIPTION)) != ERROR_SUCCESS) + { + RegCloseKey(WinpcapKey); + + RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY); + return FALSE; + } + + // + // NpfDriverCompletePath (e.g. "system32\\drivers\npf.sys") -- GG + // + if(RegSetValueEx(WinpcapKey, + NPF_DRIVER_COMPLETE_PATH_REG_KEY, + 0, + REG_SZ, + (LPBYTE)NPF_DRIVER_COMPLETE_PATH, + sizeof(NPF_DRIVER_COMPLETE_PATH)) != ERROR_SUCCESS) + { + RegCloseKey(WinpcapKey); + + RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY); + return FALSE; + } + + // + // NpfDriverCompleteDevicePrefix (e.g. "\\Device\\NPF_") -- III + // + if(RegSetValueEx(WinpcapKey, + NPF_DRIVER_COMPLETE_DEVICE_PREFIX_REG_KEY, + 0, + REG_SZ, + (LPBYTE)NPF_DRIVER_COMPLETE_DEVICE_PREFIX, + sizeof(NPF_DRIVER_COMPLETE_DEVICE_PREFIX)) != ERROR_SUCCESS) + { + RegCloseKey(WinpcapKey); + + RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY); + return FALSE; + } + + RegCloseKey(WinpcapKey); + + return TRUE; +} +#endif + +//////////////////////////////////////////////////////////////////// +// Create the binaries names according to the name we have +//////////////////////////////////////////////////////////////////// +BOOL WoemCreateBinaryNames() +{ + //TODO we should try to put the files in three places: + // - current directory + // - system32 + // - temp directory + UINT GsdRes; + char WinDir[MAX_PATH + 16]; + char SysDir[MAX_PATH + 16]; + + // + // Get the location of the system folder to create the complete paths + // + GsdRes = GetSystemDirectory(SysDir, sizeof(SysDir)); + if(GsdRes == 0 || GsdRes == sizeof(SysDir)) + { + return FALSE; + } + +// GsdRes = GetSystemWindowsDirectory(WinDir, sizeof(WinDir)); +// if(GsdRes == 0 || GsdRes == sizeof(WinDir)) +// { +// return FALSE; +// } + + // + // NOTE: this is a patch to a problem with GetWindowsDirectory: as explained in the MSDN + // docs, this API does NOT always return the windows folder like "c:\windows". On TS systems + // in some particular conditions (e.g. we saw it on a win2003-x64 machine) it returns a private + // user folder (c:\documents and settinfs\user...). The right API is GetSystemWindowsDirectoryr, which + // is not available on NT4. The MSDN docs suggests for NT4 to use GetSystemDirectory and trim system32 at + // the end. We use this trick on every os (even if it's sufggested for NT4 only) beacuse in any case we have + // hardcoded the system32 part in our NPF_ strings in wpcap_names.h (and we just write "system32\drivers\drivername.sys" + // for the path of the driver in the registry, not the full path). + // GV 20060817 + // + + CopyMemory(WinDir, SysDir, sizeof(WinDir)); + + // + // trim the "system32" part + // + if (strlen(WinDir) < strlen("\\system32")) + { + return FALSE; + } + + char *SupposedSystem32String; + + SupposedSystem32String = WinDir + strlen(WinDir) - strlen("\\system32"); + + if (_stricmp(SupposedSystem32String, "\\system32") != 0) + { + return FALSE; + } + + // + // found it, just terminate it there + // + SupposedSystem32String[0] = '\0'; + + + // + // Created the strings that we'll use to build the registry keys values + // and load the components + // + + _snprintf(g_DllFullPathNm, + sizeof(g_DllFullPathNm) - 1, + "%s\\%swoem_nm.tmp", + SysDir, + NPF_DRIVER_NAME); + + _snprintf(g_DllFullPathNoNm, + sizeof(g_DllFullPathNoNm) - 1, + "%s\\%swoem.tmp", + SysDir, + NPF_DRIVER_NAME); + + _snprintf(g_DriverFullPath, + sizeof(g_DriverFullPath) - 1, + "%s\\%s", + WinDir, + NPF_DRIVER_COMPLETE_PATH); + + return TRUE; +} + +// +// note: this function has actually nothing to +BOOL WoemDeleteDriverBinary(char* FileName, BOOL bDisableFsRedirector) +{ +#ifndef _AMD64_ + PVOID OldFsRedirectorValue; + HMODULE hKernel32Dll; + Wow64DisableWow64FsRedirectionHandler DisableFsRedirector; + Wow64RevertWow64FsRedirectionHandler RevertFsRedirector; + + if (bDisableFsRedirector) + { + // + // load the FS redirector function dynamically + // + hKernel32Dll = LoadLibrary("kernel32.dll"); + + if (hKernel32Dll == NULL) + { + return FALSE; + } + + DisableFsRedirector = + (Wow64DisableWow64FsRedirectionHandler)GetProcAddress( + hKernel32Dll, + "Wow64DisableWow64FsRedirection"); + + RevertFsRedirector = + (Wow64RevertWow64FsRedirectionHandler)GetProcAddress( + hKernel32Dll, + "Wow64RevertWow64FsRedirection"); + + if (DisableFsRedirector == NULL || RevertFsRedirector == NULL) + { + FreeLibrary(hKernel32Dll); + return FALSE; + } + + if (DisableFsRedirector(&OldFsRedirectorValue) == FALSE) + { + FreeLibrary(hKernel32Dll); + return FALSE; + } + } +#endif + + _unlink(FileName); + +#ifndef _AMD64_ + if (bDisableFsRedirector) + { + + if (RevertFsRedirector(OldFsRedirectorValue) == FALSE) + { + // + // trace me + // + return FALSE; + } + + FreeLibrary(hKernel32Dll); + } +#endif + + return TRUE; +} + +#if 0 +// +// Old registry based WinPcap names +// + +//////////////////////////////////////////////////////////////////// +// Delete the temporary registry key with the name that all the +// WinPcap components will use +//////////////////////////////////////////////////////////////////// +BOOL WoemDeleteNameRegistryEntries() +{ + if(RegDeleteKey(HKEY_LOCAL_MACHINE, WINPCAP_INSTANCE_KEY) != ERROR_SUCCESS) + return FALSE; + else + return TRUE; +} + +#endif + +CRITICAL_SECTION g_PacketHandleSweepCriticalSection; +typedef struct _HANDLE_ITEM +{ + struct _HANDLE_ITEM *Next; + HANDLE hFile; +} + HANDLE_ITEM, *PHANDLE_ITEM; + +PHANDLE_ITEM g_HandleList; + +// +// Initialize the global list of open handles to the NPF driver +// +// Please see the long note in DllMain for the reason why we need +// this hack. +// +VOID InitializePacketHandleForDllUnloadHandlesSweep() +{ + TRACE_ENTER("InitializePacketHandleForDllUnloadHandlesSweep"); + g_HandleList = NULL; + InitializeCriticalSection(&g_PacketHandleSweepCriticalSection); + TRACE_EXIT("InitializePacketHandleForDllUnloadHandlesSweep"); +} + +// +// Register the open handle to the NPF driver in our global list +// The function returns TRUE if the registration was successful +// (or the ADAPTER instance is not related to an NPF adapter) +// +// Please see the long note in DllMain for the reason why we need +// this hack. +// +BOOL RegisterPacketHandleForDllUnloadHandlesSweep(LPADAPTER pAdapter) +{ + BOOL result = TRUE; + PHANDLE_ITEM pItem; + + TRACE_ENTER("RegisterPacketHandleForDllUnloadHandlesSweep"); + if (pAdapter->Flags == INFO_FLAG_NDIS_ADAPTER && pAdapter->hFile != NULL && pAdapter->hFile != INVALID_HANDLE_VALUE) + { + pItem = (PHANDLE_ITEM)GlobalAlloc(GPTR, sizeof(HANDLE_ITEM)); + if (pItem == NULL) + { + result = FALSE; + } + else + { + pItem->hFile = pAdapter->hFile; + EnterCriticalSection(&g_PacketHandleSweepCriticalSection); + pItem->Next = g_HandleList; + g_HandleList = pItem; + LeaveCriticalSection(&g_PacketHandleSweepCriticalSection); + } + } + + TRACE_EXIT("RegisterPacketHandleForDllUnloadHandlesSweep"); + return result; +} + +// +// Deregister the open handle to the NPF driver from our global list +// Please note that this function does NOT close the handle, it +// just removes it from the global list +// +// Please see the long note in DllMain for the reason why we need +// this hack. +// +VOID DeregisterPacketHandleForDllUnloadHandlesSweep(LPADAPTER pAdapter) +{ + PHANDLE_ITEM pCursor, pPrev; + TRACE_ENTER("DeregisterPacketHandleForDllUnloadHandlesSweep"); + + if (pAdapter->Flags == INFO_FLAG_NDIS_ADAPTER && pAdapter->hFile != NULL && pAdapter->hFile != INVALID_HANDLE_VALUE) + { + pPrev = NULL; + + EnterCriticalSection(&g_PacketHandleSweepCriticalSection); + + pCursor = g_HandleList; + while(pCursor != NULL) + { + if (pCursor->hFile == pAdapter->hFile) + { + if (pPrev != NULL) + { + pPrev->Next = pCursor->Next; + } + else + { + g_HandleList = pCursor->Next; + } + + GlobalFree(pCursor); + break; + } + + pPrev = pCursor; + pCursor = pCursor->Next; + } + LeaveCriticalSection(&g_PacketHandleSweepCriticalSection); + } + + TRACE_EXIT("DeregisterPacketHandleForDllUnloadHandlesSweep"); + +} + +// +// Close all the open handles to the NPF driver that have been registered +// with RegisterPacketHandleForDllUnloadHandlesSweep +// +// Please see the long note in DllMain for the reason why we need +// this hack. +// +VOID SweepPacketHandles() +{ + PHANDLE_ITEM pCursor, pNext; + + TRACE_ENTER("SweepPacketHandles"); + + // + // NOTE: there is a possibility of a deadlock here. + // if the application dies when we were calling a (De)RegisterHandle + // and the criticalsection was held, we would deadlock here. + // + // What we do here is not locking at all. + // In any case, g_HandleList always contains valid elements (the Deregister removes the item + // after having updated the list) + // + // + //EnterCriticalSection(&g_PacketHandleSweepCriticalSection); + + pCursor = g_HandleList; + + while(pCursor != NULL) + { + pNext = pCursor->Next; + + (VOID)CloseHandle(pCursor->hFile); + GlobalFree(pCursor); + pCursor = pNext; + } + + //LeaveCriticalSection(&g_PacketHandleSweepCriticalSection); + + TRACE_EXIT("SweepPacketHandles"); + +} diff --git a/winpcap_oem/OEM/WinpcapOem/WinPcapOem.rc2 b/winpcap_oem/OEM/WinpcapOem/WinPcapOem.rc2 new file mode 100644 index 00000000..9a441624 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/WinPcapOem.rc2 @@ -0,0 +1,46 @@ +// +// WinPcapOem.rc2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +#include "..\..\version.h" +#include "..\..\..\winpcap\common\WpcapNames.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + PRODUCTVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", WINPCAPOEM_COMPANY_NAME + VALUE "FileDescription", "packet.dll Wrapper Dynamic Link Library" + VALUE "FileVersion", WINPCAPOEM_VER_STRING + VALUE "InternalName", WINPCAPOEM_PRODUCT_NAME + VALUE "LegalCopyright", WINPCAPOEM_COPYRIGHT_STRING + VALUE "LegalTrademarks", "" + VALUE "OriginalFilename", "packet.dll" + VALUE "ProductName", WINPCAPOEM_PRODUCT_NAME " (" NPF_DRIVER_NAME ")" + VALUE "ProductVersion", WINPCAPOEM_VER_STRING + VALUE "Build Description", WINPCAPOEM_BUILD_DESCRIPTION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/winpcap_oem/OEM/WinpcapOem/WinpcapOem.def b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.def new file mode 100644 index 00000000..903b0be6 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.def @@ -0,0 +1,37 @@ +LIBRARY packet + +EXPORTS + PacketGetVersion + PacketGetDriverVersion + PacketOpenAdapter + PacketSendPacket + PacketSendPackets + PacketAllocatePacket + PacketInitPacket + PacketFreePacket + PacketReceivePacket + PacketCloseAdapter + PacketSetHwFilter + PacketGetAdapterNames + PacketRequest + PacketSetBuff + PacketSetBpf + PacketSetSnapLen + PacketGetStats + PacketGetStatsEx + PacketGetNetType + PacketSetReadTimeout + PacketSetMode + PacketSetNumWrites + PacketGetNetInfoEx + PacketSetMinToCopy + PacketGetReadEvent + PacketStopDriver + PacketSetDumpName + PacketSetDumpLimits + PacketIsDumpEnded + PacketSetLoopbackBehavior + PacketGetAirPcapHandle + PacketStartOem + PacketStartOemEx + diff --git a/winpcap_oem/OEM/WinpcapOem/WinpcapOem.dsp b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.dsp new file mode 100644 index 00000000..03fd923c --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.dsp @@ -0,0 +1,288 @@ +# Microsoft Developer Studio Project File - Name="WinpcapOem" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=WinpcapOem - Win32 Debug_Security +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "WinpcapOem.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "WinpcapOem.mak" CFG="WinpcapOem - Win32 Debug_Security" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "WinpcapOem - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "WinpcapOem - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "WinpcapOem - Win32 Debug_Security" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "WinpcapOem - Win32 Release_Security" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "WinpcapOem - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WinpcapOem_EXPORTS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\\" /I "..\..\..\winpcap\common" /I "..\..\..\common" /D "NDEBUG" /D "_MBCS" /D "_USRDLL" /D "WinpcapOem_EXPORTS" /D "WIN32" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 npptools.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Release/Packet.dll" /libpath:"..\..\WinpcapOem\Release\\" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Cmds=postbuild_release.bat +# End Special Build Tool + +!ELSEIF "$(CFG)" == "WinpcapOem - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WinpcapOem_EXPORTS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".\\" /I "..\..\..\winpcap\common" /I "..\..\..\common" /D "_DEBUG" /D "_MBCS" /D "_USRDLL" /D "WinpcapOem_EXPORTS" /D "WIN32" /D "_WINDOWS" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib npptools.lib /nologo /dll /debug /machine:I386 /out:"Debug/Packet.dll" /pdbtype:sept +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Desc=Copying the OEM packet.lib in the winpcap folder +PostBuild_Cmds=postbuild.bat +# End Special Build Tool + +!ELSEIF "$(CFG)" == "WinpcapOem - Win32 Debug_Security" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_Security" +# PROP BASE Intermediate_Dir "Debug_Security" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_Security" +# PROP Intermediate_Dir "Debug_Security" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".\\" /D "_DEBUG" /D "_MBCS" /D "_USRDLL" /D "WinpcapOem_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "TNT_BUILD" /FR /FD /GZ /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".\\" /I "..\..\..\winpcap\common" /I "..\..\..\common" /D "_DEBUG" /D "_MBCS" /D "_USRDLL" /D "WinpcapOem_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "TNT_BUILD" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib npptools.lib /nologo /dll /debug /machine:I386 /out:"Debug/Packet.dll" /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib npptools.lib /nologo /dll /debug /machine:I386 /out:"Debug_Security/Packet.dll" /pdbtype:sept +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Cmds=postbuild.bat +# End Special Build Tool + +!ELSEIF "$(CFG)" == "WinpcapOem - Win32 Release_Security" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_Security" +# PROP BASE Intermediate_Dir "Release_Security" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_Security" +# PROP Intermediate_Dir "Release_Security" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I ".\\" /D "NDEBUG" /D "_MBCS" /D "_USRDLL" /D "WinpcapOem_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "TNT_BUILD" /FD /c +# SUBTRACT BASE CPP /YX /Yc /Yu +# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\winpcap\common" /I ".\\" /I "..\..\..\common" /D "NDEBUG" /D "_MBCS" /D "_USRDLL" /D "WinpcapOem_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "TNT_BUILD" /FR /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 npptools.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Release/Packet.dll" /libpath:"..\..\WinpcapOem\Release\\" +# ADD LINK32 npptools.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Release_Security/Packet.dll" /libpath:"..\..\WinpcapOem\Release\\" +# Begin Special Build Tool +SOURCE="$(InputPath)" +PostBuild_Cmds=postbuild.bat +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "WinpcapOem - Win32 Release" +# Name "WinpcapOem - Win32 Debug" +# Name "WinpcapOem - Win32 Debug_Security" +# Name "WinpcapOem - Win32 Release_Security" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Crypto.cpp +# End Source File +# Begin Source File + +SOURCE=.\PacketWrapper.cpp +# End Source File +# Begin Source File + +SOURCE=.\Resources.cpp +# End Source File +# Begin Source File + +SOURCE=.\Security.cpp +# End Source File +# Begin Source File + +SOURCE=.\SerivcesInstallers.cpp +# End Source File +# Begin Source File + +SOURCE=.\WinPcapOem.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\Crypto.h +# End Source File +# Begin Source File + +SOURCE=.\idls.h +# End Source File +# Begin Source File + +SOURCE=.\netcfgn.h +# End Source File +# Begin Source File + +SOURCE=.\netcfgx.h +# End Source File +# Begin Source File + +SOURCE=.\NetMonInstaller.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\Common\Packet32.h +# End Source File +# Begin Source File + +SOURCE=.\pch.h +# End Source File +# Begin Source File + +SOURCE=.\Security.h +# End Source File +# Begin Source File + +SOURCE=.\version.h +# End Source File +# Begin Source File + +SOURCE=.\WinpcapOem.h +# End Source File +# Begin Source File + +SOURCE=.\WoemDebug.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\Common\WpcapNames.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\Instructions.txt +# End Source File +# Begin Source File + +SOURCE=.\binaries\npf2k.sys +# End Source File +# Begin Source File + +SOURCE=.\binaries\npfnt.sys +# End Source File +# Begin Source File + +SOURCE=.\binaries\Packet2k.dll +# End Source File +# Begin Source File + +SOURCE=.\Packet2k.dll +# End Source File +# Begin Source File + +SOURCE=.\binaries\Packetnt.dll +# End Source File +# Begin Source File + +SOURCE=.\WinpcapOem.def +# End Source File +# Begin Source File + +SOURCE=.\WinPcapOem.rc +# End Source File +# End Target +# End Project diff --git a/winpcap_oem/OEM/WinpcapOem/WinpcapOem.dsw b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.dsw new file mode 100644 index 00000000..dcfac4d3 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.dsw @@ -0,0 +1,41 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "PacketAndWan"=..\..\..\winpcap\packetNtx\Dll\Project\PacketAndWan.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "WinpcapOem"=.\WinpcapOem.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/winpcap_oem/OEM/WinpcapOem/WinpcapOem.h b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.h new file mode 100644 index 00000000..1403403c --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.h @@ -0,0 +1,120 @@ +/* + * Copyright 2015 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Riverbed Technology nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __WINPCAP_OEM_H_E4C69242_4757_4139_A7E4_CA06F37A5B73 +#define __WINPCAP_OEM_H_E4C69242_4757_4139_A7E4_CA06F37A5B73 + + + +//////////////////////////////////////////////////////////////////// +// Constants and names +//////////////////////////////////////////////////////////////////// + +#define MUTEX_NAME "WinPcapOEM-MutexProtectMultipleInstances" +#define SEMAPHORE_NAME "WinPcapOEM-SemaphoreProtectMultipleInstances-" NPF_DRIVER_NAME +#define MAX_VALUE_SEMAPHORE 65535 +#define MAX_OBJNAME_LEN 1024 +#define PACKET_ERRSTR_SIZE 1024 + +//////////////////////////////////////////////////////////////////// +// Services-related prototypes +//////////////////////////////////////////////////////////////////// +int delete_service(LPCTSTR ServiceName); +int stop_service(LPCTSTR ServiceName); +int start_service(LPCTSTR ServiceName, char *ErrorString, size_t Length); +int create_driver_service(LPCTSTR ServiceName, LPCTSTR ServiceDescription, LPCTSTR ServicePath, char* ErrorString, size_t Length); +int check_if_service_is_running(LPCTSTR ServiceName); +int check_if_service_is_present(LPCTSTR ServiceName); +int change_start_type_service(LPCTSTR ServiceName, DWORD StartType); +HRESULT HrInstallNetMonProtocol(); +HRESULT HrUninstallNetMonProtocol(); + +//////////////////////////////////////////////////////////////////// +// Packet.dll wrapper prototypes +//////////////////////////////////////////////////////////////////// +BOOL LoadPacketDll(char *PacketDllFileName, char *errorString); +void DeleteDll(char *DllFileName); +BOOL WoemEnterDll(HINSTANCE DllHandle, char *WoemErrorString, ULONG flags); +BOOL WoemLeaveDll(); +#ifdef STATIC_LIB +void RegisterPacketUnloadHandler(void* Handler); +#endif // STATIC_LIB + +//////////////////////////////////////////////////////////////////// +// Global variables +/////////////////////////////////////////////////////////////////// +extern HINSTANCE g_DllHandle; +extern char g_LastWoemError[]; +volatile extern BOOL g_InitError; +volatile extern BOOL g_OemActive; +volatile extern BOOL g_StillToInit; + + +//////////////////////////////////////////////////////////////////// +// Resources handling prototypes +//////////////////////////////////////////////////////////////////// +BOOL WoemSaveResourceToDisk(HINSTANCE hInst, int ResID, char* FileName, BOOL bDisableFsRedirector); +BOOL WoemGetResource(HINSTANCE hInst, int ResID, LPVOID * lpResMem, LPDWORD dwResSize); + +//////////////////////////////////////////////////////////////////// +// Definitions of the Win32 functions to disable/enable FS +// redirectors on WOW64. We need these prototypes because we load +// the functions dynamically. +//////////////////////////////////////////////////////////////////// +typedef WINBASEAPI BOOL (WINAPI *Wow64DisableWow64FsRedirectionHandler)( PVOID *OldValue); +typedef WINBASEAPI BOOL (WINAPI *Wow64RevertWow64FsRedirectionHandler)( PVOID OlValue); + +//////////////////////////////////////////////////////////////////// +// Function to delete the driver binary, taking care of running +// on win32 or WOW64 +//////////////////////////////////////////////////////////////////// +BOOL WoemDeleteDriverBinary(char* FileName, BOOL bDisableFsRedirector); + +//////////////////////////////////////////////////////////////////// +// Registry and names-related functions +//////////////////////////////////////////////////////////////////// +//BOOL WoemCreateNameRegistryEntries(); +//BOOL WoemDeleteNameRegistryEntries(); +BOOL WoemCreateBinaryNames(); + +//////////////////////////////////////////////////////////////////// +// Functions to register the open handles to NPF in a global list. +// This hack is needed to close all the handles before unloading the +// driver on DllUnload +//////////////////////////////////////////////////////////////////// +typedef struct _ADAPTER *LPADAPTER; + +BOOL RegisterPacketHandleForDllUnloadHandlesSweep(LPADAPTER pAdapter); +VOID DeregisterPacketHandleForDllUnloadHandlesSweep(LPADAPTER pAdapter); + + + +#endif //__WINPCAP_OEM_H_E4C69242_4757_4139_A7E4_CA06F37A5B73 diff --git a/winpcap_oem/OEM/WinpcapOem/WinpcapOem.rc b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.rc new file mode 100644 index 00000000..cba2993b --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.rc @@ -0,0 +1,86 @@ +//Microsoft Developer Studio generated resource script. +// + +#define APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 1 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "resource.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// +// Data +// + +#ifdef _AMD64_ + +IDP_DLL2K RCDATA MOVEABLE PURE "binaries\\x64\\packet2k.dll" +IDP_DLLVISTA RCDATA MOVEABLE PURE "binaries\\x64\\packetVista.dll" +IDP_DRIx64 RCDATA MOVEABLE PURE "binaries\\x64\\npfx64.sys" + +#else +// +// x86 +// +IDP_DLL2K RCDATA MOVEABLE PURE "binaries\\x86\\packet2k.dll" +IDP_DRI2K RCDATA MOVEABLE PURE "binaries\\x86\\npf2k.sys" +IDP_DLLNT RCDATA MOVEABLE PURE "binaries\\x86\\packetnt.dll" +IDP_DRINT RCDATA MOVEABLE PURE "binaries\\x86\\npfnt.sys" +IDP_DLLVISTA RCDATA MOVEABLE PURE "binaries\\x86\\packetVista.dll" +IDP_DRIx64 RCDATA MOVEABLE PURE "binaries\\x64\\npfx64.sys" + +#endif //not _AMD64_ + +HSH_AUTH_PROC RCDATA MOVEABLE PURE "binaries\\tools.bin" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""resource.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""WinPcapOem.rc2""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include "WinPcapOem.rc2" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/winpcap_oem/OEM/WinpcapOem/WinpcapOem.sln b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.sln new file mode 100644 index 00000000..eb70fe45 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.sln @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinpcapOem", "WinpcapOem.vcproj", "{E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug_TNT|Win32 = Debug_TNT|Win32 + Debug_TNT|x64 = Debug_TNT|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release STEP 1|Win32 = Release STEP 1|Win32 + Release STEP 1|x64 = Release STEP 1|x64 + Release_TNT|Win32 = Release_TNT|Win32 + Release_TNT|x64 = Release_TNT|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|Win32.ActiveCfg = Debug_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|Win32.Build.0 = Debug_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|x64.ActiveCfg = Debug_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|x64.Build.0 = Debug_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|Win32.ActiveCfg = Debug|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|Win32.Build.0 = Debug|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|x64.ActiveCfg = Debug|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|x64.Build.0 = Debug|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP 1|Win32.ActiveCfg = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP 1|Win32.Build.0 = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP 1|x64.ActiveCfg = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP 1|x64.Build.0 = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|Win32.ActiveCfg = Release_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|Win32.Build.0 = Release_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|x64.ActiveCfg = Release_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|x64.Build.0 = Release_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|Win32.ActiveCfg = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|Win32.Build.0 = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|x64.ActiveCfg = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/winpcap_oem/OEM/WinpcapOem/WinpcapOem.vcproj b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.vcproj new file mode 100644 index 00000000..bf3f24c0 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/WinpcapOem.vcproj @@ -0,0 +1,1425 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winpcap_oem/OEM/WinpcapOem/WoemDebug.h b/winpcap_oem/OEM/WinpcapOem/WoemDebug.h new file mode 100644 index 00000000..3302c87e --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/WoemDebug.h @@ -0,0 +1,276 @@ +/* + * Copyright 2015 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Riverbed Technology nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __WOEM_DEBUG_H_ +#define __WOEM_DEBUG_H_ + +#include +#include + +//#define ENABLE_TRACE + +#pragma warning ( push ) +#pragma warning( disable : 4995 ) // deprecated string functions. BE CAREFUL, it disabled all deprecated warnings + +/*! + \brief Macro to print a debug string. The behavior differs depending on the debug level +*/ + +/*! + \brief Macro to print debug data with the printf convention. The behavior differs depending on + the debug level +*/ +static __inline void CreateMessageStringV(char *_x, va_list Marker, BOOL newLine, char* outBuffer, size_t outBufferSize) +{ + SYSTEMTIME LocalTime; + DWORD dwThreadId; + size_t currentLen; + + DWORD dwLastError = GetLastError(); + + dwThreadId = GetCurrentThreadId(); + + GetLocalTime(&LocalTime); + + outBuffer[outBufferSize - 1] = '\0'; + + _snprintf(outBuffer, outBufferSize, "[%.08X] %.04u-%.02u-%.02u %.02u:%02u:%02u ", + dwThreadId, + LocalTime.wYear, + LocalTime.wMonth, + LocalTime.wDay, + LocalTime.wHour, + LocalTime.wMinute, + LocalTime.wSecond); + + currentLen = strlen(outBuffer); + + ::_vsnprintf(outBuffer + currentLen, outBufferSize - currentLen, _x, Marker); + + if (newLine) + { + currentLen = strlen(outBuffer); + + if (currentLen + 1 < outBufferSize) + { + outBuffer[currentLen] = '\n'; + outBuffer[currentLen + 1] = '\0'; + } + } + + SetLastError(dwLastError); + +} + +static __inline void OutputDebugMessage(char *_x, ...) +{ +#ifdef _DEBUG_TO_FILE + FILE *f; + int loops; +#endif + + + va_list Marker; + char message[1024]; + + DWORD dwLastError = GetLastError(); + + va_start(Marker, _x); + + CreateMessageStringV(_x, Marker, FALSE, message, sizeof(message)); + + +#ifdef _DEBUG_TO_FILE + do + { + f = fopen("woem_debug.txt", "a"); + if (f != NULL) + break; + + Sleep(0); + loops++; + + if (loops > 10) + return; + } + while(1); + + fputs(message, f); + + fclose(f); +#else + OutputDebugStringA(message); +#endif + + SetLastError(dwLastError); + +} + +static __inline void OutputDebugMessageNewLine(char *_x, ...) +{ +#ifdef _DEBUG_TO_FILE + FILE *f; + int loops = 0; +#endif + + va_list Marker; + + DWORD dwLastError = GetLastError(); + + va_start(Marker, _x); + char message[1024]; + + CreateMessageStringV(_x, Marker, TRUE, message, sizeof(message)); + + +#ifdef _DEBUG_TO_FILE + do + { + f = fopen("woem_debug.txt", "a"); + if (f != NULL) + break; + + Sleep(0); + loops++; + + if (loops > 10) + return; + } + while(1); + + fputs(message, f); + + fclose(f); +#else + OutputDebugStringA(message); +#endif + + SetLastError(dwLastError); + +} + + +static __inline void TRACE_PRINT_OS_INFO() +{ + HKEY hKey; + CHAR buffer[1024]; + DWORD size = sizeof(buffer); + DWORD type; + + DWORD dwLastError = GetLastError(); + + OutputDebugMessage("********************* OS info.********************* \n"); + buffer[size-1] = 0; + size = sizeof(buffer); + if( RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + if (RegQueryValueExA(hKey, "PROCESSOR_ARCHITECTURE", 0, &type, (LPBYTE)buffer, &size) == ERROR_SUCCESS && type == REG_SZ) + { + OutputDebugMessage("Architecture = %s\n", buffer); + } + else + { + OutputDebugMessage("Architecture = \n"); + } + + RegCloseKey(hKey); + } + else + { + OutputDebugMessage("Architecture = \n"); + } + + buffer[size-1] = 0; + size = sizeof(buffer); + + if( RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + if (RegQueryValueExA(hKey, "CurrentVersion", 0, &type, (LPBYTE)buffer, &size) == ERROR_SUCCESS && type == REG_SZ) + { + OutputDebugMessage("Windows version = %s\n", buffer); + } + else + { + OutputDebugMessage("Windows version = \n"); + } + + RegCloseKey(hKey); + } + else + { + OutputDebugMessage("Windows version = \n"); + } + + buffer[size-1] = 0; + size = sizeof(buffer); + if( RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + if (RegQueryValueExA(hKey, "CurrentType", 0, &type, (LPBYTE)buffer, &size) == ERROR_SUCCESS && type == REG_SZ) + { + OutputDebugMessage("Windows CurrentType = %s\n", buffer); + } + else + { + OutputDebugMessage("Windows CurrentType = \n"); + } + + RegCloseKey(hKey); + } + else + { + OutputDebugMessage("Windows CurrentType = \n"); + } + + OutputDebugMessage("*************************************************** \n"); + + SetLastError(dwLastError); + +} + +#pragma warning ( pop ) + + +#if defined (_DEBUG) || defined (ENABLE_TRACE) + +#define TRACE_ENTER(_x) OutputDebugMessageNewLine("-->" _x) +#define TRACE_EXIT(_x) OutputDebugMessageNewLine("<--" _x) +#define TRACE_MESSAGE OutputDebugMessageNewLine + +#else + +#define TRACE_ENTER(_x) do{}while(0) +#define TRACE_EXIT(_x) do{}while(0) + +static __inline void TRACE_MESSAGE(char *_x, ...){} + +#endif + +#endif //__WOEM_DEBUG_H_ diff --git a/winpcap_oem/OEM/WinpcapOem/binaries/Note.txt b/winpcap_oem/OEM/WinpcapOem/binaries/Note.txt new file mode 100644 index 00000000..0069cc37 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/binaries/Note.txt @@ -0,0 +1,11 @@ +This folder will contain the binaries for the various OSes that will be +embedded in the resources: + +Packet2k.dll: Windows 2k/XP/2003 packet.dll +Packetnt.dll: Windows NT packet.dll +PacketVista.dll: Windows Vista packet.dll +npf2k.sys: Windows 2k/XP/2003 driver +npfnt.sys: Windows NT driver +npfx64.sys: Windows AMD64 driver + +These files are copied automatically by the build process system in makeall \ No newline at end of file diff --git a/winpcap_oem/OEM/WinpcapOem/binaries/tools.bin b/winpcap_oem/OEM/WinpcapOem/binaries/tools.bin new file mode 100644 index 00000000..01d633b2 Binary files /dev/null and b/winpcap_oem/OEM/WinpcapOem/binaries/tools.bin differ diff --git a/winpcap_oem/OEM/WinpcapOem/idls.h b/winpcap_oem/OEM/WinpcapOem/idls.h new file mode 100644 index 00000000..4e2cd74b --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/idls.h @@ -0,0 +1,2518 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0361 */ +/* Compiler settings for idls.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __idls_h__ +#define __idls_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IEnumNetCfgBindingInterface_FWD_DEFINED__ +#define __IEnumNetCfgBindingInterface_FWD_DEFINED__ +typedef interface IEnumNetCfgBindingInterface IEnumNetCfgBindingInterface; +#endif /* __IEnumNetCfgBindingInterface_FWD_DEFINED__ */ + + +#ifndef __IEnumNetCfgBindingPath_FWD_DEFINED__ +#define __IEnumNetCfgBindingPath_FWD_DEFINED__ +typedef interface IEnumNetCfgBindingPath IEnumNetCfgBindingPath; +#endif /* __IEnumNetCfgBindingPath_FWD_DEFINED__ */ + + +#ifndef __IEnumNetCfgComponent_FWD_DEFINED__ +#define __IEnumNetCfgComponent_FWD_DEFINED__ +typedef interface IEnumNetCfgComponent IEnumNetCfgComponent; +#endif /* __IEnumNetCfgComponent_FWD_DEFINED__ */ + + +#ifndef __INetCfg_FWD_DEFINED__ +#define __INetCfg_FWD_DEFINED__ +typedef interface INetCfg INetCfg; +#endif /* __INetCfg_FWD_DEFINED__ */ + + +#ifndef __INetCfgLock_FWD_DEFINED__ +#define __INetCfgLock_FWD_DEFINED__ +typedef interface INetCfgLock INetCfgLock; +#endif /* __INetCfgLock_FWD_DEFINED__ */ + + +#ifndef __INetCfgBindingInterface_FWD_DEFINED__ +#define __INetCfgBindingInterface_FWD_DEFINED__ +typedef interface INetCfgBindingInterface INetCfgBindingInterface; +#endif /* __INetCfgBindingInterface_FWD_DEFINED__ */ + + +#ifndef __INetCfgBindingPath_FWD_DEFINED__ +#define __INetCfgBindingPath_FWD_DEFINED__ +typedef interface INetCfgBindingPath INetCfgBindingPath; +#endif /* __INetCfgBindingPath_FWD_DEFINED__ */ + + +#ifndef __INetCfgClass_FWD_DEFINED__ +#define __INetCfgClass_FWD_DEFINED__ +typedef interface INetCfgClass INetCfgClass; +#endif /* __INetCfgClass_FWD_DEFINED__ */ + + +#ifndef __INetCfgClassSetup_FWD_DEFINED__ +#define __INetCfgClassSetup_FWD_DEFINED__ +typedef interface INetCfgClassSetup INetCfgClassSetup; +#endif /* __INetCfgClassSetup_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponent_FWD_DEFINED__ +#define __INetCfgComponent_FWD_DEFINED__ +typedef interface INetCfgComponent INetCfgComponent; +#endif /* __INetCfgComponent_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponentBindings_FWD_DEFINED__ +#define __INetCfgComponentBindings_FWD_DEFINED__ +typedef interface INetCfgComponentBindings INetCfgComponentBindings; +#endif /* __INetCfgComponentBindings_FWD_DEFINED__ */ + + +#ifndef __INetCfgSysPrep_FWD_DEFINED__ +#define __INetCfgSysPrep_FWD_DEFINED__ +typedef interface INetCfgSysPrep INetCfgSysPrep; +#endif /* __INetCfgSysPrep_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "unknwn.h" +#include "prsht.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +/* interface __MIDL_itf_idls_0000 */ +/* [local] */ + +//+------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//-------------------------------------------------------------------------- +#if ( _MSC_VER >= 800 ) +#pragma warning(disable:4201) +#endif + +EXTERN_C const CLSID CLSID_CNetCfg; + +#define NETCFG_E_ALREADY_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA020) +#define NETCFG_E_NOT_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA021) +#define NETCFG_E_IN_USE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA022) +#define NETCFG_E_NO_WRITE_LOCK MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA024) +#define NETCFG_E_NEED_REBOOT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA025) +#define NETCFG_E_ACTIVE_RAS_CONNECTIONS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA026) +#define NETCFG_E_ADAPTER_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA027) +#define NETCFG_E_COMPONENT_REMOVED_PENDING_REBOOT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA028) +#define NETCFG_S_REBOOT MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA020) +#define NETCFG_S_DISABLE_QUERY MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA022) +#define NETCFG_S_STILL_REFERENCED MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA023) +#define NETCFG_S_CAUSED_SETUP_CHANGE MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA024) +#define NETCFG_S_COMMIT_NOW MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA025) + +#define NETCFG_CLIENT_CID_MS_MSClient TEXT("ms_msclient") +#define NETCFG_SERVICE_CID_MS_SERVER TEXT("ms_server") +#define NETCFG_SERVICE_CID_MS_NETBIOS TEXT("ms_netbios") +#define NETCFG_SERVICE_CID_MS_PSCHED TEXT("ms_pschedpc") +#define NETCFG_SERVICE_CID_MS_WLBS TEXT("ms_wlbs") +#define NETCFG_TRANS_CID_MS_APPLETALK TEXT("ms_appletalk") +#define NETCFG_TRANS_CID_MS_NETBEUI TEXT("ms_netbeui") +#define NETCFG_TRANS_CID_MS_NETMON TEXT("ms_netmon") +#define NETCFG_TRANS_CID_MS_NWIPX TEXT("ms_nwipx") +#define NETCFG_TRANS_CID_MS_NWSPX TEXT("ms_nwspx") +#define NETCFG_TRANS_CID_MS_TCPIP TEXT("ms_tcpip") + + + + + + + + + + + + + + + + +extern RPC_IF_HANDLE __MIDL_itf_idls_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_idls_0000_v0_0_s_ifspec; + +#ifndef __IEnumNetCfgBindingInterface_INTERFACE_DEFINED__ +#define __IEnumNetCfgBindingInterface_INTERFACE_DEFINED__ + +/* interface IEnumNetCfgBindingInterface */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_IEnumNetCfgBindingInterface; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE90-306E-11D1-AACF-00805FC1270E") + IEnumNetCfgBindingInterface : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingInterface **rgelt, + /* [out] */ ULONG *pceltFetched) = 0; + + virtual HRESULT STDMETHODCALLTYPE Skip( + /* [in] */ ULONG celt) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Clone( + /* [out] */ IEnumNetCfgBindingInterface **ppenum) = 0; + + }; + +#else /* C style interface */ + + typedef struct IEnumNetCfgBindingInterfaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEnumNetCfgBindingInterface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEnumNetCfgBindingInterface * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEnumNetCfgBindingInterface * This); + + HRESULT ( STDMETHODCALLTYPE *Next )( + IEnumNetCfgBindingInterface * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingInterface **rgelt, + /* [out] */ ULONG *pceltFetched); + + HRESULT ( STDMETHODCALLTYPE *Skip )( + IEnumNetCfgBindingInterface * This, + /* [in] */ ULONG celt); + + HRESULT ( STDMETHODCALLTYPE *Reset )( + IEnumNetCfgBindingInterface * This); + + HRESULT ( STDMETHODCALLTYPE *Clone )( + IEnumNetCfgBindingInterface * This, + /* [out] */ IEnumNetCfgBindingInterface **ppenum); + + END_INTERFACE + } IEnumNetCfgBindingInterfaceVtbl; + + interface IEnumNetCfgBindingInterface + { + CONST_VTBL struct IEnumNetCfgBindingInterfaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEnumNetCfgBindingInterface_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IEnumNetCfgBindingInterface_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IEnumNetCfgBindingInterface_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IEnumNetCfgBindingInterface_Next(This,celt,rgelt,pceltFetched) \ + (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) + +#define IEnumNetCfgBindingInterface_Skip(This,celt) \ + (This)->lpVtbl -> Skip(This,celt) + +#define IEnumNetCfgBindingInterface_Reset(This) \ + (This)->lpVtbl -> Reset(This) + +#define IEnumNetCfgBindingInterface_Clone(This,ppenum) \ + (This)->lpVtbl -> Clone(This,ppenum) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingInterface_Next_Proxy( + IEnumNetCfgBindingInterface * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingInterface **rgelt, + /* [out] */ ULONG *pceltFetched); + + +void __RPC_STUB IEnumNetCfgBindingInterface_Next_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingInterface_Skip_Proxy( + IEnumNetCfgBindingInterface * This, + /* [in] */ ULONG celt); + + +void __RPC_STUB IEnumNetCfgBindingInterface_Skip_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingInterface_Reset_Proxy( + IEnumNetCfgBindingInterface * This); + + +void __RPC_STUB IEnumNetCfgBindingInterface_Reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingInterface_Clone_Proxy( + IEnumNetCfgBindingInterface * This, + /* [out] */ IEnumNetCfgBindingInterface **ppenum); + + +void __RPC_STUB IEnumNetCfgBindingInterface_Clone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IEnumNetCfgBindingInterface_INTERFACE_DEFINED__ */ + + +#ifndef __IEnumNetCfgBindingPath_INTERFACE_DEFINED__ +#define __IEnumNetCfgBindingPath_INTERFACE_DEFINED__ + +/* interface IEnumNetCfgBindingPath */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_IEnumNetCfgBindingPath; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE91-306E-11D1-AACF-00805FC1270E") + IEnumNetCfgBindingPath : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingPath **rgelt, + /* [out] */ ULONG *pceltFetched) = 0; + + virtual HRESULT STDMETHODCALLTYPE Skip( + /* [in] */ ULONG celt) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Clone( + /* [out] */ IEnumNetCfgBindingPath **ppenum) = 0; + + }; + +#else /* C style interface */ + + typedef struct IEnumNetCfgBindingPathVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEnumNetCfgBindingPath * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEnumNetCfgBindingPath * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEnumNetCfgBindingPath * This); + + HRESULT ( STDMETHODCALLTYPE *Next )( + IEnumNetCfgBindingPath * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingPath **rgelt, + /* [out] */ ULONG *pceltFetched); + + HRESULT ( STDMETHODCALLTYPE *Skip )( + IEnumNetCfgBindingPath * This, + /* [in] */ ULONG celt); + + HRESULT ( STDMETHODCALLTYPE *Reset )( + IEnumNetCfgBindingPath * This); + + HRESULT ( STDMETHODCALLTYPE *Clone )( + IEnumNetCfgBindingPath * This, + /* [out] */ IEnumNetCfgBindingPath **ppenum); + + END_INTERFACE + } IEnumNetCfgBindingPathVtbl; + + interface IEnumNetCfgBindingPath + { + CONST_VTBL struct IEnumNetCfgBindingPathVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEnumNetCfgBindingPath_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IEnumNetCfgBindingPath_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IEnumNetCfgBindingPath_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IEnumNetCfgBindingPath_Next(This,celt,rgelt,pceltFetched) \ + (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) + +#define IEnumNetCfgBindingPath_Skip(This,celt) \ + (This)->lpVtbl -> Skip(This,celt) + +#define IEnumNetCfgBindingPath_Reset(This) \ + (This)->lpVtbl -> Reset(This) + +#define IEnumNetCfgBindingPath_Clone(This,ppenum) \ + (This)->lpVtbl -> Clone(This,ppenum) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingPath_Next_Proxy( + IEnumNetCfgBindingPath * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingPath **rgelt, + /* [out] */ ULONG *pceltFetched); + + +void __RPC_STUB IEnumNetCfgBindingPath_Next_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingPath_Skip_Proxy( + IEnumNetCfgBindingPath * This, + /* [in] */ ULONG celt); + + +void __RPC_STUB IEnumNetCfgBindingPath_Skip_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingPath_Reset_Proxy( + IEnumNetCfgBindingPath * This); + + +void __RPC_STUB IEnumNetCfgBindingPath_Reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingPath_Clone_Proxy( + IEnumNetCfgBindingPath * This, + /* [out] */ IEnumNetCfgBindingPath **ppenum); + + +void __RPC_STUB IEnumNetCfgBindingPath_Clone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IEnumNetCfgBindingPath_INTERFACE_DEFINED__ */ + + +#ifndef __IEnumNetCfgComponent_INTERFACE_DEFINED__ +#define __IEnumNetCfgComponent_INTERFACE_DEFINED__ + +/* interface IEnumNetCfgComponent */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_IEnumNetCfgComponent; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE92-306E-11D1-AACF-00805FC1270E") + IEnumNetCfgComponent : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgComponent **rgelt, + /* [out] */ ULONG *pceltFetched) = 0; + + virtual HRESULT STDMETHODCALLTYPE Skip( + /* [in] */ ULONG celt) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Clone( + /* [out] */ IEnumNetCfgComponent **ppenum) = 0; + + }; + +#else /* C style interface */ + + typedef struct IEnumNetCfgComponentVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEnumNetCfgComponent * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEnumNetCfgComponent * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEnumNetCfgComponent * This); + + HRESULT ( STDMETHODCALLTYPE *Next )( + IEnumNetCfgComponent * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgComponent **rgelt, + /* [out] */ ULONG *pceltFetched); + + HRESULT ( STDMETHODCALLTYPE *Skip )( + IEnumNetCfgComponent * This, + /* [in] */ ULONG celt); + + HRESULT ( STDMETHODCALLTYPE *Reset )( + IEnumNetCfgComponent * This); + + HRESULT ( STDMETHODCALLTYPE *Clone )( + IEnumNetCfgComponent * This, + /* [out] */ IEnumNetCfgComponent **ppenum); + + END_INTERFACE + } IEnumNetCfgComponentVtbl; + + interface IEnumNetCfgComponent + { + CONST_VTBL struct IEnumNetCfgComponentVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEnumNetCfgComponent_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IEnumNetCfgComponent_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IEnumNetCfgComponent_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IEnumNetCfgComponent_Next(This,celt,rgelt,pceltFetched) \ + (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) + +#define IEnumNetCfgComponent_Skip(This,celt) \ + (This)->lpVtbl -> Skip(This,celt) + +#define IEnumNetCfgComponent_Reset(This) \ + (This)->lpVtbl -> Reset(This) + +#define IEnumNetCfgComponent_Clone(This,ppenum) \ + (This)->lpVtbl -> Clone(This,ppenum) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgComponent_Next_Proxy( + IEnumNetCfgComponent * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgComponent **rgelt, + /* [out] */ ULONG *pceltFetched); + + +void __RPC_STUB IEnumNetCfgComponent_Next_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgComponent_Skip_Proxy( + IEnumNetCfgComponent * This, + /* [in] */ ULONG celt); + + +void __RPC_STUB IEnumNetCfgComponent_Skip_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgComponent_Reset_Proxy( + IEnumNetCfgComponent * This); + + +void __RPC_STUB IEnumNetCfgComponent_Reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgComponent_Clone_Proxy( + IEnumNetCfgComponent * This, + /* [out] */ IEnumNetCfgComponent **ppenum); + + +void __RPC_STUB IEnumNetCfgComponent_Clone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IEnumNetCfgComponent_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfg_INTERFACE_DEFINED__ +#define __INetCfg_INTERFACE_DEFINED__ + +/* interface INetCfg */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfg; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE93-306E-11D1-AACF-00805FC1270E") + INetCfg : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Initialize( + /* [in] */ PVOID pvReserved) = 0; + + virtual HRESULT STDMETHODCALLTYPE Uninitialize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Apply( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Cancel( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumComponents( + /* [in] */ const GUID *pguidClass, + /* [out] */ IEnumNetCfgComponent **ppenumComponent) = 0; + + virtual HRESULT STDMETHODCALLTYPE FindComponent( + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **pComponent) = 0; + + virtual HRESULT STDMETHODCALLTYPE QueryNetCfgClass( + /* [in] */ const GUID *pguidClass, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfg * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfg * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfg * This); + + HRESULT ( STDMETHODCALLTYPE *Initialize )( + INetCfg * This, + /* [in] */ PVOID pvReserved); + + HRESULT ( STDMETHODCALLTYPE *Uninitialize )( + INetCfg * This); + + HRESULT ( STDMETHODCALLTYPE *Apply )( + INetCfg * This); + + HRESULT ( STDMETHODCALLTYPE *Cancel )( + INetCfg * This); + + HRESULT ( STDMETHODCALLTYPE *EnumComponents )( + INetCfg * This, + /* [in] */ const GUID *pguidClass, + /* [out] */ IEnumNetCfgComponent **ppenumComponent); + + HRESULT ( STDMETHODCALLTYPE *FindComponent )( + INetCfg * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **pComponent); + + HRESULT ( STDMETHODCALLTYPE *QueryNetCfgClass )( + INetCfg * This, + /* [in] */ const GUID *pguidClass, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + END_INTERFACE + } INetCfgVtbl; + + interface INetCfg + { + CONST_VTBL struct INetCfgVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfg_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfg_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfg_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfg_Initialize(This,pvReserved) \ + (This)->lpVtbl -> Initialize(This,pvReserved) + +#define INetCfg_Uninitialize(This) \ + (This)->lpVtbl -> Uninitialize(This) + +#define INetCfg_Apply(This) \ + (This)->lpVtbl -> Apply(This) + +#define INetCfg_Cancel(This) \ + (This)->lpVtbl -> Cancel(This) + +#define INetCfg_EnumComponents(This,pguidClass,ppenumComponent) \ + (This)->lpVtbl -> EnumComponents(This,pguidClass,ppenumComponent) + +#define INetCfg_FindComponent(This,pszwInfId,pComponent) \ + (This)->lpVtbl -> FindComponent(This,pszwInfId,pComponent) + +#define INetCfg_QueryNetCfgClass(This,pguidClass,riid,ppvObject) \ + (This)->lpVtbl -> QueryNetCfgClass(This,pguidClass,riid,ppvObject) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfg_Initialize_Proxy( + INetCfg * This, + /* [in] */ PVOID pvReserved); + + +void __RPC_STUB INetCfg_Initialize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_Uninitialize_Proxy( + INetCfg * This); + + +void __RPC_STUB INetCfg_Uninitialize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_Apply_Proxy( + INetCfg * This); + + +void __RPC_STUB INetCfg_Apply_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_Cancel_Proxy( + INetCfg * This); + + +void __RPC_STUB INetCfg_Cancel_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_EnumComponents_Proxy( + INetCfg * This, + /* [in] */ const GUID *pguidClass, + /* [out] */ IEnumNetCfgComponent **ppenumComponent); + + +void __RPC_STUB INetCfg_EnumComponents_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_FindComponent_Proxy( + INetCfg * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **pComponent); + + +void __RPC_STUB INetCfg_FindComponent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_QueryNetCfgClass_Proxy( + INetCfg * This, + /* [in] */ const GUID *pguidClass, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + +void __RPC_STUB INetCfg_QueryNetCfgClass_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfg_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgLock_INTERFACE_DEFINED__ +#define __INetCfgLock_INTERFACE_DEFINED__ + +/* interface INetCfgLock */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgLock; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE9F-306E-11D1-AACF-00805FC1270E") + INetCfgLock : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE AcquireWriteLock( + /* [in] */ DWORD cmsTimeout, + /* [string][in] */ LPCWSTR pszwClientDescription, + /* [string][out] */ LPWSTR *ppszwClientDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReleaseWriteLock( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsWriteLocked( + /* [string][out] */ LPWSTR *ppszwClientDescription) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgLockVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgLock * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgLock * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgLock * This); + + HRESULT ( STDMETHODCALLTYPE *AcquireWriteLock )( + INetCfgLock * This, + /* [in] */ DWORD cmsTimeout, + /* [string][in] */ LPCWSTR pszwClientDescription, + /* [string][out] */ LPWSTR *ppszwClientDescription); + + HRESULT ( STDMETHODCALLTYPE *ReleaseWriteLock )( + INetCfgLock * This); + + HRESULT ( STDMETHODCALLTYPE *IsWriteLocked )( + INetCfgLock * This, + /* [string][out] */ LPWSTR *ppszwClientDescription); + + END_INTERFACE + } INetCfgLockVtbl; + + interface INetCfgLock + { + CONST_VTBL struct INetCfgLockVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgLock_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgLock_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgLock_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgLock_AcquireWriteLock(This,cmsTimeout,pszwClientDescription,ppszwClientDescription) \ + (This)->lpVtbl -> AcquireWriteLock(This,cmsTimeout,pszwClientDescription,ppszwClientDescription) + +#define INetCfgLock_ReleaseWriteLock(This) \ + (This)->lpVtbl -> ReleaseWriteLock(This) + +#define INetCfgLock_IsWriteLocked(This,ppszwClientDescription) \ + (This)->lpVtbl -> IsWriteLocked(This,ppszwClientDescription) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgLock_AcquireWriteLock_Proxy( + INetCfgLock * This, + /* [in] */ DWORD cmsTimeout, + /* [string][in] */ LPCWSTR pszwClientDescription, + /* [string][out] */ LPWSTR *ppszwClientDescription); + + +void __RPC_STUB INetCfgLock_AcquireWriteLock_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgLock_ReleaseWriteLock_Proxy( + INetCfgLock * This); + + +void __RPC_STUB INetCfgLock_ReleaseWriteLock_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgLock_IsWriteLocked_Proxy( + INetCfgLock * This, + /* [string][out] */ LPWSTR *ppszwClientDescription); + + +void __RPC_STUB INetCfgLock_IsWriteLocked_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgLock_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgBindingInterface_INTERFACE_DEFINED__ +#define __INetCfgBindingInterface_INTERFACE_DEFINED__ + +/* interface INetCfgBindingInterface */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgBindingInterface; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE94-306E-11D1-AACF-00805FC1270E") + INetCfgBindingInterface : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetName( + /* [string][out] */ LPWSTR *ppszwInterfaceName) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetUpperComponent( + /* [out] */ INetCfgComponent **ppnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetLowerComponent( + /* [out] */ INetCfgComponent **ppnccItem) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgBindingInterfaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgBindingInterface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgBindingInterface * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgBindingInterface * This); + + HRESULT ( STDMETHODCALLTYPE *GetName )( + INetCfgBindingInterface * This, + /* [string][out] */ LPWSTR *ppszwInterfaceName); + + HRESULT ( STDMETHODCALLTYPE *GetUpperComponent )( + INetCfgBindingInterface * This, + /* [out] */ INetCfgComponent **ppnccItem); + + HRESULT ( STDMETHODCALLTYPE *GetLowerComponent )( + INetCfgBindingInterface * This, + /* [out] */ INetCfgComponent **ppnccItem); + + END_INTERFACE + } INetCfgBindingInterfaceVtbl; + + interface INetCfgBindingInterface + { + CONST_VTBL struct INetCfgBindingInterfaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgBindingInterface_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgBindingInterface_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgBindingInterface_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgBindingInterface_GetName(This,ppszwInterfaceName) \ + (This)->lpVtbl -> GetName(This,ppszwInterfaceName) + +#define INetCfgBindingInterface_GetUpperComponent(This,ppnccItem) \ + (This)->lpVtbl -> GetUpperComponent(This,ppnccItem) + +#define INetCfgBindingInterface_GetLowerComponent(This,ppnccItem) \ + (This)->lpVtbl -> GetLowerComponent(This,ppnccItem) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgBindingInterface_GetName_Proxy( + INetCfgBindingInterface * This, + /* [string][out] */ LPWSTR *ppszwInterfaceName); + + +void __RPC_STUB INetCfgBindingInterface_GetName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingInterface_GetUpperComponent_Proxy( + INetCfgBindingInterface * This, + /* [out] */ INetCfgComponent **ppnccItem); + + +void __RPC_STUB INetCfgBindingInterface_GetUpperComponent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingInterface_GetLowerComponent_Proxy( + INetCfgBindingInterface * This, + /* [out] */ INetCfgComponent **ppnccItem); + + +void __RPC_STUB INetCfgBindingInterface_GetLowerComponent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgBindingInterface_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgBindingPath_INTERFACE_DEFINED__ +#define __INetCfgBindingPath_INTERFACE_DEFINED__ + +/* interface INetCfgBindingPath */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgBindingPath; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE96-306E-11D1-AACF-00805FC1270E") + INetCfgBindingPath : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE IsSamePathAs( + /* [in] */ INetCfgBindingPath *pPath) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsSubPathOf( + /* [in] */ INetCfgBindingPath *pPath) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsEnabled( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Enable( + /* [in] */ BOOL fEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPathToken( + /* [string][out] */ LPWSTR *ppszwPathToken) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetOwner( + /* [out] */ INetCfgComponent **ppComponent) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDepth( + /* [out] */ ULONG *pcInterfaces) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumBindingInterfaces( + /* [out] */ IEnumNetCfgBindingInterface **ppenumInterface) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgBindingPathVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgBindingPath * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgBindingPath * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgBindingPath * This); + + HRESULT ( STDMETHODCALLTYPE *IsSamePathAs )( + INetCfgBindingPath * This, + /* [in] */ INetCfgBindingPath *pPath); + + HRESULT ( STDMETHODCALLTYPE *IsSubPathOf )( + INetCfgBindingPath * This, + /* [in] */ INetCfgBindingPath *pPath); + + HRESULT ( STDMETHODCALLTYPE *IsEnabled )( + INetCfgBindingPath * This); + + HRESULT ( STDMETHODCALLTYPE *Enable )( + INetCfgBindingPath * This, + /* [in] */ BOOL fEnable); + + HRESULT ( STDMETHODCALLTYPE *GetPathToken )( + INetCfgBindingPath * This, + /* [string][out] */ LPWSTR *ppszwPathToken); + + HRESULT ( STDMETHODCALLTYPE *GetOwner )( + INetCfgBindingPath * This, + /* [out] */ INetCfgComponent **ppComponent); + + HRESULT ( STDMETHODCALLTYPE *GetDepth )( + INetCfgBindingPath * This, + /* [out] */ ULONG *pcInterfaces); + + HRESULT ( STDMETHODCALLTYPE *EnumBindingInterfaces )( + INetCfgBindingPath * This, + /* [out] */ IEnumNetCfgBindingInterface **ppenumInterface); + + END_INTERFACE + } INetCfgBindingPathVtbl; + + interface INetCfgBindingPath + { + CONST_VTBL struct INetCfgBindingPathVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgBindingPath_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgBindingPath_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgBindingPath_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgBindingPath_IsSamePathAs(This,pPath) \ + (This)->lpVtbl -> IsSamePathAs(This,pPath) + +#define INetCfgBindingPath_IsSubPathOf(This,pPath) \ + (This)->lpVtbl -> IsSubPathOf(This,pPath) + +#define INetCfgBindingPath_IsEnabled(This) \ + (This)->lpVtbl -> IsEnabled(This) + +#define INetCfgBindingPath_Enable(This,fEnable) \ + (This)->lpVtbl -> Enable(This,fEnable) + +#define INetCfgBindingPath_GetPathToken(This,ppszwPathToken) \ + (This)->lpVtbl -> GetPathToken(This,ppszwPathToken) + +#define INetCfgBindingPath_GetOwner(This,ppComponent) \ + (This)->lpVtbl -> GetOwner(This,ppComponent) + +#define INetCfgBindingPath_GetDepth(This,pcInterfaces) \ + (This)->lpVtbl -> GetDepth(This,pcInterfaces) + +#define INetCfgBindingPath_EnumBindingInterfaces(This,ppenumInterface) \ + (This)->lpVtbl -> EnumBindingInterfaces(This,ppenumInterface) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_IsSamePathAs_Proxy( + INetCfgBindingPath * This, + /* [in] */ INetCfgBindingPath *pPath); + + +void __RPC_STUB INetCfgBindingPath_IsSamePathAs_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_IsSubPathOf_Proxy( + INetCfgBindingPath * This, + /* [in] */ INetCfgBindingPath *pPath); + + +void __RPC_STUB INetCfgBindingPath_IsSubPathOf_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_IsEnabled_Proxy( + INetCfgBindingPath * This); + + +void __RPC_STUB INetCfgBindingPath_IsEnabled_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_Enable_Proxy( + INetCfgBindingPath * This, + /* [in] */ BOOL fEnable); + + +void __RPC_STUB INetCfgBindingPath_Enable_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_GetPathToken_Proxy( + INetCfgBindingPath * This, + /* [string][out] */ LPWSTR *ppszwPathToken); + + +void __RPC_STUB INetCfgBindingPath_GetPathToken_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_GetOwner_Proxy( + INetCfgBindingPath * This, + /* [out] */ INetCfgComponent **ppComponent); + + +void __RPC_STUB INetCfgBindingPath_GetOwner_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_GetDepth_Proxy( + INetCfgBindingPath * This, + /* [out] */ ULONG *pcInterfaces); + + +void __RPC_STUB INetCfgBindingPath_GetDepth_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_EnumBindingInterfaces_Proxy( + INetCfgBindingPath * This, + /* [out] */ IEnumNetCfgBindingInterface **ppenumInterface); + + +void __RPC_STUB INetCfgBindingPath_EnumBindingInterfaces_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgBindingPath_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgClass_INTERFACE_DEFINED__ +#define __INetCfgClass_INTERFACE_DEFINED__ + +/* interface INetCfgClass */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgClass; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE97-306E-11D1-AACF-00805FC1270E") + INetCfgClass : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE FindComponent( + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **ppnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumComponents( + /* [out] */ IEnumNetCfgComponent **ppenumComponent) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgClassVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgClass * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgClass * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgClass * This); + + HRESULT ( STDMETHODCALLTYPE *FindComponent )( + INetCfgClass * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **ppnccItem); + + HRESULT ( STDMETHODCALLTYPE *EnumComponents )( + INetCfgClass * This, + /* [out] */ IEnumNetCfgComponent **ppenumComponent); + + END_INTERFACE + } INetCfgClassVtbl; + + interface INetCfgClass + { + CONST_VTBL struct INetCfgClassVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgClass_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgClass_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgClass_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgClass_FindComponent(This,pszwInfId,ppnccItem) \ + (This)->lpVtbl -> FindComponent(This,pszwInfId,ppnccItem) + +#define INetCfgClass_EnumComponents(This,ppenumComponent) \ + (This)->lpVtbl -> EnumComponents(This,ppenumComponent) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgClass_FindComponent_Proxy( + INetCfgClass * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **ppnccItem); + + +void __RPC_STUB INetCfgClass_FindComponent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgClass_EnumComponents_Proxy( + INetCfgClass * This, + /* [out] */ IEnumNetCfgComponent **ppenumComponent); + + +void __RPC_STUB INetCfgClass_EnumComponents_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgClass_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgClassSetup_INTERFACE_DEFINED__ +#define __INetCfgClassSetup_INTERFACE_DEFINED__ + +/* interface INetCfgClassSetup */ +/* [unique][uuid][object][local] */ + +typedef +enum tagOBO_TOKEN_TYPE + { OBO_USER = 1, + OBO_COMPONENT = 2, + OBO_SOFTWARE = 3 + } OBO_TOKEN_TYPE; + +typedef struct tagOBO_TOKEN + { + OBO_TOKEN_TYPE Type; + INetCfgComponent *pncc; + LPCWSTR pszwManufacturer; + LPCWSTR pszwProduct; + LPCWSTR pszwDisplayName; + BOOL fRegistered; + } OBO_TOKEN; + + +EXTERN_C const IID IID_INetCfgClassSetup; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE9D-306E-11D1-AACF-00805FC1270E") + INetCfgClassSetup : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SelectAndInstall( + /* [in] */ HWND hwndParent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ INetCfgComponent **ppnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE Install( + /* [string][in] */ LPCWSTR pszwInfId, + /* [in] */ OBO_TOKEN *pOboToken, + /* [in] */ DWORD dwSetupFlags, + /* [in] */ DWORD dwUpgradeFromBuildNo, + /* [string][in] */ LPCWSTR pszwAnswerFile, + /* [string][in] */ LPCWSTR pszwAnswerSections, + /* [out] */ INetCfgComponent **ppnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE DeInstall( + /* [in] */ INetCfgComponent *pComponent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ LPWSTR *pmszwRefs) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgClassSetupVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgClassSetup * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgClassSetup * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgClassSetup * This); + + HRESULT ( STDMETHODCALLTYPE *SelectAndInstall )( + INetCfgClassSetup * This, + /* [in] */ HWND hwndParent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ INetCfgComponent **ppnccItem); + + HRESULT ( STDMETHODCALLTYPE *Install )( + INetCfgClassSetup * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [in] */ OBO_TOKEN *pOboToken, + /* [in] */ DWORD dwSetupFlags, + /* [in] */ DWORD dwUpgradeFromBuildNo, + /* [string][in] */ LPCWSTR pszwAnswerFile, + /* [string][in] */ LPCWSTR pszwAnswerSections, + /* [out] */ INetCfgComponent **ppnccItem); + + HRESULT ( STDMETHODCALLTYPE *DeInstall )( + INetCfgClassSetup * This, + /* [in] */ INetCfgComponent *pComponent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ LPWSTR *pmszwRefs); + + END_INTERFACE + } INetCfgClassSetupVtbl; + + interface INetCfgClassSetup + { + CONST_VTBL struct INetCfgClassSetupVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgClassSetup_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgClassSetup_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgClassSetup_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgClassSetup_SelectAndInstall(This,hwndParent,pOboToken,ppnccItem) \ + (This)->lpVtbl -> SelectAndInstall(This,hwndParent,pOboToken,ppnccItem) + +#define INetCfgClassSetup_Install(This,pszwInfId,pOboToken,dwSetupFlags,dwUpgradeFromBuildNo,pszwAnswerFile,pszwAnswerSections,ppnccItem) \ + (This)->lpVtbl -> Install(This,pszwInfId,pOboToken,dwSetupFlags,dwUpgradeFromBuildNo,pszwAnswerFile,pszwAnswerSections,ppnccItem) + +#define INetCfgClassSetup_DeInstall(This,pComponent,pOboToken,pmszwRefs) \ + (This)->lpVtbl -> DeInstall(This,pComponent,pOboToken,pmszwRefs) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgClassSetup_SelectAndInstall_Proxy( + INetCfgClassSetup * This, + /* [in] */ HWND hwndParent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ INetCfgComponent **ppnccItem); + + +void __RPC_STUB INetCfgClassSetup_SelectAndInstall_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgClassSetup_Install_Proxy( + INetCfgClassSetup * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [in] */ OBO_TOKEN *pOboToken, + /* [in] */ DWORD dwSetupFlags, + /* [in] */ DWORD dwUpgradeFromBuildNo, + /* [string][in] */ LPCWSTR pszwAnswerFile, + /* [string][in] */ LPCWSTR pszwAnswerSections, + /* [out] */ INetCfgComponent **ppnccItem); + + +void __RPC_STUB INetCfgClassSetup_Install_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgClassSetup_DeInstall_Proxy( + INetCfgClassSetup * This, + /* [in] */ INetCfgComponent *pComponent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ LPWSTR *pmszwRefs); + + +void __RPC_STUB INetCfgClassSetup_DeInstall_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgClassSetup_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponent_INTERFACE_DEFINED__ +#define __INetCfgComponent_INTERFACE_DEFINED__ + +/* interface INetCfgComponent */ +/* [unique][uuid][object][local] */ + +typedef +enum tagCOMPONENT_CHARACTERISTICS + { NCF_VIRTUAL = 0x1, + NCF_SOFTWARE_ENUMERATED = 0x2, + NCF_PHYSICAL = 0x4, + NCF_HIDDEN = 0x8, + NCF_NO_SERVICE = 0x10, + NCF_NOT_USER_REMOVABLE = 0x20, + NCF_MULTIPORT_INSTANCED_ADAPTER = 0x40, + NCF_HAS_UI = 0x80, + NCF_SINGLE_INSTANCE = 0x100, + NCF_FILTER = 0x400, + NCF_DONTEXPOSELOWER = 0x1000, + NCF_HIDE_BINDING = 0x2000, + NCF_NDIS_PROTOCOL = 0x4000, + NCF_FIXED_BINDING = 0x20000 + } COMPONENT_CHARACTERISTICS; + +typedef +enum tagNCRP_FLAGS + { NCRP_QUERY_PROPERTY_UI = 0x1, + NCRP_SHOW_PROPERTY_UI = 0x2 + } NCRP_FLAGS; + + +EXTERN_C const IID IID_INetCfgComponent; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE99-306E-11D1-AACF-00805FC1270E") + INetCfgComponent : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDisplayName( + /* [string][out] */ LPWSTR *ppszwDisplayName) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDisplayName( + /* [string][in] */ LPCWSTR pszwDisplayName) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetHelpText( + /* [string][out] */ LPWSTR *pszwHelpText) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetId( + /* [string][out] */ LPWSTR *ppszwId) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCharacteristics( + /* [out] */ LPDWORD pdwCharacteristics) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetInstanceGuid( + /* [out] */ GUID *pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPnpDevNodeId( + /* [string][out] */ LPWSTR *ppszwDevNodeId) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetClassGuid( + /* [out] */ GUID *pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetBindName( + /* [string][out] */ LPWSTR *ppszwBindName) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDeviceStatus( + /* [out] */ ULONG *pulStatus) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenParamKey( + /* [out] */ HKEY *phkey) = 0; + + virtual HRESULT STDMETHODCALLTYPE RaisePropertyUi( + /* [in] */ HWND hwndParent, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkContext) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponent * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponent * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponent * This); + + HRESULT ( STDMETHODCALLTYPE *GetDisplayName )( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwDisplayName); + + HRESULT ( STDMETHODCALLTYPE *SetDisplayName )( + INetCfgComponent * This, + /* [string][in] */ LPCWSTR pszwDisplayName); + + HRESULT ( STDMETHODCALLTYPE *GetHelpText )( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *pszwHelpText); + + HRESULT ( STDMETHODCALLTYPE *GetId )( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwId); + + HRESULT ( STDMETHODCALLTYPE *GetCharacteristics )( + INetCfgComponent * This, + /* [out] */ LPDWORD pdwCharacteristics); + + HRESULT ( STDMETHODCALLTYPE *GetInstanceGuid )( + INetCfgComponent * This, + /* [out] */ GUID *pGuid); + + HRESULT ( STDMETHODCALLTYPE *GetPnpDevNodeId )( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwDevNodeId); + + HRESULT ( STDMETHODCALLTYPE *GetClassGuid )( + INetCfgComponent * This, + /* [out] */ GUID *pGuid); + + HRESULT ( STDMETHODCALLTYPE *GetBindName )( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwBindName); + + HRESULT ( STDMETHODCALLTYPE *GetDeviceStatus )( + INetCfgComponent * This, + /* [out] */ ULONG *pulStatus); + + HRESULT ( STDMETHODCALLTYPE *OpenParamKey )( + INetCfgComponent * This, + /* [out] */ HKEY *phkey); + + HRESULT ( STDMETHODCALLTYPE *RaisePropertyUi )( + INetCfgComponent * This, + /* [in] */ HWND hwndParent, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkContext); + + END_INTERFACE + } INetCfgComponentVtbl; + + interface INetCfgComponent + { + CONST_VTBL struct INetCfgComponentVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponent_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponent_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponent_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponent_GetDisplayName(This,ppszwDisplayName) \ + (This)->lpVtbl -> GetDisplayName(This,ppszwDisplayName) + +#define INetCfgComponent_SetDisplayName(This,pszwDisplayName) \ + (This)->lpVtbl -> SetDisplayName(This,pszwDisplayName) + +#define INetCfgComponent_GetHelpText(This,pszwHelpText) \ + (This)->lpVtbl -> GetHelpText(This,pszwHelpText) + +#define INetCfgComponent_GetId(This,ppszwId) \ + (This)->lpVtbl -> GetId(This,ppszwId) + +#define INetCfgComponent_GetCharacteristics(This,pdwCharacteristics) \ + (This)->lpVtbl -> GetCharacteristics(This,pdwCharacteristics) + +#define INetCfgComponent_GetInstanceGuid(This,pGuid) \ + (This)->lpVtbl -> GetInstanceGuid(This,pGuid) + +#define INetCfgComponent_GetPnpDevNodeId(This,ppszwDevNodeId) \ + (This)->lpVtbl -> GetPnpDevNodeId(This,ppszwDevNodeId) + +#define INetCfgComponent_GetClassGuid(This,pGuid) \ + (This)->lpVtbl -> GetClassGuid(This,pGuid) + +#define INetCfgComponent_GetBindName(This,ppszwBindName) \ + (This)->lpVtbl -> GetBindName(This,ppszwBindName) + +#define INetCfgComponent_GetDeviceStatus(This,pulStatus) \ + (This)->lpVtbl -> GetDeviceStatus(This,pulStatus) + +#define INetCfgComponent_OpenParamKey(This,phkey) \ + (This)->lpVtbl -> OpenParamKey(This,phkey) + +#define INetCfgComponent_RaisePropertyUi(This,hwndParent,dwFlags,punkContext) \ + (This)->lpVtbl -> RaisePropertyUi(This,hwndParent,dwFlags,punkContext) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetDisplayName_Proxy( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwDisplayName); + + +void __RPC_STUB INetCfgComponent_GetDisplayName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_SetDisplayName_Proxy( + INetCfgComponent * This, + /* [string][in] */ LPCWSTR pszwDisplayName); + + +void __RPC_STUB INetCfgComponent_SetDisplayName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetHelpText_Proxy( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *pszwHelpText); + + +void __RPC_STUB INetCfgComponent_GetHelpText_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetId_Proxy( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwId); + + +void __RPC_STUB INetCfgComponent_GetId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetCharacteristics_Proxy( + INetCfgComponent * This, + /* [out] */ LPDWORD pdwCharacteristics); + + +void __RPC_STUB INetCfgComponent_GetCharacteristics_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetInstanceGuid_Proxy( + INetCfgComponent * This, + /* [out] */ GUID *pGuid); + + +void __RPC_STUB INetCfgComponent_GetInstanceGuid_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetPnpDevNodeId_Proxy( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwDevNodeId); + + +void __RPC_STUB INetCfgComponent_GetPnpDevNodeId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetClassGuid_Proxy( + INetCfgComponent * This, + /* [out] */ GUID *pGuid); + + +void __RPC_STUB INetCfgComponent_GetClassGuid_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetBindName_Proxy( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwBindName); + + +void __RPC_STUB INetCfgComponent_GetBindName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetDeviceStatus_Proxy( + INetCfgComponent * This, + /* [out] */ ULONG *pulStatus); + + +void __RPC_STUB INetCfgComponent_GetDeviceStatus_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_OpenParamKey_Proxy( + INetCfgComponent * This, + /* [out] */ HKEY *phkey); + + +void __RPC_STUB INetCfgComponent_OpenParamKey_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_RaisePropertyUi_Proxy( + INetCfgComponent * This, + /* [in] */ HWND hwndParent, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkContext); + + +void __RPC_STUB INetCfgComponent_RaisePropertyUi_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponent_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponentBindings_INTERFACE_DEFINED__ +#define __INetCfgComponentBindings_INTERFACE_DEFINED__ + +/* interface INetCfgComponentBindings */ +/* [unique][uuid][object][local] */ + +typedef +enum tagSUPPORTS_BINDING_INTERFACE_FLAGS + { NCF_LOWER = 0x1, + NCF_UPPER = 0x2 + } SUPPORTS_BINDING_INTERFACE_FLAGS; + +typedef +enum tagENUM_BINDING_PATHS_FLAGS + { EBP_ABOVE = 0x1, + EBP_BELOW = 0x2 + } ENUM_BINDING_PATHS_FLAGS; + + +EXTERN_C const IID IID_INetCfgComponentBindings; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE9E-306E-11D1-AACF-00805FC1270E") + INetCfgComponentBindings : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE BindTo( + /* [in] */ INetCfgComponent *pnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE UnbindFrom( + /* [in] */ INetCfgComponent *pnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE SupportsBindingInterface( + /* [in] */ DWORD dwFlags, + /* [in] */ LPCWSTR pszwInterfaceName) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsBoundTo( + /* [in] */ INetCfgComponent *pnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsBindableTo( + /* [in] */ INetCfgComponent *pnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumBindingPaths( + /* [in] */ DWORD dwFlags, + /* [out] */ IEnumNetCfgBindingPath **ppIEnum) = 0; + + virtual HRESULT STDMETHODCALLTYPE MoveBefore( + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest) = 0; + + virtual HRESULT STDMETHODCALLTYPE MoveAfter( + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentBindingsVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponentBindings * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponentBindings * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponentBindings * This); + + HRESULT ( STDMETHODCALLTYPE *BindTo )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + HRESULT ( STDMETHODCALLTYPE *UnbindFrom )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + HRESULT ( STDMETHODCALLTYPE *SupportsBindingInterface )( + INetCfgComponentBindings * This, + /* [in] */ DWORD dwFlags, + /* [in] */ LPCWSTR pszwInterfaceName); + + HRESULT ( STDMETHODCALLTYPE *IsBoundTo )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + HRESULT ( STDMETHODCALLTYPE *IsBindableTo )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + HRESULT ( STDMETHODCALLTYPE *EnumBindingPaths )( + INetCfgComponentBindings * This, + /* [in] */ DWORD dwFlags, + /* [out] */ IEnumNetCfgBindingPath **ppIEnum); + + HRESULT ( STDMETHODCALLTYPE *MoveBefore )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest); + + HRESULT ( STDMETHODCALLTYPE *MoveAfter )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest); + + END_INTERFACE + } INetCfgComponentBindingsVtbl; + + interface INetCfgComponentBindings + { + CONST_VTBL struct INetCfgComponentBindingsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponentBindings_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponentBindings_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponentBindings_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponentBindings_BindTo(This,pnccItem) \ + (This)->lpVtbl -> BindTo(This,pnccItem) + +#define INetCfgComponentBindings_UnbindFrom(This,pnccItem) \ + (This)->lpVtbl -> UnbindFrom(This,pnccItem) + +#define INetCfgComponentBindings_SupportsBindingInterface(This,dwFlags,pszwInterfaceName) \ + (This)->lpVtbl -> SupportsBindingInterface(This,dwFlags,pszwInterfaceName) + +#define INetCfgComponentBindings_IsBoundTo(This,pnccItem) \ + (This)->lpVtbl -> IsBoundTo(This,pnccItem) + +#define INetCfgComponentBindings_IsBindableTo(This,pnccItem) \ + (This)->lpVtbl -> IsBindableTo(This,pnccItem) + +#define INetCfgComponentBindings_EnumBindingPaths(This,dwFlags,ppIEnum) \ + (This)->lpVtbl -> EnumBindingPaths(This,dwFlags,ppIEnum) + +#define INetCfgComponentBindings_MoveBefore(This,pncbItemSrc,pncbItemDest) \ + (This)->lpVtbl -> MoveBefore(This,pncbItemSrc,pncbItemDest) + +#define INetCfgComponentBindings_MoveAfter(This,pncbItemSrc,pncbItemDest) \ + (This)->lpVtbl -> MoveAfter(This,pncbItemSrc,pncbItemDest) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_BindTo_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + +void __RPC_STUB INetCfgComponentBindings_BindTo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_UnbindFrom_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + +void __RPC_STUB INetCfgComponentBindings_UnbindFrom_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_SupportsBindingInterface_Proxy( + INetCfgComponentBindings * This, + /* [in] */ DWORD dwFlags, + /* [in] */ LPCWSTR pszwInterfaceName); + + +void __RPC_STUB INetCfgComponentBindings_SupportsBindingInterface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_IsBoundTo_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + +void __RPC_STUB INetCfgComponentBindings_IsBoundTo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_IsBindableTo_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + +void __RPC_STUB INetCfgComponentBindings_IsBindableTo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_EnumBindingPaths_Proxy( + INetCfgComponentBindings * This, + /* [in] */ DWORD dwFlags, + /* [out] */ IEnumNetCfgBindingPath **ppIEnum); + + +void __RPC_STUB INetCfgComponentBindings_EnumBindingPaths_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_MoveBefore_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest); + + +void __RPC_STUB INetCfgComponentBindings_MoveBefore_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_MoveAfter_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest); + + +void __RPC_STUB INetCfgComponentBindings_MoveAfter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponentBindings_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgSysPrep_INTERFACE_DEFINED__ +#define __INetCfgSysPrep_INTERFACE_DEFINED__ + +/* interface INetCfgSysPrep */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgSysPrep; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE98-306E-11D1-AACF-00805FC1270E") + INetCfgSysPrep : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstDword( + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ DWORD dwValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstString( + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [string][in] */ LPCWSTR pwszValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstStringAsBool( + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ BOOL fValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstMultiSzField( + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ LPCWSTR pmszValue) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgSysPrepVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgSysPrep * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgSysPrep * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgSysPrep * This); + + HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstDword )( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ DWORD dwValue); + + HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstString )( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [string][in] */ LPCWSTR pwszValue); + + HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstStringAsBool )( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ BOOL fValue); + + HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstMultiSzField )( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ LPCWSTR pmszValue); + + END_INTERFACE + } INetCfgSysPrepVtbl; + + interface INetCfgSysPrep + { + CONST_VTBL struct INetCfgSysPrepVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgSysPrep_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgSysPrep_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgSysPrep_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgSysPrep_HrSetupSetFirstDword(This,pwszSection,pwszKey,dwValue) \ + (This)->lpVtbl -> HrSetupSetFirstDword(This,pwszSection,pwszKey,dwValue) + +#define INetCfgSysPrep_HrSetupSetFirstString(This,pwszSection,pwszKey,pwszValue) \ + (This)->lpVtbl -> HrSetupSetFirstString(This,pwszSection,pwszKey,pwszValue) + +#define INetCfgSysPrep_HrSetupSetFirstStringAsBool(This,pwszSection,pwszKey,fValue) \ + (This)->lpVtbl -> HrSetupSetFirstStringAsBool(This,pwszSection,pwszKey,fValue) + +#define INetCfgSysPrep_HrSetupSetFirstMultiSzField(This,pwszSection,pwszKey,pmszValue) \ + (This)->lpVtbl -> HrSetupSetFirstMultiSzField(This,pwszSection,pwszKey,pmszValue) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgSysPrep_HrSetupSetFirstDword_Proxy( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ DWORD dwValue); + + +void __RPC_STUB INetCfgSysPrep_HrSetupSetFirstDword_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgSysPrep_HrSetupSetFirstString_Proxy( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [string][in] */ LPCWSTR pwszValue); + + +void __RPC_STUB INetCfgSysPrep_HrSetupSetFirstString_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgSysPrep_HrSetupSetFirstStringAsBool_Proxy( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ BOOL fValue); + + +void __RPC_STUB INetCfgSysPrep_HrSetupSetFirstStringAsBool_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgSysPrep_HrSetupSetFirstMultiSzField_Proxy( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ LPCWSTR pmszValue); + + +void __RPC_STUB INetCfgSysPrep_HrSetupSetFirstMultiSzField_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgSysPrep_INTERFACE_DEFINED__ */ + + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/winpcap_oem/OEM/WinpcapOem/idls_i.c b/winpcap_oem/OEM/WinpcapOem/idls_i.c new file mode 100644 index 00000000..207ee5f4 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/idls_i.c @@ -0,0 +1,230 @@ + + +/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ + +/* link this file in with the server and any clients */ + + + /* File created by MIDL compiler version 6.00.0361 */ +/* Compiler settings for idls.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#if !defined(_M_IA64) && !defined(_M_AMD64) + + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +#ifdef __cplusplus +extern "C"{ +#endif + + +#include +#include + +#ifdef _MIDL_USE_GUIDDEF_ + +#ifndef INITGUID +#define INITGUID +#include +#undef INITGUID +#else +#include +#endif + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) + +#else // !_MIDL_USE_GUIDDEF_ + +#ifndef __IID_DEFINED__ +#define __IID_DEFINED__ + +typedef struct _IID +{ + unsigned long x; + unsigned short s1; + unsigned short s2; + unsigned char c[8]; +} IID; + +#endif // __IID_DEFINED__ + +#ifndef CLSID_DEFINED +#define CLSID_DEFINED +typedef IID CLSID; +#endif // CLSID_DEFINED + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + +#endif !_MIDL_USE_GUIDDEF_ + +MIDL_DEFINE_GUID(IID, IID_IEnumNetCfgBindingInterface,0xC0E8AE90,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_IEnumNetCfgBindingPath,0xC0E8AE91,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_IEnumNetCfgComponent,0xC0E8AE92,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfg,0xC0E8AE93,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgLock,0xC0E8AE9F,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgBindingInterface,0xC0E8AE94,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgBindingPath,0xC0E8AE96,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgClass,0xC0E8AE97,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgClassSetup,0xC0E8AE9D,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgComponent,0xC0E8AE99,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgComponentBindings,0xC0E8AE9E,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgSysPrep,0xC0E8AE98,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + +#undef MIDL_DEFINE_GUID + +#ifdef __cplusplus +} +#endif + + + +#endif /* !defined(_M_IA64) && !defined(_M_AMD64)*/ + + + +/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ + +/* link this file in with the server and any clients */ + + + /* File created by MIDL compiler version 6.00.0361 */ +/* Compiler settings for idls.idl: + Oicf, W1, Zp8, env=Win64 (32b run,appending) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#if defined(_M_IA64) || defined(_M_AMD64) + + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +#ifdef __cplusplus +extern "C"{ +#endif + + +#include +#include + +#ifdef _MIDL_USE_GUIDDEF_ + +#ifndef INITGUID +#define INITGUID +#include +#undef INITGUID +#else +#include +#endif + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) + +#else // !_MIDL_USE_GUIDDEF_ + +#ifndef __IID_DEFINED__ +#define __IID_DEFINED__ + +typedef struct _IID +{ + unsigned long x; + unsigned short s1; + unsigned short s2; + unsigned char c[8]; +} IID; + +#endif // __IID_DEFINED__ + +#ifndef CLSID_DEFINED +#define CLSID_DEFINED +typedef IID CLSID; +#endif // CLSID_DEFINED + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + +#endif !_MIDL_USE_GUIDDEF_ + +MIDL_DEFINE_GUID(IID, IID_IEnumNetCfgBindingInterface,0xC0E8AE90,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_IEnumNetCfgBindingPath,0xC0E8AE91,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_IEnumNetCfgComponent,0xC0E8AE92,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfg,0xC0E8AE93,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgLock,0xC0E8AE9F,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgBindingInterface,0xC0E8AE94,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgBindingPath,0xC0E8AE96,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgClass,0xC0E8AE97,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgClassSetup,0xC0E8AE9D,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgComponent,0xC0E8AE99,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgComponentBindings,0xC0E8AE9E,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + + +MIDL_DEFINE_GUID(IID, IID_INetCfgSysPrep,0xC0E8AE98,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); + +#undef MIDL_DEFINE_GUID + +#ifdef __cplusplus +} +#endif + + + +#endif /* defined(_M_IA64) || defined(_M_AMD64)*/ + diff --git a/winpcap_oem/OEM/WinpcapOem/netcfgn.h b/winpcap_oem/OEM/WinpcapOem/netcfgn.h new file mode 100644 index 00000000..7e3bf07f --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/netcfgn.h @@ -0,0 +1,1450 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0361 */ +/* Compiler settings for netcfgn.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __netcfgn_h__ +#define __netcfgn_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __INetCfgPnpReconfigCallback_FWD_DEFINED__ +#define __INetCfgPnpReconfigCallback_FWD_DEFINED__ +typedef interface INetCfgPnpReconfigCallback INetCfgPnpReconfigCallback; +#endif /* __INetCfgPnpReconfigCallback_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponentControl_FWD_DEFINED__ +#define __INetCfgComponentControl_FWD_DEFINED__ +typedef interface INetCfgComponentControl INetCfgComponentControl; +#endif /* __INetCfgComponentControl_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponentSetup_FWD_DEFINED__ +#define __INetCfgComponentSetup_FWD_DEFINED__ +typedef interface INetCfgComponentSetup INetCfgComponentSetup; +#endif /* __INetCfgComponentSetup_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponentPropertyUi_FWD_DEFINED__ +#define __INetCfgComponentPropertyUi_FWD_DEFINED__ +typedef interface INetCfgComponentPropertyUi INetCfgComponentPropertyUi; +#endif /* __INetCfgComponentPropertyUi_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponentNotifyBinding_FWD_DEFINED__ +#define __INetCfgComponentNotifyBinding_FWD_DEFINED__ +typedef interface INetCfgComponentNotifyBinding INetCfgComponentNotifyBinding; +#endif /* __INetCfgComponentNotifyBinding_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponentNotifyGlobal_FWD_DEFINED__ +#define __INetCfgComponentNotifyGlobal_FWD_DEFINED__ +typedef interface INetCfgComponentNotifyGlobal INetCfgComponentNotifyGlobal; +#endif /* __INetCfgComponentNotifyGlobal_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponentUpperEdge_FWD_DEFINED__ +#define __INetCfgComponentUpperEdge_FWD_DEFINED__ +typedef interface INetCfgComponentUpperEdge INetCfgComponentUpperEdge; +#endif /* __INetCfgComponentUpperEdge_FWD_DEFINED__ */ + + +#ifndef __INetLanConnectionUiInfo_FWD_DEFINED__ +#define __INetLanConnectionUiInfo_FWD_DEFINED__ +typedef interface INetLanConnectionUiInfo INetLanConnectionUiInfo; +#endif /* __INetLanConnectionUiInfo_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponentSysPrep_FWD_DEFINED__ +#define __INetCfgComponentSysPrep_FWD_DEFINED__ +typedef interface INetCfgComponentSysPrep INetCfgComponentSysPrep; +#endif /* __INetCfgComponentSysPrep_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "unknwn.h" +#include "netcfgx.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +/* interface __MIDL_itf_netcfgn_0000 */ +/* [local] */ + +//+------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//-------------------------------------------------------------------------- +#if ( _MSC_VER >= 800 ) +#pragma warning(disable:4201) +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_netcfgn_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_netcfgn_0000_v0_0_s_ifspec; + +#ifndef __INetCfgPnpReconfigCallback_INTERFACE_DEFINED__ +#define __INetCfgPnpReconfigCallback_INTERFACE_DEFINED__ + +/* interface INetCfgPnpReconfigCallback */ +/* [unique][uuid][object][local] */ + +typedef /* [v1_enum] */ +enum tagNCPNP_RECONFIG_LAYER + { NCRL_NDIS = 1, + NCRL_TDI = 2 + } NCPNP_RECONFIG_LAYER; + + +EXTERN_C const IID IID_INetCfgPnpReconfigCallback; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8d84bd35-e227-11d2-b700-00a0c98a6a85") + INetCfgPnpReconfigCallback : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SendPnpReconfig( + /* [in] */ NCPNP_RECONFIG_LAYER Layer, + /* [in] */ LPCWSTR pszwUpper, + /* [in] */ LPCWSTR pszwLower, + /* [in] */ PVOID pvData, + /* [in] */ DWORD dwSizeOfData) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgPnpReconfigCallbackVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgPnpReconfigCallback * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgPnpReconfigCallback * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgPnpReconfigCallback * This); + + HRESULT ( STDMETHODCALLTYPE *SendPnpReconfig )( + INetCfgPnpReconfigCallback * This, + /* [in] */ NCPNP_RECONFIG_LAYER Layer, + /* [in] */ LPCWSTR pszwUpper, + /* [in] */ LPCWSTR pszwLower, + /* [in] */ PVOID pvData, + /* [in] */ DWORD dwSizeOfData); + + END_INTERFACE + } INetCfgPnpReconfigCallbackVtbl; + + interface INetCfgPnpReconfigCallback + { + CONST_VTBL struct INetCfgPnpReconfigCallbackVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgPnpReconfigCallback_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgPnpReconfigCallback_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgPnpReconfigCallback_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgPnpReconfigCallback_SendPnpReconfig(This,Layer,pszwUpper,pszwLower,pvData,dwSizeOfData) \ + (This)->lpVtbl -> SendPnpReconfig(This,Layer,pszwUpper,pszwLower,pvData,dwSizeOfData) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgPnpReconfigCallback_SendPnpReconfig_Proxy( + INetCfgPnpReconfigCallback * This, + /* [in] */ NCPNP_RECONFIG_LAYER Layer, + /* [in] */ LPCWSTR pszwUpper, + /* [in] */ LPCWSTR pszwLower, + /* [in] */ PVOID pvData, + /* [in] */ DWORD dwSizeOfData); + + +void __RPC_STUB INetCfgPnpReconfigCallback_SendPnpReconfig_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgPnpReconfigCallback_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponentControl_INTERFACE_DEFINED__ +#define __INetCfgComponentControl_INTERFACE_DEFINED__ + +/* interface INetCfgComponentControl */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgComponentControl; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("932238df-bea1-11d0-9298-00c04fc99dcf") + INetCfgComponentControl : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Initialize( + /* [in] */ INetCfgComponent *pIComp, + /* [in] */ INetCfg *pINetCfg, + /* [in] */ BOOL fInstalling) = 0; + + virtual HRESULT STDMETHODCALLTYPE ApplyRegistryChanges( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE ApplyPnpChanges( + /* [in] */ INetCfgPnpReconfigCallback *pICallback) = 0; + + virtual HRESULT STDMETHODCALLTYPE CancelChanges( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentControlVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponentControl * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponentControl * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponentControl * This); + + HRESULT ( STDMETHODCALLTYPE *Initialize )( + INetCfgComponentControl * This, + /* [in] */ INetCfgComponent *pIComp, + /* [in] */ INetCfg *pINetCfg, + /* [in] */ BOOL fInstalling); + + HRESULT ( STDMETHODCALLTYPE *ApplyRegistryChanges )( + INetCfgComponentControl * This); + + HRESULT ( STDMETHODCALLTYPE *ApplyPnpChanges )( + INetCfgComponentControl * This, + /* [in] */ INetCfgPnpReconfigCallback *pICallback); + + HRESULT ( STDMETHODCALLTYPE *CancelChanges )( + INetCfgComponentControl * This); + + END_INTERFACE + } INetCfgComponentControlVtbl; + + interface INetCfgComponentControl + { + CONST_VTBL struct INetCfgComponentControlVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponentControl_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponentControl_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponentControl_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponentControl_Initialize(This,pIComp,pINetCfg,fInstalling) \ + (This)->lpVtbl -> Initialize(This,pIComp,pINetCfg,fInstalling) + +#define INetCfgComponentControl_ApplyRegistryChanges(This) \ + (This)->lpVtbl -> ApplyRegistryChanges(This) + +#define INetCfgComponentControl_ApplyPnpChanges(This,pICallback) \ + (This)->lpVtbl -> ApplyPnpChanges(This,pICallback) + +#define INetCfgComponentControl_CancelChanges(This) \ + (This)->lpVtbl -> CancelChanges(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponentControl_Initialize_Proxy( + INetCfgComponentControl * This, + /* [in] */ INetCfgComponent *pIComp, + /* [in] */ INetCfg *pINetCfg, + /* [in] */ BOOL fInstalling); + + +void __RPC_STUB INetCfgComponentControl_Initialize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentControl_ApplyRegistryChanges_Proxy( + INetCfgComponentControl * This); + + +void __RPC_STUB INetCfgComponentControl_ApplyRegistryChanges_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentControl_ApplyPnpChanges_Proxy( + INetCfgComponentControl * This, + /* [in] */ INetCfgPnpReconfigCallback *pICallback); + + +void __RPC_STUB INetCfgComponentControl_ApplyPnpChanges_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentControl_CancelChanges_Proxy( + INetCfgComponentControl * This); + + +void __RPC_STUB INetCfgComponentControl_CancelChanges_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponentControl_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponentSetup_INTERFACE_DEFINED__ +#define __INetCfgComponentSetup_INTERFACE_DEFINED__ + +/* interface INetCfgComponentSetup */ +/* [unique][uuid][object][local] */ + +typedef /* [v1_enum] */ +enum tagNETWORK_INSTALL_TIME + { NSF_PRIMARYINSTALL = 0x1, + NSF_POSTSYSINSTALL = 0x2 + } NETWORK_INSTALL_TIME; + +typedef /* [v1_enum] */ +enum tagNETWORK_UPGRADE_TYPE + { NSF_WIN16_UPGRADE = 0x10, + NSF_WIN95_UPGRADE = 0x20, + NSF_WINNT_WKS_UPGRADE = 0x40, + NSF_WINNT_SVR_UPGRADE = 0x80, + NSF_WINNT_SBS_UPGRADE = 0x100, + NSF_COMPONENT_UPDATE = 0x200 + } NETWORK_UPGRADE_TYPE; + + +EXTERN_C const IID IID_INetCfgComponentSetup; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("932238e3-bea1-11d0-9298-00c04fc99dcf") + INetCfgComponentSetup : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Install( + /* [in] */ DWORD dwSetupFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE Upgrade( + /* [in] */ DWORD dwSetupFlags, + /* [in] */ DWORD dwUpgradeFomBuildNo) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReadAnswerFile( + /* [in] */ LPCWSTR pszwAnswerFile, + /* [in] */ LPCWSTR pszwAnswerSections) = 0; + + virtual HRESULT STDMETHODCALLTYPE Removing( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentSetupVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponentSetup * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponentSetup * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponentSetup * This); + + HRESULT ( STDMETHODCALLTYPE *Install )( + INetCfgComponentSetup * This, + /* [in] */ DWORD dwSetupFlags); + + HRESULT ( STDMETHODCALLTYPE *Upgrade )( + INetCfgComponentSetup * This, + /* [in] */ DWORD dwSetupFlags, + /* [in] */ DWORD dwUpgradeFomBuildNo); + + HRESULT ( STDMETHODCALLTYPE *ReadAnswerFile )( + INetCfgComponentSetup * This, + /* [in] */ LPCWSTR pszwAnswerFile, + /* [in] */ LPCWSTR pszwAnswerSections); + + HRESULT ( STDMETHODCALLTYPE *Removing )( + INetCfgComponentSetup * This); + + END_INTERFACE + } INetCfgComponentSetupVtbl; + + interface INetCfgComponentSetup + { + CONST_VTBL struct INetCfgComponentSetupVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponentSetup_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponentSetup_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponentSetup_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponentSetup_Install(This,dwSetupFlags) \ + (This)->lpVtbl -> Install(This,dwSetupFlags) + +#define INetCfgComponentSetup_Upgrade(This,dwSetupFlags,dwUpgradeFomBuildNo) \ + (This)->lpVtbl -> Upgrade(This,dwSetupFlags,dwUpgradeFomBuildNo) + +#define INetCfgComponentSetup_ReadAnswerFile(This,pszwAnswerFile,pszwAnswerSections) \ + (This)->lpVtbl -> ReadAnswerFile(This,pszwAnswerFile,pszwAnswerSections) + +#define INetCfgComponentSetup_Removing(This) \ + (This)->lpVtbl -> Removing(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponentSetup_Install_Proxy( + INetCfgComponentSetup * This, + /* [in] */ DWORD dwSetupFlags); + + +void __RPC_STUB INetCfgComponentSetup_Install_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentSetup_Upgrade_Proxy( + INetCfgComponentSetup * This, + /* [in] */ DWORD dwSetupFlags, + /* [in] */ DWORD dwUpgradeFomBuildNo); + + +void __RPC_STUB INetCfgComponentSetup_Upgrade_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentSetup_ReadAnswerFile_Proxy( + INetCfgComponentSetup * This, + /* [in] */ LPCWSTR pszwAnswerFile, + /* [in] */ LPCWSTR pszwAnswerSections); + + +void __RPC_STUB INetCfgComponentSetup_ReadAnswerFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentSetup_Removing_Proxy( + INetCfgComponentSetup * This); + + +void __RPC_STUB INetCfgComponentSetup_Removing_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponentSetup_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponentPropertyUi_INTERFACE_DEFINED__ +#define __INetCfgComponentPropertyUi_INTERFACE_DEFINED__ + +/* interface INetCfgComponentPropertyUi */ +/* [unique][uuid][object][local] */ + +typedef /* [v1_enum] */ +enum tagDEFAULT_PAGES + { DPP_ADVANCED = 1 + } DEFAULT_PAGES; + + +EXTERN_C const IID IID_INetCfgComponentPropertyUi; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("932238e0-bea1-11d0-9298-00c04fc99dcf") + INetCfgComponentPropertyUi : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE QueryPropertyUi( + /* [in] */ IUnknown *pUnkReserved) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetContext( + /* [in] */ IUnknown *pUnkReserved) = 0; + + virtual HRESULT STDMETHODCALLTYPE MergePropPages( + /* [out][in] */ DWORD *pdwDefPages, + /* [out] */ BYTE **pahpspPrivate, + /* [out] */ UINT *pcPages, + /* [in] */ HWND hwndParent, + /* [out] */ LPCWSTR *pszStartPage) = 0; + + virtual HRESULT STDMETHODCALLTYPE ValidateProperties( + /* [in] */ HWND hwndSheet) = 0; + + virtual HRESULT STDMETHODCALLTYPE ApplyProperties( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE CancelProperties( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentPropertyUiVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponentPropertyUi * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponentPropertyUi * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponentPropertyUi * This); + + HRESULT ( STDMETHODCALLTYPE *QueryPropertyUi )( + INetCfgComponentPropertyUi * This, + /* [in] */ IUnknown *pUnkReserved); + + HRESULT ( STDMETHODCALLTYPE *SetContext )( + INetCfgComponentPropertyUi * This, + /* [in] */ IUnknown *pUnkReserved); + + HRESULT ( STDMETHODCALLTYPE *MergePropPages )( + INetCfgComponentPropertyUi * This, + /* [out][in] */ DWORD *pdwDefPages, + /* [out] */ BYTE **pahpspPrivate, + /* [out] */ UINT *pcPages, + /* [in] */ HWND hwndParent, + /* [out] */ LPCWSTR *pszStartPage); + + HRESULT ( STDMETHODCALLTYPE *ValidateProperties )( + INetCfgComponentPropertyUi * This, + /* [in] */ HWND hwndSheet); + + HRESULT ( STDMETHODCALLTYPE *ApplyProperties )( + INetCfgComponentPropertyUi * This); + + HRESULT ( STDMETHODCALLTYPE *CancelProperties )( + INetCfgComponentPropertyUi * This); + + END_INTERFACE + } INetCfgComponentPropertyUiVtbl; + + interface INetCfgComponentPropertyUi + { + CONST_VTBL struct INetCfgComponentPropertyUiVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponentPropertyUi_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponentPropertyUi_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponentPropertyUi_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponentPropertyUi_QueryPropertyUi(This,pUnkReserved) \ + (This)->lpVtbl -> QueryPropertyUi(This,pUnkReserved) + +#define INetCfgComponentPropertyUi_SetContext(This,pUnkReserved) \ + (This)->lpVtbl -> SetContext(This,pUnkReserved) + +#define INetCfgComponentPropertyUi_MergePropPages(This,pdwDefPages,pahpspPrivate,pcPages,hwndParent,pszStartPage) \ + (This)->lpVtbl -> MergePropPages(This,pdwDefPages,pahpspPrivate,pcPages,hwndParent,pszStartPage) + +#define INetCfgComponentPropertyUi_ValidateProperties(This,hwndSheet) \ + (This)->lpVtbl -> ValidateProperties(This,hwndSheet) + +#define INetCfgComponentPropertyUi_ApplyProperties(This) \ + (This)->lpVtbl -> ApplyProperties(This) + +#define INetCfgComponentPropertyUi_CancelProperties(This) \ + (This)->lpVtbl -> CancelProperties(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponentPropertyUi_QueryPropertyUi_Proxy( + INetCfgComponentPropertyUi * This, + /* [in] */ IUnknown *pUnkReserved); + + +void __RPC_STUB INetCfgComponentPropertyUi_QueryPropertyUi_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentPropertyUi_SetContext_Proxy( + INetCfgComponentPropertyUi * This, + /* [in] */ IUnknown *pUnkReserved); + + +void __RPC_STUB INetCfgComponentPropertyUi_SetContext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentPropertyUi_MergePropPages_Proxy( + INetCfgComponentPropertyUi * This, + /* [out][in] */ DWORD *pdwDefPages, + /* [out] */ BYTE **pahpspPrivate, + /* [out] */ UINT *pcPages, + /* [in] */ HWND hwndParent, + /* [out] */ LPCWSTR *pszStartPage); + + +void __RPC_STUB INetCfgComponentPropertyUi_MergePropPages_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentPropertyUi_ValidateProperties_Proxy( + INetCfgComponentPropertyUi * This, + /* [in] */ HWND hwndSheet); + + +void __RPC_STUB INetCfgComponentPropertyUi_ValidateProperties_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentPropertyUi_ApplyProperties_Proxy( + INetCfgComponentPropertyUi * This); + + +void __RPC_STUB INetCfgComponentPropertyUi_ApplyProperties_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentPropertyUi_CancelProperties_Proxy( + INetCfgComponentPropertyUi * This); + + +void __RPC_STUB INetCfgComponentPropertyUi_CancelProperties_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponentPropertyUi_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponentNotifyBinding_INTERFACE_DEFINED__ +#define __INetCfgComponentNotifyBinding_INTERFACE_DEFINED__ + +/* interface INetCfgComponentNotifyBinding */ +/* [unique][uuid][object][local] */ + +typedef /* [v1_enum] */ +enum tagBIND_FLAGS1 + { NCN_ADD = 0x1, + NCN_REMOVE = 0x2, + NCN_UPDATE = 0x4, + NCN_ENABLE = 0x10, + NCN_DISABLE = 0x20, + NCN_BINDING_PATH = 0x100, + NCN_PROPERTYCHANGE = 0x200, + NCN_NET = 0x10000, + NCN_NETTRANS = 0x20000, + NCN_NETCLIENT = 0x40000, + NCN_NETSERVICE = 0x80000 + } BIND_FLAGS1; + + +EXTERN_C const IID IID_INetCfgComponentNotifyBinding; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("932238e1-bea1-11d0-9298-00c04fc99dcf") + INetCfgComponentNotifyBinding : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE QueryBindingPath( + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath) = 0; + + virtual HRESULT STDMETHODCALLTYPE NotifyBindingPath( + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentNotifyBindingVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponentNotifyBinding * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponentNotifyBinding * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponentNotifyBinding * This); + + HRESULT ( STDMETHODCALLTYPE *QueryBindingPath )( + INetCfgComponentNotifyBinding * This, + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath); + + HRESULT ( STDMETHODCALLTYPE *NotifyBindingPath )( + INetCfgComponentNotifyBinding * This, + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath); + + END_INTERFACE + } INetCfgComponentNotifyBindingVtbl; + + interface INetCfgComponentNotifyBinding + { + CONST_VTBL struct INetCfgComponentNotifyBindingVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponentNotifyBinding_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponentNotifyBinding_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponentNotifyBinding_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponentNotifyBinding_QueryBindingPath(This,dwChangeFlag,pIPath) \ + (This)->lpVtbl -> QueryBindingPath(This,dwChangeFlag,pIPath) + +#define INetCfgComponentNotifyBinding_NotifyBindingPath(This,dwChangeFlag,pIPath) \ + (This)->lpVtbl -> NotifyBindingPath(This,dwChangeFlag,pIPath) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponentNotifyBinding_QueryBindingPath_Proxy( + INetCfgComponentNotifyBinding * This, + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath); + + +void __RPC_STUB INetCfgComponentNotifyBinding_QueryBindingPath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentNotifyBinding_NotifyBindingPath_Proxy( + INetCfgComponentNotifyBinding * This, + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath); + + +void __RPC_STUB INetCfgComponentNotifyBinding_NotifyBindingPath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponentNotifyBinding_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponentNotifyGlobal_INTERFACE_DEFINED__ +#define __INetCfgComponentNotifyGlobal_INTERFACE_DEFINED__ + +/* interface INetCfgComponentNotifyGlobal */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgComponentNotifyGlobal; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("932238e2-bea1-11d0-9298-00c04fc99dcf") + INetCfgComponentNotifyGlobal : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetSupportedNotifications( + /* [out] */ DWORD *dwNotifications) = 0; + + virtual HRESULT STDMETHODCALLTYPE SysQueryBindingPath( + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath) = 0; + + virtual HRESULT STDMETHODCALLTYPE SysNotifyBindingPath( + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath) = 0; + + virtual HRESULT STDMETHODCALLTYPE SysNotifyComponent( + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgComponent *pIComp) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentNotifyGlobalVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponentNotifyGlobal * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponentNotifyGlobal * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponentNotifyGlobal * This); + + HRESULT ( STDMETHODCALLTYPE *GetSupportedNotifications )( + INetCfgComponentNotifyGlobal * This, + /* [out] */ DWORD *dwNotifications); + + HRESULT ( STDMETHODCALLTYPE *SysQueryBindingPath )( + INetCfgComponentNotifyGlobal * This, + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath); + + HRESULT ( STDMETHODCALLTYPE *SysNotifyBindingPath )( + INetCfgComponentNotifyGlobal * This, + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath); + + HRESULT ( STDMETHODCALLTYPE *SysNotifyComponent )( + INetCfgComponentNotifyGlobal * This, + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgComponent *pIComp); + + END_INTERFACE + } INetCfgComponentNotifyGlobalVtbl; + + interface INetCfgComponentNotifyGlobal + { + CONST_VTBL struct INetCfgComponentNotifyGlobalVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponentNotifyGlobal_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponentNotifyGlobal_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponentNotifyGlobal_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponentNotifyGlobal_GetSupportedNotifications(This,dwNotifications) \ + (This)->lpVtbl -> GetSupportedNotifications(This,dwNotifications) + +#define INetCfgComponentNotifyGlobal_SysQueryBindingPath(This,dwChangeFlag,pIPath) \ + (This)->lpVtbl -> SysQueryBindingPath(This,dwChangeFlag,pIPath) + +#define INetCfgComponentNotifyGlobal_SysNotifyBindingPath(This,dwChangeFlag,pIPath) \ + (This)->lpVtbl -> SysNotifyBindingPath(This,dwChangeFlag,pIPath) + +#define INetCfgComponentNotifyGlobal_SysNotifyComponent(This,dwChangeFlag,pIComp) \ + (This)->lpVtbl -> SysNotifyComponent(This,dwChangeFlag,pIComp) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponentNotifyGlobal_GetSupportedNotifications_Proxy( + INetCfgComponentNotifyGlobal * This, + /* [out] */ DWORD *dwNotifications); + + +void __RPC_STUB INetCfgComponentNotifyGlobal_GetSupportedNotifications_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentNotifyGlobal_SysQueryBindingPath_Proxy( + INetCfgComponentNotifyGlobal * This, + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath); + + +void __RPC_STUB INetCfgComponentNotifyGlobal_SysQueryBindingPath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentNotifyGlobal_SysNotifyBindingPath_Proxy( + INetCfgComponentNotifyGlobal * This, + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgBindingPath *pIPath); + + +void __RPC_STUB INetCfgComponentNotifyGlobal_SysNotifyBindingPath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentNotifyGlobal_SysNotifyComponent_Proxy( + INetCfgComponentNotifyGlobal * This, + /* [in] */ DWORD dwChangeFlag, + /* [in] */ INetCfgComponent *pIComp); + + +void __RPC_STUB INetCfgComponentNotifyGlobal_SysNotifyComponent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponentNotifyGlobal_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponentUpperEdge_INTERFACE_DEFINED__ +#define __INetCfgComponentUpperEdge_INTERFACE_DEFINED__ + +/* interface INetCfgComponentUpperEdge */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgComponentUpperEdge; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("932238e4-bea1-11d0-9298-00c04fc99dcf") + INetCfgComponentUpperEdge : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetInterfaceIdsForAdapter( + /* [in] */ INetCfgComponent *pAdapter, + /* [out] */ DWORD *pdwNumInterfaces, + /* [out] */ GUID **ppguidInterfaceIds) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddInterfacesToAdapter( + /* [in] */ INetCfgComponent *pAdapter, + /* [in] */ DWORD dwNumInterfaces) = 0; + + virtual HRESULT STDMETHODCALLTYPE RemoveInterfacesFromAdapter( + /* [in] */ INetCfgComponent *pAdapter, + /* [in] */ DWORD dwNumInterfaces, + /* [in] */ const GUID *pguidInterfaceIds) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentUpperEdgeVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponentUpperEdge * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponentUpperEdge * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponentUpperEdge * This); + + HRESULT ( STDMETHODCALLTYPE *GetInterfaceIdsForAdapter )( + INetCfgComponentUpperEdge * This, + /* [in] */ INetCfgComponent *pAdapter, + /* [out] */ DWORD *pdwNumInterfaces, + /* [out] */ GUID **ppguidInterfaceIds); + + HRESULT ( STDMETHODCALLTYPE *AddInterfacesToAdapter )( + INetCfgComponentUpperEdge * This, + /* [in] */ INetCfgComponent *pAdapter, + /* [in] */ DWORD dwNumInterfaces); + + HRESULT ( STDMETHODCALLTYPE *RemoveInterfacesFromAdapter )( + INetCfgComponentUpperEdge * This, + /* [in] */ INetCfgComponent *pAdapter, + /* [in] */ DWORD dwNumInterfaces, + /* [in] */ const GUID *pguidInterfaceIds); + + END_INTERFACE + } INetCfgComponentUpperEdgeVtbl; + + interface INetCfgComponentUpperEdge + { + CONST_VTBL struct INetCfgComponentUpperEdgeVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponentUpperEdge_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponentUpperEdge_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponentUpperEdge_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponentUpperEdge_GetInterfaceIdsForAdapter(This,pAdapter,pdwNumInterfaces,ppguidInterfaceIds) \ + (This)->lpVtbl -> GetInterfaceIdsForAdapter(This,pAdapter,pdwNumInterfaces,ppguidInterfaceIds) + +#define INetCfgComponentUpperEdge_AddInterfacesToAdapter(This,pAdapter,dwNumInterfaces) \ + (This)->lpVtbl -> AddInterfacesToAdapter(This,pAdapter,dwNumInterfaces) + +#define INetCfgComponentUpperEdge_RemoveInterfacesFromAdapter(This,pAdapter,dwNumInterfaces,pguidInterfaceIds) \ + (This)->lpVtbl -> RemoveInterfacesFromAdapter(This,pAdapter,dwNumInterfaces,pguidInterfaceIds) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponentUpperEdge_GetInterfaceIdsForAdapter_Proxy( + INetCfgComponentUpperEdge * This, + /* [in] */ INetCfgComponent *pAdapter, + /* [out] */ DWORD *pdwNumInterfaces, + /* [out] */ GUID **ppguidInterfaceIds); + + +void __RPC_STUB INetCfgComponentUpperEdge_GetInterfaceIdsForAdapter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentUpperEdge_AddInterfacesToAdapter_Proxy( + INetCfgComponentUpperEdge * This, + /* [in] */ INetCfgComponent *pAdapter, + /* [in] */ DWORD dwNumInterfaces); + + +void __RPC_STUB INetCfgComponentUpperEdge_AddInterfacesToAdapter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentUpperEdge_RemoveInterfacesFromAdapter_Proxy( + INetCfgComponentUpperEdge * This, + /* [in] */ INetCfgComponent *pAdapter, + /* [in] */ DWORD dwNumInterfaces, + /* [in] */ const GUID *pguidInterfaceIds); + + +void __RPC_STUB INetCfgComponentUpperEdge_RemoveInterfacesFromAdapter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponentUpperEdge_INTERFACE_DEFINED__ */ + + +#ifndef __INetLanConnectionUiInfo_INTERFACE_DEFINED__ +#define __INetLanConnectionUiInfo_INTERFACE_DEFINED__ + +/* interface INetLanConnectionUiInfo */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_INetLanConnectionUiInfo; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C08956A6-1CD3-11D1-B1C5-00805FC1270E") + INetLanConnectionUiInfo : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDeviceGuid( + /* [out] */ GUID *pguid) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetLanConnectionUiInfoVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetLanConnectionUiInfo * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetLanConnectionUiInfo * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetLanConnectionUiInfo * This); + + HRESULT ( STDMETHODCALLTYPE *GetDeviceGuid )( + INetLanConnectionUiInfo * This, + /* [out] */ GUID *pguid); + + END_INTERFACE + } INetLanConnectionUiInfoVtbl; + + interface INetLanConnectionUiInfo + { + CONST_VTBL struct INetLanConnectionUiInfoVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetLanConnectionUiInfo_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetLanConnectionUiInfo_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetLanConnectionUiInfo_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetLanConnectionUiInfo_GetDeviceGuid(This,pguid) \ + (This)->lpVtbl -> GetDeviceGuid(This,pguid) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetLanConnectionUiInfo_GetDeviceGuid_Proxy( + INetLanConnectionUiInfo * This, + /* [out] */ GUID *pguid); + + +void __RPC_STUB INetLanConnectionUiInfo_GetDeviceGuid_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetLanConnectionUiInfo_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponentSysPrep_INTERFACE_DEFINED__ +#define __INetCfgComponentSysPrep_INTERFACE_DEFINED__ + +/* interface INetCfgComponentSysPrep */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgComponentSysPrep; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE9A-306E-11D1-AACF-00805FC1270E") + INetCfgComponentSysPrep : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SaveAdapterParameters( + /* [in] */ INetCfgSysPrep *pncsp, + /* [in] */ LPCWSTR pszwAnswerSections, + /* [in] */ GUID *pAdapterInstanceGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE RestoreAdapterParameters( + /* [in] */ LPCWSTR pszwAnswerFile, + /* [in] */ LPCWSTR pszwAnswerSection, + /* [in] */ GUID *pAdapterInstanceGuid) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentSysPrepVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponentSysPrep * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponentSysPrep * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponentSysPrep * This); + + HRESULT ( STDMETHODCALLTYPE *SaveAdapterParameters )( + INetCfgComponentSysPrep * This, + /* [in] */ INetCfgSysPrep *pncsp, + /* [in] */ LPCWSTR pszwAnswerSections, + /* [in] */ GUID *pAdapterInstanceGuid); + + HRESULT ( STDMETHODCALLTYPE *RestoreAdapterParameters )( + INetCfgComponentSysPrep * This, + /* [in] */ LPCWSTR pszwAnswerFile, + /* [in] */ LPCWSTR pszwAnswerSection, + /* [in] */ GUID *pAdapterInstanceGuid); + + END_INTERFACE + } INetCfgComponentSysPrepVtbl; + + interface INetCfgComponentSysPrep + { + CONST_VTBL struct INetCfgComponentSysPrepVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponentSysPrep_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponentSysPrep_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponentSysPrep_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponentSysPrep_SaveAdapterParameters(This,pncsp,pszwAnswerSections,pAdapterInstanceGuid) \ + (This)->lpVtbl -> SaveAdapterParameters(This,pncsp,pszwAnswerSections,pAdapterInstanceGuid) + +#define INetCfgComponentSysPrep_RestoreAdapterParameters(This,pszwAnswerFile,pszwAnswerSection,pAdapterInstanceGuid) \ + (This)->lpVtbl -> RestoreAdapterParameters(This,pszwAnswerFile,pszwAnswerSection,pAdapterInstanceGuid) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponentSysPrep_SaveAdapterParameters_Proxy( + INetCfgComponentSysPrep * This, + /* [in] */ INetCfgSysPrep *pncsp, + /* [in] */ LPCWSTR pszwAnswerSections, + /* [in] */ GUID *pAdapterInstanceGuid); + + +void __RPC_STUB INetCfgComponentSysPrep_SaveAdapterParameters_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentSysPrep_RestoreAdapterParameters_Proxy( + INetCfgComponentSysPrep * This, + /* [in] */ LPCWSTR pszwAnswerFile, + /* [in] */ LPCWSTR pszwAnswerSection, + /* [in] */ GUID *pAdapterInstanceGuid); + + +void __RPC_STUB INetCfgComponentSysPrep_RestoreAdapterParameters_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponentSysPrep_INTERFACE_DEFINED__ */ + + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + + diff --git a/winpcap_oem/OEM/WinpcapOem/netcfgx.h b/winpcap_oem/OEM/WinpcapOem/netcfgx.h new file mode 100644 index 00000000..c3021e27 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/netcfgx.h @@ -0,0 +1,2519 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0361 */ +/* Compiler settings for netcfgx.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __netcfgx_h__ +#define __netcfgx_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IEnumNetCfgBindingInterface_FWD_DEFINED__ +#define __IEnumNetCfgBindingInterface_FWD_DEFINED__ +typedef interface IEnumNetCfgBindingInterface IEnumNetCfgBindingInterface; +#endif /* __IEnumNetCfgBindingInterface_FWD_DEFINED__ */ + + +#ifndef __IEnumNetCfgBindingPath_FWD_DEFINED__ +#define __IEnumNetCfgBindingPath_FWD_DEFINED__ +typedef interface IEnumNetCfgBindingPath IEnumNetCfgBindingPath; +#endif /* __IEnumNetCfgBindingPath_FWD_DEFINED__ */ + + +#ifndef __IEnumNetCfgComponent_FWD_DEFINED__ +#define __IEnumNetCfgComponent_FWD_DEFINED__ +typedef interface IEnumNetCfgComponent IEnumNetCfgComponent; +#endif /* __IEnumNetCfgComponent_FWD_DEFINED__ */ + + +#ifndef __INetCfg_FWD_DEFINED__ +#define __INetCfg_FWD_DEFINED__ +typedef interface INetCfg INetCfg; +#endif /* __INetCfg_FWD_DEFINED__ */ + + +#ifndef __INetCfgLock_FWD_DEFINED__ +#define __INetCfgLock_FWD_DEFINED__ +typedef interface INetCfgLock INetCfgLock; +#endif /* __INetCfgLock_FWD_DEFINED__ */ + + +#ifndef __INetCfgBindingInterface_FWD_DEFINED__ +#define __INetCfgBindingInterface_FWD_DEFINED__ +typedef interface INetCfgBindingInterface INetCfgBindingInterface; +#endif /* __INetCfgBindingInterface_FWD_DEFINED__ */ + + +#ifndef __INetCfgBindingPath_FWD_DEFINED__ +#define __INetCfgBindingPath_FWD_DEFINED__ +typedef interface INetCfgBindingPath INetCfgBindingPath; +#endif /* __INetCfgBindingPath_FWD_DEFINED__ */ + + +#ifndef __INetCfgClass_FWD_DEFINED__ +#define __INetCfgClass_FWD_DEFINED__ +typedef interface INetCfgClass INetCfgClass; +#endif /* __INetCfgClass_FWD_DEFINED__ */ + + +#ifndef __INetCfgClassSetup_FWD_DEFINED__ +#define __INetCfgClassSetup_FWD_DEFINED__ +typedef interface INetCfgClassSetup INetCfgClassSetup; +#endif /* __INetCfgClassSetup_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponent_FWD_DEFINED__ +#define __INetCfgComponent_FWD_DEFINED__ +typedef interface INetCfgComponent INetCfgComponent; +#endif /* __INetCfgComponent_FWD_DEFINED__ */ + + +#ifndef __INetCfgComponentBindings_FWD_DEFINED__ +#define __INetCfgComponentBindings_FWD_DEFINED__ +typedef interface INetCfgComponentBindings INetCfgComponentBindings; +#endif /* __INetCfgComponentBindings_FWD_DEFINED__ */ + + +#ifndef __INetCfgSysPrep_FWD_DEFINED__ +#define __INetCfgSysPrep_FWD_DEFINED__ +typedef interface INetCfgSysPrep INetCfgSysPrep; +#endif /* __INetCfgSysPrep_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "unknwn.h" +#include "prsht.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +/* interface __MIDL_itf_netcfgx_0000 */ +/* [local] */ + +//+------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//-------------------------------------------------------------------------- +#if ( _MSC_VER >= 800 ) +#pragma warning(disable:4201) +#endif + +EXTERN_C const CLSID CLSID_CNetCfg; + +#define NETCFG_E_ALREADY_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA020) +#define NETCFG_E_NOT_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA021) +#define NETCFG_E_IN_USE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA022) +#define NETCFG_E_NO_WRITE_LOCK MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA024) +#define NETCFG_E_NEED_REBOOT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA025) +#define NETCFG_E_ACTIVE_RAS_CONNECTIONS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA026) +#define NETCFG_E_ADAPTER_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA027) +#define NETCFG_E_COMPONENT_REMOVED_PENDING_REBOOT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA028) +#define NETCFG_S_REBOOT MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA020) +#define NETCFG_S_DISABLE_QUERY MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA022) +#define NETCFG_S_STILL_REFERENCED MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA023) +#define NETCFG_S_CAUSED_SETUP_CHANGE MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA024) +#define NETCFG_S_COMMIT_NOW MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA025) + +#define NETCFG_CLIENT_CID_MS_MSClient TEXT("ms_msclient") +#define NETCFG_SERVICE_CID_MS_SERVER TEXT("ms_server") +#define NETCFG_SERVICE_CID_MS_NETBIOS TEXT("ms_netbios") +#define NETCFG_SERVICE_CID_MS_PSCHED TEXT("ms_pschedpc") +#define NETCFG_SERVICE_CID_MS_WLBS TEXT("ms_wlbs") +#define NETCFG_TRANS_CID_MS_APPLETALK TEXT("ms_appletalk") +#define NETCFG_TRANS_CID_MS_NETBEUI TEXT("ms_netbeui") +#define NETCFG_TRANS_CID_MS_NETMON TEXT("ms_netmon") +#define NETCFG_TRANS_CID_MS_NWIPX TEXT("ms_nwipx") +#define NETCFG_TRANS_CID_MS_NWSPX TEXT("ms_nwspx") +#define NETCFG_TRANS_CID_MS_TCPIP TEXT("ms_tcpip") + + + + + + + + + + + + + + + + +extern RPC_IF_HANDLE __MIDL_itf_netcfgx_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_netcfgx_0000_v0_0_s_ifspec; + +#ifndef __IEnumNetCfgBindingInterface_INTERFACE_DEFINED__ +#define __IEnumNetCfgBindingInterface_INTERFACE_DEFINED__ + +/* interface IEnumNetCfgBindingInterface */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_IEnumNetCfgBindingInterface; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE90-306E-11D1-AACF-00805FC1270E") + IEnumNetCfgBindingInterface : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingInterface **rgelt, + /* [out] */ ULONG *pceltFetched) = 0; + + virtual HRESULT STDMETHODCALLTYPE Skip( + /* [in] */ ULONG celt) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Clone( + /* [out] */ IEnumNetCfgBindingInterface **ppenum) = 0; + + }; + +#else /* C style interface */ + + typedef struct IEnumNetCfgBindingInterfaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEnumNetCfgBindingInterface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEnumNetCfgBindingInterface * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEnumNetCfgBindingInterface * This); + + HRESULT ( STDMETHODCALLTYPE *Next )( + IEnumNetCfgBindingInterface * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingInterface **rgelt, + /* [out] */ ULONG *pceltFetched); + + HRESULT ( STDMETHODCALLTYPE *Skip )( + IEnumNetCfgBindingInterface * This, + /* [in] */ ULONG celt); + + HRESULT ( STDMETHODCALLTYPE *Reset )( + IEnumNetCfgBindingInterface * This); + + HRESULT ( STDMETHODCALLTYPE *Clone )( + IEnumNetCfgBindingInterface * This, + /* [out] */ IEnumNetCfgBindingInterface **ppenum); + + END_INTERFACE + } IEnumNetCfgBindingInterfaceVtbl; + + interface IEnumNetCfgBindingInterface + { + CONST_VTBL struct IEnumNetCfgBindingInterfaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEnumNetCfgBindingInterface_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IEnumNetCfgBindingInterface_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IEnumNetCfgBindingInterface_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IEnumNetCfgBindingInterface_Next(This,celt,rgelt,pceltFetched) \ + (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) + +#define IEnumNetCfgBindingInterface_Skip(This,celt) \ + (This)->lpVtbl -> Skip(This,celt) + +#define IEnumNetCfgBindingInterface_Reset(This) \ + (This)->lpVtbl -> Reset(This) + +#define IEnumNetCfgBindingInterface_Clone(This,ppenum) \ + (This)->lpVtbl -> Clone(This,ppenum) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingInterface_Next_Proxy( + IEnumNetCfgBindingInterface * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingInterface **rgelt, + /* [out] */ ULONG *pceltFetched); + + +void __RPC_STUB IEnumNetCfgBindingInterface_Next_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingInterface_Skip_Proxy( + IEnumNetCfgBindingInterface * This, + /* [in] */ ULONG celt); + + +void __RPC_STUB IEnumNetCfgBindingInterface_Skip_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingInterface_Reset_Proxy( + IEnumNetCfgBindingInterface * This); + + +void __RPC_STUB IEnumNetCfgBindingInterface_Reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingInterface_Clone_Proxy( + IEnumNetCfgBindingInterface * This, + /* [out] */ IEnumNetCfgBindingInterface **ppenum); + + +void __RPC_STUB IEnumNetCfgBindingInterface_Clone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IEnumNetCfgBindingInterface_INTERFACE_DEFINED__ */ + + +#ifndef __IEnumNetCfgBindingPath_INTERFACE_DEFINED__ +#define __IEnumNetCfgBindingPath_INTERFACE_DEFINED__ + +/* interface IEnumNetCfgBindingPath */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_IEnumNetCfgBindingPath; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE91-306E-11D1-AACF-00805FC1270E") + IEnumNetCfgBindingPath : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingPath **rgelt, + /* [out] */ ULONG *pceltFetched) = 0; + + virtual HRESULT STDMETHODCALLTYPE Skip( + /* [in] */ ULONG celt) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Clone( + /* [out] */ IEnumNetCfgBindingPath **ppenum) = 0; + + }; + +#else /* C style interface */ + + typedef struct IEnumNetCfgBindingPathVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEnumNetCfgBindingPath * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEnumNetCfgBindingPath * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEnumNetCfgBindingPath * This); + + HRESULT ( STDMETHODCALLTYPE *Next )( + IEnumNetCfgBindingPath * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingPath **rgelt, + /* [out] */ ULONG *pceltFetched); + + HRESULT ( STDMETHODCALLTYPE *Skip )( + IEnumNetCfgBindingPath * This, + /* [in] */ ULONG celt); + + HRESULT ( STDMETHODCALLTYPE *Reset )( + IEnumNetCfgBindingPath * This); + + HRESULT ( STDMETHODCALLTYPE *Clone )( + IEnumNetCfgBindingPath * This, + /* [out] */ IEnumNetCfgBindingPath **ppenum); + + END_INTERFACE + } IEnumNetCfgBindingPathVtbl; + + interface IEnumNetCfgBindingPath + { + CONST_VTBL struct IEnumNetCfgBindingPathVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEnumNetCfgBindingPath_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IEnumNetCfgBindingPath_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IEnumNetCfgBindingPath_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IEnumNetCfgBindingPath_Next(This,celt,rgelt,pceltFetched) \ + (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) + +#define IEnumNetCfgBindingPath_Skip(This,celt) \ + (This)->lpVtbl -> Skip(This,celt) + +#define IEnumNetCfgBindingPath_Reset(This) \ + (This)->lpVtbl -> Reset(This) + +#define IEnumNetCfgBindingPath_Clone(This,ppenum) \ + (This)->lpVtbl -> Clone(This,ppenum) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingPath_Next_Proxy( + IEnumNetCfgBindingPath * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgBindingPath **rgelt, + /* [out] */ ULONG *pceltFetched); + + +void __RPC_STUB IEnumNetCfgBindingPath_Next_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingPath_Skip_Proxy( + IEnumNetCfgBindingPath * This, + /* [in] */ ULONG celt); + + +void __RPC_STUB IEnumNetCfgBindingPath_Skip_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingPath_Reset_Proxy( + IEnumNetCfgBindingPath * This); + + +void __RPC_STUB IEnumNetCfgBindingPath_Reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgBindingPath_Clone_Proxy( + IEnumNetCfgBindingPath * This, + /* [out] */ IEnumNetCfgBindingPath **ppenum); + + +void __RPC_STUB IEnumNetCfgBindingPath_Clone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IEnumNetCfgBindingPath_INTERFACE_DEFINED__ */ + + +#ifndef __IEnumNetCfgComponent_INTERFACE_DEFINED__ +#define __IEnumNetCfgComponent_INTERFACE_DEFINED__ + +/* interface IEnumNetCfgComponent */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_IEnumNetCfgComponent; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE92-306E-11D1-AACF-00805FC1270E") + IEnumNetCfgComponent : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgComponent **rgelt, + /* [out] */ ULONG *pceltFetched) = 0; + + virtual HRESULT STDMETHODCALLTYPE Skip( + /* [in] */ ULONG celt) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Clone( + /* [out] */ IEnumNetCfgComponent **ppenum) = 0; + + }; + +#else /* C style interface */ + + typedef struct IEnumNetCfgComponentVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEnumNetCfgComponent * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEnumNetCfgComponent * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEnumNetCfgComponent * This); + + HRESULT ( STDMETHODCALLTYPE *Next )( + IEnumNetCfgComponent * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgComponent **rgelt, + /* [out] */ ULONG *pceltFetched); + + HRESULT ( STDMETHODCALLTYPE *Skip )( + IEnumNetCfgComponent * This, + /* [in] */ ULONG celt); + + HRESULT ( STDMETHODCALLTYPE *Reset )( + IEnumNetCfgComponent * This); + + HRESULT ( STDMETHODCALLTYPE *Clone )( + IEnumNetCfgComponent * This, + /* [out] */ IEnumNetCfgComponent **ppenum); + + END_INTERFACE + } IEnumNetCfgComponentVtbl; + + interface IEnumNetCfgComponent + { + CONST_VTBL struct IEnumNetCfgComponentVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEnumNetCfgComponent_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IEnumNetCfgComponent_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IEnumNetCfgComponent_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IEnumNetCfgComponent_Next(This,celt,rgelt,pceltFetched) \ + (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) + +#define IEnumNetCfgComponent_Skip(This,celt) \ + (This)->lpVtbl -> Skip(This,celt) + +#define IEnumNetCfgComponent_Reset(This) \ + (This)->lpVtbl -> Reset(This) + +#define IEnumNetCfgComponent_Clone(This,ppenum) \ + (This)->lpVtbl -> Clone(This,ppenum) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgComponent_Next_Proxy( + IEnumNetCfgComponent * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ INetCfgComponent **rgelt, + /* [out] */ ULONG *pceltFetched); + + +void __RPC_STUB IEnumNetCfgComponent_Next_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgComponent_Skip_Proxy( + IEnumNetCfgComponent * This, + /* [in] */ ULONG celt); + + +void __RPC_STUB IEnumNetCfgComponent_Skip_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgComponent_Reset_Proxy( + IEnumNetCfgComponent * This); + + +void __RPC_STUB IEnumNetCfgComponent_Reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumNetCfgComponent_Clone_Proxy( + IEnumNetCfgComponent * This, + /* [out] */ IEnumNetCfgComponent **ppenum); + + +void __RPC_STUB IEnumNetCfgComponent_Clone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IEnumNetCfgComponent_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfg_INTERFACE_DEFINED__ +#define __INetCfg_INTERFACE_DEFINED__ + +/* interface INetCfg */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfg; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE93-306E-11D1-AACF-00805FC1270E") + INetCfg : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Initialize( + /* [in] */ PVOID pvReserved) = 0; + + virtual HRESULT STDMETHODCALLTYPE Uninitialize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Apply( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Cancel( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumComponents( + /* [in] */ const GUID *pguidClass, + /* [out] */ IEnumNetCfgComponent **ppenumComponent) = 0; + + virtual HRESULT STDMETHODCALLTYPE FindComponent( + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **pComponent) = 0; + + virtual HRESULT STDMETHODCALLTYPE QueryNetCfgClass( + /* [in] */ const GUID *pguidClass, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfg * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfg * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfg * This); + + HRESULT ( STDMETHODCALLTYPE *Initialize )( + INetCfg * This, + /* [in] */ PVOID pvReserved); + + HRESULT ( STDMETHODCALLTYPE *Uninitialize )( + INetCfg * This); + + HRESULT ( STDMETHODCALLTYPE *Apply )( + INetCfg * This); + + HRESULT ( STDMETHODCALLTYPE *Cancel )( + INetCfg * This); + + HRESULT ( STDMETHODCALLTYPE *EnumComponents )( + INetCfg * This, + /* [in] */ const GUID *pguidClass, + /* [out] */ IEnumNetCfgComponent **ppenumComponent); + + HRESULT ( STDMETHODCALLTYPE *FindComponent )( + INetCfg * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **pComponent); + + HRESULT ( STDMETHODCALLTYPE *QueryNetCfgClass )( + INetCfg * This, + /* [in] */ const GUID *pguidClass, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + END_INTERFACE + } INetCfgVtbl; + + interface INetCfg + { + CONST_VTBL struct INetCfgVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfg_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfg_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfg_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfg_Initialize(This,pvReserved) \ + (This)->lpVtbl -> Initialize(This,pvReserved) + +#define INetCfg_Uninitialize(This) \ + (This)->lpVtbl -> Uninitialize(This) + +#define INetCfg_Apply(This) \ + (This)->lpVtbl -> Apply(This) + +#define INetCfg_Cancel(This) \ + (This)->lpVtbl -> Cancel(This) + +#define INetCfg_EnumComponents(This,pguidClass,ppenumComponent) \ + (This)->lpVtbl -> EnumComponents(This,pguidClass,ppenumComponent) + +#define INetCfg_FindComponent(This,pszwInfId,pComponent) \ + (This)->lpVtbl -> FindComponent(This,pszwInfId,pComponent) + +#define INetCfg_QueryNetCfgClass(This,pguidClass,riid,ppvObject) \ + (This)->lpVtbl -> QueryNetCfgClass(This,pguidClass,riid,ppvObject) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfg_Initialize_Proxy( + INetCfg * This, + /* [in] */ PVOID pvReserved); + + +void __RPC_STUB INetCfg_Initialize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_Uninitialize_Proxy( + INetCfg * This); + + +void __RPC_STUB INetCfg_Uninitialize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_Apply_Proxy( + INetCfg * This); + + +void __RPC_STUB INetCfg_Apply_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_Cancel_Proxy( + INetCfg * This); + + +void __RPC_STUB INetCfg_Cancel_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_EnumComponents_Proxy( + INetCfg * This, + /* [in] */ const GUID *pguidClass, + /* [out] */ IEnumNetCfgComponent **ppenumComponent); + + +void __RPC_STUB INetCfg_EnumComponents_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_FindComponent_Proxy( + INetCfg * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **pComponent); + + +void __RPC_STUB INetCfg_FindComponent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfg_QueryNetCfgClass_Proxy( + INetCfg * This, + /* [in] */ const GUID *pguidClass, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + +void __RPC_STUB INetCfg_QueryNetCfgClass_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfg_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgLock_INTERFACE_DEFINED__ +#define __INetCfgLock_INTERFACE_DEFINED__ + +/* interface INetCfgLock */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgLock; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE9F-306E-11D1-AACF-00805FC1270E") + INetCfgLock : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE AcquireWriteLock( + /* [in] */ DWORD cmsTimeout, + /* [string][in] */ LPCWSTR pszwClientDescription, + /* [string][out] */ LPWSTR *ppszwClientDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReleaseWriteLock( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsWriteLocked( + /* [string][out] */ LPWSTR *ppszwClientDescription) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgLockVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgLock * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgLock * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgLock * This); + + HRESULT ( STDMETHODCALLTYPE *AcquireWriteLock )( + INetCfgLock * This, + /* [in] */ DWORD cmsTimeout, + /* [string][in] */ LPCWSTR pszwClientDescription, + /* [string][out] */ LPWSTR *ppszwClientDescription); + + HRESULT ( STDMETHODCALLTYPE *ReleaseWriteLock )( + INetCfgLock * This); + + HRESULT ( STDMETHODCALLTYPE *IsWriteLocked )( + INetCfgLock * This, + /* [string][out] */ LPWSTR *ppszwClientDescription); + + END_INTERFACE + } INetCfgLockVtbl; + + interface INetCfgLock + { + CONST_VTBL struct INetCfgLockVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgLock_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgLock_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgLock_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgLock_AcquireWriteLock(This,cmsTimeout,pszwClientDescription,ppszwClientDescription) \ + (This)->lpVtbl -> AcquireWriteLock(This,cmsTimeout,pszwClientDescription,ppszwClientDescription) + +#define INetCfgLock_ReleaseWriteLock(This) \ + (This)->lpVtbl -> ReleaseWriteLock(This) + +#define INetCfgLock_IsWriteLocked(This,ppszwClientDescription) \ + (This)->lpVtbl -> IsWriteLocked(This,ppszwClientDescription) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgLock_AcquireWriteLock_Proxy( + INetCfgLock * This, + /* [in] */ DWORD cmsTimeout, + /* [string][in] */ LPCWSTR pszwClientDescription, + /* [string][out] */ LPWSTR *ppszwClientDescription); + + +void __RPC_STUB INetCfgLock_AcquireWriteLock_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgLock_ReleaseWriteLock_Proxy( + INetCfgLock * This); + + +void __RPC_STUB INetCfgLock_ReleaseWriteLock_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgLock_IsWriteLocked_Proxy( + INetCfgLock * This, + /* [string][out] */ LPWSTR *ppszwClientDescription); + + +void __RPC_STUB INetCfgLock_IsWriteLocked_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgLock_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgBindingInterface_INTERFACE_DEFINED__ +#define __INetCfgBindingInterface_INTERFACE_DEFINED__ + +/* interface INetCfgBindingInterface */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgBindingInterface; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE94-306E-11D1-AACF-00805FC1270E") + INetCfgBindingInterface : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetName( + /* [string][out] */ LPWSTR *ppszwInterfaceName) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetUpperComponent( + /* [out] */ INetCfgComponent **ppnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetLowerComponent( + /* [out] */ INetCfgComponent **ppnccItem) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgBindingInterfaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgBindingInterface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgBindingInterface * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgBindingInterface * This); + + HRESULT ( STDMETHODCALLTYPE *GetName )( + INetCfgBindingInterface * This, + /* [string][out] */ LPWSTR *ppszwInterfaceName); + + HRESULT ( STDMETHODCALLTYPE *GetUpperComponent )( + INetCfgBindingInterface * This, + /* [out] */ INetCfgComponent **ppnccItem); + + HRESULT ( STDMETHODCALLTYPE *GetLowerComponent )( + INetCfgBindingInterface * This, + /* [out] */ INetCfgComponent **ppnccItem); + + END_INTERFACE + } INetCfgBindingInterfaceVtbl; + + interface INetCfgBindingInterface + { + CONST_VTBL struct INetCfgBindingInterfaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgBindingInterface_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgBindingInterface_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgBindingInterface_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgBindingInterface_GetName(This,ppszwInterfaceName) \ + (This)->lpVtbl -> GetName(This,ppszwInterfaceName) + +#define INetCfgBindingInterface_GetUpperComponent(This,ppnccItem) \ + (This)->lpVtbl -> GetUpperComponent(This,ppnccItem) + +#define INetCfgBindingInterface_GetLowerComponent(This,ppnccItem) \ + (This)->lpVtbl -> GetLowerComponent(This,ppnccItem) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgBindingInterface_GetName_Proxy( + INetCfgBindingInterface * This, + /* [string][out] */ LPWSTR *ppszwInterfaceName); + + +void __RPC_STUB INetCfgBindingInterface_GetName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingInterface_GetUpperComponent_Proxy( + INetCfgBindingInterface * This, + /* [out] */ INetCfgComponent **ppnccItem); + + +void __RPC_STUB INetCfgBindingInterface_GetUpperComponent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingInterface_GetLowerComponent_Proxy( + INetCfgBindingInterface * This, + /* [out] */ INetCfgComponent **ppnccItem); + + +void __RPC_STUB INetCfgBindingInterface_GetLowerComponent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgBindingInterface_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgBindingPath_INTERFACE_DEFINED__ +#define __INetCfgBindingPath_INTERFACE_DEFINED__ + +/* interface INetCfgBindingPath */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgBindingPath; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE96-306E-11D1-AACF-00805FC1270E") + INetCfgBindingPath : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE IsSamePathAs( + /* [in] */ INetCfgBindingPath *pPath) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsSubPathOf( + /* [in] */ INetCfgBindingPath *pPath) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsEnabled( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Enable( + /* [in] */ BOOL fEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPathToken( + /* [string][out] */ LPWSTR *ppszwPathToken) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetOwner( + /* [out] */ INetCfgComponent **ppComponent) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDepth( + /* [out] */ ULONG *pcInterfaces) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumBindingInterfaces( + /* [out] */ IEnumNetCfgBindingInterface **ppenumInterface) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgBindingPathVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgBindingPath * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgBindingPath * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgBindingPath * This); + + HRESULT ( STDMETHODCALLTYPE *IsSamePathAs )( + INetCfgBindingPath * This, + /* [in] */ INetCfgBindingPath *pPath); + + HRESULT ( STDMETHODCALLTYPE *IsSubPathOf )( + INetCfgBindingPath * This, + /* [in] */ INetCfgBindingPath *pPath); + + HRESULT ( STDMETHODCALLTYPE *IsEnabled )( + INetCfgBindingPath * This); + + HRESULT ( STDMETHODCALLTYPE *Enable )( + INetCfgBindingPath * This, + /* [in] */ BOOL fEnable); + + HRESULT ( STDMETHODCALLTYPE *GetPathToken )( + INetCfgBindingPath * This, + /* [string][out] */ LPWSTR *ppszwPathToken); + + HRESULT ( STDMETHODCALLTYPE *GetOwner )( + INetCfgBindingPath * This, + /* [out] */ INetCfgComponent **ppComponent); + + HRESULT ( STDMETHODCALLTYPE *GetDepth )( + INetCfgBindingPath * This, + /* [out] */ ULONG *pcInterfaces); + + HRESULT ( STDMETHODCALLTYPE *EnumBindingInterfaces )( + INetCfgBindingPath * This, + /* [out] */ IEnumNetCfgBindingInterface **ppenumInterface); + + END_INTERFACE + } INetCfgBindingPathVtbl; + + interface INetCfgBindingPath + { + CONST_VTBL struct INetCfgBindingPathVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgBindingPath_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgBindingPath_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgBindingPath_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgBindingPath_IsSamePathAs(This,pPath) \ + (This)->lpVtbl -> IsSamePathAs(This,pPath) + +#define INetCfgBindingPath_IsSubPathOf(This,pPath) \ + (This)->lpVtbl -> IsSubPathOf(This,pPath) + +#define INetCfgBindingPath_IsEnabled(This) \ + (This)->lpVtbl -> IsEnabled(This) + +#define INetCfgBindingPath_Enable(This,fEnable) \ + (This)->lpVtbl -> Enable(This,fEnable) + +#define INetCfgBindingPath_GetPathToken(This,ppszwPathToken) \ + (This)->lpVtbl -> GetPathToken(This,ppszwPathToken) + +#define INetCfgBindingPath_GetOwner(This,ppComponent) \ + (This)->lpVtbl -> GetOwner(This,ppComponent) + +#define INetCfgBindingPath_GetDepth(This,pcInterfaces) \ + (This)->lpVtbl -> GetDepth(This,pcInterfaces) + +#define INetCfgBindingPath_EnumBindingInterfaces(This,ppenumInterface) \ + (This)->lpVtbl -> EnumBindingInterfaces(This,ppenumInterface) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_IsSamePathAs_Proxy( + INetCfgBindingPath * This, + /* [in] */ INetCfgBindingPath *pPath); + + +void __RPC_STUB INetCfgBindingPath_IsSamePathAs_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_IsSubPathOf_Proxy( + INetCfgBindingPath * This, + /* [in] */ INetCfgBindingPath *pPath); + + +void __RPC_STUB INetCfgBindingPath_IsSubPathOf_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_IsEnabled_Proxy( + INetCfgBindingPath * This); + + +void __RPC_STUB INetCfgBindingPath_IsEnabled_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_Enable_Proxy( + INetCfgBindingPath * This, + /* [in] */ BOOL fEnable); + + +void __RPC_STUB INetCfgBindingPath_Enable_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_GetPathToken_Proxy( + INetCfgBindingPath * This, + /* [string][out] */ LPWSTR *ppszwPathToken); + + +void __RPC_STUB INetCfgBindingPath_GetPathToken_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_GetOwner_Proxy( + INetCfgBindingPath * This, + /* [out] */ INetCfgComponent **ppComponent); + + +void __RPC_STUB INetCfgBindingPath_GetOwner_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_GetDepth_Proxy( + INetCfgBindingPath * This, + /* [out] */ ULONG *pcInterfaces); + + +void __RPC_STUB INetCfgBindingPath_GetDepth_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgBindingPath_EnumBindingInterfaces_Proxy( + INetCfgBindingPath * This, + /* [out] */ IEnumNetCfgBindingInterface **ppenumInterface); + + +void __RPC_STUB INetCfgBindingPath_EnumBindingInterfaces_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgBindingPath_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgClass_INTERFACE_DEFINED__ +#define __INetCfgClass_INTERFACE_DEFINED__ + +/* interface INetCfgClass */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgClass; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE97-306E-11D1-AACF-00805FC1270E") + INetCfgClass : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE FindComponent( + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **ppnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumComponents( + /* [out] */ IEnumNetCfgComponent **ppenumComponent) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgClassVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgClass * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgClass * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgClass * This); + + HRESULT ( STDMETHODCALLTYPE *FindComponent )( + INetCfgClass * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **ppnccItem); + + HRESULT ( STDMETHODCALLTYPE *EnumComponents )( + INetCfgClass * This, + /* [out] */ IEnumNetCfgComponent **ppenumComponent); + + END_INTERFACE + } INetCfgClassVtbl; + + interface INetCfgClass + { + CONST_VTBL struct INetCfgClassVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgClass_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgClass_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgClass_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgClass_FindComponent(This,pszwInfId,ppnccItem) \ + (This)->lpVtbl -> FindComponent(This,pszwInfId,ppnccItem) + +#define INetCfgClass_EnumComponents(This,ppenumComponent) \ + (This)->lpVtbl -> EnumComponents(This,ppenumComponent) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgClass_FindComponent_Proxy( + INetCfgClass * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [out] */ INetCfgComponent **ppnccItem); + + +void __RPC_STUB INetCfgClass_FindComponent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgClass_EnumComponents_Proxy( + INetCfgClass * This, + /* [out] */ IEnumNetCfgComponent **ppenumComponent); + + +void __RPC_STUB INetCfgClass_EnumComponents_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgClass_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgClassSetup_INTERFACE_DEFINED__ +#define __INetCfgClassSetup_INTERFACE_DEFINED__ + +/* interface INetCfgClassSetup */ +/* [unique][uuid][object][local] */ + +typedef +enum tagOBO_TOKEN_TYPE + { OBO_USER = 1, + OBO_COMPONENT = 2, + OBO_SOFTWARE = 3 + } OBO_TOKEN_TYPE; + +typedef struct tagOBO_TOKEN + { + OBO_TOKEN_TYPE Type; + INetCfgComponent *pncc; + LPCWSTR pszwManufacturer; + LPCWSTR pszwProduct; + LPCWSTR pszwDisplayName; + BOOL fRegistered; + } OBO_TOKEN; + + +EXTERN_C const IID IID_INetCfgClassSetup; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE9D-306E-11D1-AACF-00805FC1270E") + INetCfgClassSetup : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SelectAndInstall( + /* [in] */ HWND hwndParent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ INetCfgComponent **ppnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE Install( + /* [string][in] */ LPCWSTR pszwInfId, + /* [in] */ OBO_TOKEN *pOboToken, + /* [in] */ DWORD dwSetupFlags, + /* [in] */ DWORD dwUpgradeFromBuildNo, + /* [string][in] */ LPCWSTR pszwAnswerFile, + /* [string][in] */ LPCWSTR pszwAnswerSections, + /* [out] */ INetCfgComponent **ppnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE DeInstall( + /* [in] */ INetCfgComponent *pComponent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ LPWSTR *pmszwRefs) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgClassSetupVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgClassSetup * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgClassSetup * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgClassSetup * This); + + HRESULT ( STDMETHODCALLTYPE *SelectAndInstall )( + INetCfgClassSetup * This, + /* [in] */ HWND hwndParent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ INetCfgComponent **ppnccItem); + + HRESULT ( STDMETHODCALLTYPE *Install )( + INetCfgClassSetup * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [in] */ OBO_TOKEN *pOboToken, + /* [in] */ DWORD dwSetupFlags, + /* [in] */ DWORD dwUpgradeFromBuildNo, + /* [string][in] */ LPCWSTR pszwAnswerFile, + /* [string][in] */ LPCWSTR pszwAnswerSections, + /* [out] */ INetCfgComponent **ppnccItem); + + HRESULT ( STDMETHODCALLTYPE *DeInstall )( + INetCfgClassSetup * This, + /* [in] */ INetCfgComponent *pComponent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ LPWSTR *pmszwRefs); + + END_INTERFACE + } INetCfgClassSetupVtbl; + + interface INetCfgClassSetup + { + CONST_VTBL struct INetCfgClassSetupVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgClassSetup_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgClassSetup_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgClassSetup_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgClassSetup_SelectAndInstall(This,hwndParent,pOboToken,ppnccItem) \ + (This)->lpVtbl -> SelectAndInstall(This,hwndParent,pOboToken,ppnccItem) + +#define INetCfgClassSetup_Install(This,pszwInfId,pOboToken,dwSetupFlags,dwUpgradeFromBuildNo,pszwAnswerFile,pszwAnswerSections,ppnccItem) \ + (This)->lpVtbl -> Install(This,pszwInfId,pOboToken,dwSetupFlags,dwUpgradeFromBuildNo,pszwAnswerFile,pszwAnswerSections,ppnccItem) + +#define INetCfgClassSetup_DeInstall(This,pComponent,pOboToken,pmszwRefs) \ + (This)->lpVtbl -> DeInstall(This,pComponent,pOboToken,pmszwRefs) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgClassSetup_SelectAndInstall_Proxy( + INetCfgClassSetup * This, + /* [in] */ HWND hwndParent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ INetCfgComponent **ppnccItem); + + +void __RPC_STUB INetCfgClassSetup_SelectAndInstall_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgClassSetup_Install_Proxy( + INetCfgClassSetup * This, + /* [string][in] */ LPCWSTR pszwInfId, + /* [in] */ OBO_TOKEN *pOboToken, + /* [in] */ DWORD dwSetupFlags, + /* [in] */ DWORD dwUpgradeFromBuildNo, + /* [string][in] */ LPCWSTR pszwAnswerFile, + /* [string][in] */ LPCWSTR pszwAnswerSections, + /* [out] */ INetCfgComponent **ppnccItem); + + +void __RPC_STUB INetCfgClassSetup_Install_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgClassSetup_DeInstall_Proxy( + INetCfgClassSetup * This, + /* [in] */ INetCfgComponent *pComponent, + /* [in] */ OBO_TOKEN *pOboToken, + /* [out] */ LPWSTR *pmszwRefs); + + +void __RPC_STUB INetCfgClassSetup_DeInstall_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgClassSetup_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponent_INTERFACE_DEFINED__ +#define __INetCfgComponent_INTERFACE_DEFINED__ + +/* interface INetCfgComponent */ +/* [unique][uuid][object][local] */ + +typedef +enum tagCOMPONENT_CHARACTERISTICS + { NCF_VIRTUAL = 0x1, + NCF_SOFTWARE_ENUMERATED = 0x2, + NCF_PHYSICAL = 0x4, + NCF_HIDDEN = 0x8, + NCF_NO_SERVICE = 0x10, + NCF_NOT_USER_REMOVABLE = 0x20, + NCF_MULTIPORT_INSTANCED_ADAPTER = 0x40, + NCF_HAS_UI = 0x80, + NCF_SINGLE_INSTANCE = 0x100, + NCF_FILTER = 0x400, + NCF_DONTEXPOSELOWER = 0x1000, + NCF_HIDE_BINDING = 0x2000, + NCF_NDIS_PROTOCOL = 0x4000, + NCF_FIXED_BINDING = 0x20000 + } COMPONENT_CHARACTERISTICS; + +typedef +enum tagNCRP_FLAGS + { NCRP_QUERY_PROPERTY_UI = 0x1, + NCRP_SHOW_PROPERTY_UI = 0x2 + } NCRP_FLAGS; + + +EXTERN_C const IID IID_INetCfgComponent; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE99-306E-11D1-AACF-00805FC1270E") + INetCfgComponent : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDisplayName( + /* [string][out] */ LPWSTR *ppszwDisplayName) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDisplayName( + /* [string][in] */ LPCWSTR pszwDisplayName) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetHelpText( + /* [string][out] */ LPWSTR *pszwHelpText) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetId( + /* [string][out] */ LPWSTR *ppszwId) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCharacteristics( + /* [out] */ LPDWORD pdwCharacteristics) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetInstanceGuid( + /* [out] */ GUID *pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPnpDevNodeId( + /* [string][out] */ LPWSTR *ppszwDevNodeId) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetClassGuid( + /* [out] */ GUID *pGuid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetBindName( + /* [string][out] */ LPWSTR *ppszwBindName) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDeviceStatus( + /* [out] */ ULONG *pulStatus) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenParamKey( + /* [out] */ HKEY *phkey) = 0; + + virtual HRESULT STDMETHODCALLTYPE RaisePropertyUi( + /* [in] */ HWND hwndParent, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkContext) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponent * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponent * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponent * This); + + HRESULT ( STDMETHODCALLTYPE *GetDisplayName )( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwDisplayName); + + HRESULT ( STDMETHODCALLTYPE *SetDisplayName )( + INetCfgComponent * This, + /* [string][in] */ LPCWSTR pszwDisplayName); + + HRESULT ( STDMETHODCALLTYPE *GetHelpText )( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *pszwHelpText); + + HRESULT ( STDMETHODCALLTYPE *GetId )( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwId); + + HRESULT ( STDMETHODCALLTYPE *GetCharacteristics )( + INetCfgComponent * This, + /* [out] */ LPDWORD pdwCharacteristics); + + HRESULT ( STDMETHODCALLTYPE *GetInstanceGuid )( + INetCfgComponent * This, + /* [out] */ GUID *pGuid); + + HRESULT ( STDMETHODCALLTYPE *GetPnpDevNodeId )( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwDevNodeId); + + HRESULT ( STDMETHODCALLTYPE *GetClassGuid )( + INetCfgComponent * This, + /* [out] */ GUID *pGuid); + + HRESULT ( STDMETHODCALLTYPE *GetBindName )( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwBindName); + + HRESULT ( STDMETHODCALLTYPE *GetDeviceStatus )( + INetCfgComponent * This, + /* [out] */ ULONG *pulStatus); + + HRESULT ( STDMETHODCALLTYPE *OpenParamKey )( + INetCfgComponent * This, + /* [out] */ HKEY *phkey); + + HRESULT ( STDMETHODCALLTYPE *RaisePropertyUi )( + INetCfgComponent * This, + /* [in] */ HWND hwndParent, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkContext); + + END_INTERFACE + } INetCfgComponentVtbl; + + interface INetCfgComponent + { + CONST_VTBL struct INetCfgComponentVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponent_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponent_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponent_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponent_GetDisplayName(This,ppszwDisplayName) \ + (This)->lpVtbl -> GetDisplayName(This,ppszwDisplayName) + +#define INetCfgComponent_SetDisplayName(This,pszwDisplayName) \ + (This)->lpVtbl -> SetDisplayName(This,pszwDisplayName) + +#define INetCfgComponent_GetHelpText(This,pszwHelpText) \ + (This)->lpVtbl -> GetHelpText(This,pszwHelpText) + +#define INetCfgComponent_GetId(This,ppszwId) \ + (This)->lpVtbl -> GetId(This,ppszwId) + +#define INetCfgComponent_GetCharacteristics(This,pdwCharacteristics) \ + (This)->lpVtbl -> GetCharacteristics(This,pdwCharacteristics) + +#define INetCfgComponent_GetInstanceGuid(This,pGuid) \ + (This)->lpVtbl -> GetInstanceGuid(This,pGuid) + +#define INetCfgComponent_GetPnpDevNodeId(This,ppszwDevNodeId) \ + (This)->lpVtbl -> GetPnpDevNodeId(This,ppszwDevNodeId) + +#define INetCfgComponent_GetClassGuid(This,pGuid) \ + (This)->lpVtbl -> GetClassGuid(This,pGuid) + +#define INetCfgComponent_GetBindName(This,ppszwBindName) \ + (This)->lpVtbl -> GetBindName(This,ppszwBindName) + +#define INetCfgComponent_GetDeviceStatus(This,pulStatus) \ + (This)->lpVtbl -> GetDeviceStatus(This,pulStatus) + +#define INetCfgComponent_OpenParamKey(This,phkey) \ + (This)->lpVtbl -> OpenParamKey(This,phkey) + +#define INetCfgComponent_RaisePropertyUi(This,hwndParent,dwFlags,punkContext) \ + (This)->lpVtbl -> RaisePropertyUi(This,hwndParent,dwFlags,punkContext) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetDisplayName_Proxy( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwDisplayName); + + +void __RPC_STUB INetCfgComponent_GetDisplayName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_SetDisplayName_Proxy( + INetCfgComponent * This, + /* [string][in] */ LPCWSTR pszwDisplayName); + + +void __RPC_STUB INetCfgComponent_SetDisplayName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetHelpText_Proxy( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *pszwHelpText); + + +void __RPC_STUB INetCfgComponent_GetHelpText_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetId_Proxy( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwId); + + +void __RPC_STUB INetCfgComponent_GetId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetCharacteristics_Proxy( + INetCfgComponent * This, + /* [out] */ LPDWORD pdwCharacteristics); + + +void __RPC_STUB INetCfgComponent_GetCharacteristics_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetInstanceGuid_Proxy( + INetCfgComponent * This, + /* [out] */ GUID *pGuid); + + +void __RPC_STUB INetCfgComponent_GetInstanceGuid_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetPnpDevNodeId_Proxy( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwDevNodeId); + + +void __RPC_STUB INetCfgComponent_GetPnpDevNodeId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetClassGuid_Proxy( + INetCfgComponent * This, + /* [out] */ GUID *pGuid); + + +void __RPC_STUB INetCfgComponent_GetClassGuid_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetBindName_Proxy( + INetCfgComponent * This, + /* [string][out] */ LPWSTR *ppszwBindName); + + +void __RPC_STUB INetCfgComponent_GetBindName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_GetDeviceStatus_Proxy( + INetCfgComponent * This, + /* [out] */ ULONG *pulStatus); + + +void __RPC_STUB INetCfgComponent_GetDeviceStatus_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_OpenParamKey_Proxy( + INetCfgComponent * This, + /* [out] */ HKEY *phkey); + + +void __RPC_STUB INetCfgComponent_OpenParamKey_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponent_RaisePropertyUi_Proxy( + INetCfgComponent * This, + /* [in] */ HWND hwndParent, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkContext); + + +void __RPC_STUB INetCfgComponent_RaisePropertyUi_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponent_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgComponentBindings_INTERFACE_DEFINED__ +#define __INetCfgComponentBindings_INTERFACE_DEFINED__ + +/* interface INetCfgComponentBindings */ +/* [unique][uuid][object][local] */ + +typedef +enum tagSUPPORTS_BINDING_INTERFACE_FLAGS + { NCF_LOWER = 0x1, + NCF_UPPER = 0x2 + } SUPPORTS_BINDING_INTERFACE_FLAGS; + +typedef +enum tagENUM_BINDING_PATHS_FLAGS + { EBP_ABOVE = 0x1, + EBP_BELOW = 0x2 + } ENUM_BINDING_PATHS_FLAGS; + + +EXTERN_C const IID IID_INetCfgComponentBindings; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE9E-306E-11D1-AACF-00805FC1270E") + INetCfgComponentBindings : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE BindTo( + /* [in] */ INetCfgComponent *pnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE UnbindFrom( + /* [in] */ INetCfgComponent *pnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE SupportsBindingInterface( + /* [in] */ DWORD dwFlags, + /* [in] */ LPCWSTR pszwInterfaceName) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsBoundTo( + /* [in] */ INetCfgComponent *pnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsBindableTo( + /* [in] */ INetCfgComponent *pnccItem) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumBindingPaths( + /* [in] */ DWORD dwFlags, + /* [out] */ IEnumNetCfgBindingPath **ppIEnum) = 0; + + virtual HRESULT STDMETHODCALLTYPE MoveBefore( + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest) = 0; + + virtual HRESULT STDMETHODCALLTYPE MoveAfter( + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgComponentBindingsVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgComponentBindings * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgComponentBindings * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgComponentBindings * This); + + HRESULT ( STDMETHODCALLTYPE *BindTo )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + HRESULT ( STDMETHODCALLTYPE *UnbindFrom )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + HRESULT ( STDMETHODCALLTYPE *SupportsBindingInterface )( + INetCfgComponentBindings * This, + /* [in] */ DWORD dwFlags, + /* [in] */ LPCWSTR pszwInterfaceName); + + HRESULT ( STDMETHODCALLTYPE *IsBoundTo )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + HRESULT ( STDMETHODCALLTYPE *IsBindableTo )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + HRESULT ( STDMETHODCALLTYPE *EnumBindingPaths )( + INetCfgComponentBindings * This, + /* [in] */ DWORD dwFlags, + /* [out] */ IEnumNetCfgBindingPath **ppIEnum); + + HRESULT ( STDMETHODCALLTYPE *MoveBefore )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest); + + HRESULT ( STDMETHODCALLTYPE *MoveAfter )( + INetCfgComponentBindings * This, + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest); + + END_INTERFACE + } INetCfgComponentBindingsVtbl; + + interface INetCfgComponentBindings + { + CONST_VTBL struct INetCfgComponentBindingsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgComponentBindings_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgComponentBindings_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgComponentBindings_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgComponentBindings_BindTo(This,pnccItem) \ + (This)->lpVtbl -> BindTo(This,pnccItem) + +#define INetCfgComponentBindings_UnbindFrom(This,pnccItem) \ + (This)->lpVtbl -> UnbindFrom(This,pnccItem) + +#define INetCfgComponentBindings_SupportsBindingInterface(This,dwFlags,pszwInterfaceName) \ + (This)->lpVtbl -> SupportsBindingInterface(This,dwFlags,pszwInterfaceName) + +#define INetCfgComponentBindings_IsBoundTo(This,pnccItem) \ + (This)->lpVtbl -> IsBoundTo(This,pnccItem) + +#define INetCfgComponentBindings_IsBindableTo(This,pnccItem) \ + (This)->lpVtbl -> IsBindableTo(This,pnccItem) + +#define INetCfgComponentBindings_EnumBindingPaths(This,dwFlags,ppIEnum) \ + (This)->lpVtbl -> EnumBindingPaths(This,dwFlags,ppIEnum) + +#define INetCfgComponentBindings_MoveBefore(This,pncbItemSrc,pncbItemDest) \ + (This)->lpVtbl -> MoveBefore(This,pncbItemSrc,pncbItemDest) + +#define INetCfgComponentBindings_MoveAfter(This,pncbItemSrc,pncbItemDest) \ + (This)->lpVtbl -> MoveAfter(This,pncbItemSrc,pncbItemDest) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_BindTo_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + +void __RPC_STUB INetCfgComponentBindings_BindTo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_UnbindFrom_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + +void __RPC_STUB INetCfgComponentBindings_UnbindFrom_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_SupportsBindingInterface_Proxy( + INetCfgComponentBindings * This, + /* [in] */ DWORD dwFlags, + /* [in] */ LPCWSTR pszwInterfaceName); + + +void __RPC_STUB INetCfgComponentBindings_SupportsBindingInterface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_IsBoundTo_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + +void __RPC_STUB INetCfgComponentBindings_IsBoundTo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_IsBindableTo_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgComponent *pnccItem); + + +void __RPC_STUB INetCfgComponentBindings_IsBindableTo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_EnumBindingPaths_Proxy( + INetCfgComponentBindings * This, + /* [in] */ DWORD dwFlags, + /* [out] */ IEnumNetCfgBindingPath **ppIEnum); + + +void __RPC_STUB INetCfgComponentBindings_EnumBindingPaths_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_MoveBefore_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest); + + +void __RPC_STUB INetCfgComponentBindings_MoveBefore_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgComponentBindings_MoveAfter_Proxy( + INetCfgComponentBindings * This, + /* [in] */ INetCfgBindingPath *pncbItemSrc, + /* [in] */ INetCfgBindingPath *pncbItemDest); + + +void __RPC_STUB INetCfgComponentBindings_MoveAfter_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgComponentBindings_INTERFACE_DEFINED__ */ + + +#ifndef __INetCfgSysPrep_INTERFACE_DEFINED__ +#define __INetCfgSysPrep_INTERFACE_DEFINED__ + +/* interface INetCfgSysPrep */ +/* [unique][uuid][object][local] */ + + +EXTERN_C const IID IID_INetCfgSysPrep; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C0E8AE98-306E-11D1-AACF-00805FC1270E") + INetCfgSysPrep : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstDword( + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ DWORD dwValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstString( + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [string][in] */ LPCWSTR pwszValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstStringAsBool( + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ BOOL fValue) = 0; + + virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstMultiSzField( + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ LPCWSTR pmszValue) = 0; + + }; + +#else /* C style interface */ + + typedef struct INetCfgSysPrepVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + INetCfgSysPrep * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + INetCfgSysPrep * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + INetCfgSysPrep * This); + + HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstDword )( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ DWORD dwValue); + + HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstString )( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [string][in] */ LPCWSTR pwszValue); + + HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstStringAsBool )( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ BOOL fValue); + + HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstMultiSzField )( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ LPCWSTR pmszValue); + + END_INTERFACE + } INetCfgSysPrepVtbl; + + interface INetCfgSysPrep + { + CONST_VTBL struct INetCfgSysPrepVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define INetCfgSysPrep_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define INetCfgSysPrep_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define INetCfgSysPrep_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define INetCfgSysPrep_HrSetupSetFirstDword(This,pwszSection,pwszKey,dwValue) \ + (This)->lpVtbl -> HrSetupSetFirstDword(This,pwszSection,pwszKey,dwValue) + +#define INetCfgSysPrep_HrSetupSetFirstString(This,pwszSection,pwszKey,pwszValue) \ + (This)->lpVtbl -> HrSetupSetFirstString(This,pwszSection,pwszKey,pwszValue) + +#define INetCfgSysPrep_HrSetupSetFirstStringAsBool(This,pwszSection,pwszKey,fValue) \ + (This)->lpVtbl -> HrSetupSetFirstStringAsBool(This,pwszSection,pwszKey,fValue) + +#define INetCfgSysPrep_HrSetupSetFirstMultiSzField(This,pwszSection,pwszKey,pmszValue) \ + (This)->lpVtbl -> HrSetupSetFirstMultiSzField(This,pwszSection,pwszKey,pmszValue) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE INetCfgSysPrep_HrSetupSetFirstDword_Proxy( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ DWORD dwValue); + + +void __RPC_STUB INetCfgSysPrep_HrSetupSetFirstDword_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgSysPrep_HrSetupSetFirstString_Proxy( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [string][in] */ LPCWSTR pwszValue); + + +void __RPC_STUB INetCfgSysPrep_HrSetupSetFirstString_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgSysPrep_HrSetupSetFirstStringAsBool_Proxy( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ BOOL fValue); + + +void __RPC_STUB INetCfgSysPrep_HrSetupSetFirstStringAsBool_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE INetCfgSysPrep_HrSetupSetFirstMultiSzField_Proxy( + INetCfgSysPrep * This, + /* [string][in] */ LPCWSTR pwszSection, + /* [string][in] */ LPCWSTR pwszKey, + /* [in] */ LPCWSTR pmszValue); + + +void __RPC_STUB INetCfgSysPrep_HrSetupSetFirstMultiSzField_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __INetCfgSysPrep_INTERFACE_DEFINED__ */ + + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + + diff --git a/winpcap_oem/OEM/WinpcapOem/pch.h b/winpcap_oem/OEM/WinpcapOem/pch.h new file mode 100644 index 00000000..4e6068fc --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/pch.h @@ -0,0 +1,31 @@ +//+--------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (C) Microsoft Corporation, 1997. +// +// File: P C H . H +// +// Contents: Pre-compiled header file +// +// Notes: +// +// Author: kumarp 28-September-98 +// +//---------------------------------------------------------------------------- + +#pragma once + +// Turns off "string too long - truncated to 255 characters in the debug +// information, debugger cannot evaluate symbol." +// +#pragma warning (disable: 4786) + +#include +#include +#include + +#include +#include +#include +#include + diff --git a/winpcap_oem/OEM/WinpcapOem/postbuild.bat b/winpcap_oem/OEM/WinpcapOem/postbuild.bat new file mode 100644 index 00000000..6792abba --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/postbuild.bat @@ -0,0 +1,6 @@ +@echo off + +echo Copying dll files for debug +REM This copies are needed to debug all the stuff internally, in the cpcap output folders + +if exist debug\packet.lib xcopy debug\packet.lib ..\..\..\winpcap\common\ /v /y /q diff --git a/winpcap_oem/OEM/WinpcapOem/postbuild_release.bat b/winpcap_oem/OEM/WinpcapOem/postbuild_release.bat new file mode 100644 index 00000000..6dadfe32 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/postbuild_release.bat @@ -0,0 +1,6 @@ +@echo off + +echo Copying dll files for debug +REM This copies are needed to debug all the stuff internally, in the winpcap output folders + +if exist release\packet.lib xcopy release\packet.lib ..\..\..\winpcap\common\ /v /y /q diff --git a/winpcap_oem/OEM/WinpcapOem/prebuild_debug.bat b/winpcap_oem/OEM/WinpcapOem/prebuild_debug.bat new file mode 100644 index 00000000..7613a0dd --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/prebuild_debug.bat @@ -0,0 +1,30 @@ +@echo off + +echo Copying Debug DLLs + +if "%1"=="x64" ( +echo Creating folders +mkdir .\Binaries\ > NUL 2>NUL +mkdir .\Binaries\x64 > NUL 2>NUL +mkdir .\Binaries\x86 > NUL 2>NUL +echo Copying compiled DLLs for x64 +copy "..\..\packetNtx\Dll\Project\Packet (NetMon) Debug\x64\packet.dll" .\Binaries\x64\packet2k.dll +copy "..\..\PacketNtx\Dll\Project\Packet (NoNetMon) Debug\x64\packet.dll" .\Binaries\x64\packetVista.dll +echo Copying drivers for x64 +copy ..\..\packetNtx\Driver\bin\xp\AMD64\npf.sys .\Binaries\x64\npfx64.sys +) + +if "%1"=="x86" ( +echo Creating folders +mkdir .\Binaries\ > NUL 2>NUL +mkdir .\Binaries\x64 > NUL 2>NUL +mkdir .\Binaries\x86 > NUL 2>NUL +echo Copying compiled DLLs for x86 +copy "..\..\packetNtx\Dll\Project\Packet (NT4) Debug\x86\packet.dll" .\Binaries\x86\packetnt.dll +copy "..\..\packetNtx\Dll\Project\Packet (NetMon) Debug\x86\packet.dll" .\Binaries\x86\packet2k.dll +copy "..\..\PacketNtx\Dll\Project\Packet (NoNetMon) Debug\x86\packet.dll" .\Binaries\x86\packetVista.dll +echo Copying drivers for x86 and x64 +copy ..\..\packetNtx\Driver\bin\2k\i386\npf.sys .\Binaries\x86\npf2k.sys +copy ..\..\packetNtx\Driver\bin\NT4\i386\free\npf.sys .\Binaries\x86\npfnt.sys +copy ..\..\packetNtx\Driver\bin\xp\AMD64\npf.sys .\Binaries\x64\npfx64.sys +) diff --git a/winpcap_oem/OEM/WinpcapOem/prebuild_release.bat b/winpcap_oem/OEM/WinpcapOem/prebuild_release.bat new file mode 100644 index 00000000..127ee1ed --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/prebuild_release.bat @@ -0,0 +1,30 @@ +@echo off + +echo Copying Release DLLs + +if "%1"=="x64" ( +echo Creating folders +mkdir .\Binaries\ > NUL 2>NUL +mkdir .\Binaries\x64 > NUL 2>NUL +mkdir .\Binaries\x86 > NUL 2>NUL +echo Copying compiled DLLs for x64 +copy "..\..\packetNtx\Dll\Project\Packet (NetMon) Release\x64\packet.dll" .\Binaries\x64\packet2k.dll +copy "..\..\PacketNtx\Dll\Project\Packet (NoNetMon) Release\x64\packet.dll" .\Binaries\x64\packetVista.dll +echo Copying drivers for x64 +copy ..\..\packetNtx\Driver\bin\xp\AMD64\npf.sys .\Binaries\x64\npfx64.sys +) + +if "%1"=="x86" ( +echo Creating folders +mkdir .\Binaries\ > NUL 2>NUL +mkdir .\Binaries\x64 > NUL 2>NUL +mkdir .\Binaries\x86 > NUL 2>NUL +echo Copying compiled DLLs for x86 +copy "..\..\packetNtx\Dll\Project\Packet (NT4) Release\x86\packet.dll" .\Binaries\x86\packetnt.dll +copy "..\..\packetNtx\Dll\Project\Packet (NetMon) Release\x86\packet.dll" .\Binaries\x86\packet2k.dll +copy "..\..\PacketNtx\Dll\Project\Packet (NoNetMon) Release\x86\packet.dll" .\Binaries\x86\packetVista.dll +echo Copying drivers for x86 and x64 +copy ..\..\packetNtx\Driver\bin\2k\i386\npf.sys .\Binaries\x86\npf2k.sys +copy ..\..\packetNtx\Driver\bin\NT4\i386\free\npf.sys .\Binaries\x86\npfnt.sys +copy ..\..\packetNtx\Driver\bin\xp\AMD64\npf.sys .\Binaries\x64\npfx64.sys +) diff --git a/winpcap_oem/OEM/WinpcapOem/resource.h b/winpcap_oem/OEM/WinpcapOem/resource.h new file mode 100644 index 00000000..31614d78 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/resource.h @@ -0,0 +1,9 @@ +// resource.h +#define IDP_DLL2K 109 +#define IDP_DRI2K 110 +#define IDP_DLLNT 111 +#define IDP_DRINT 112 +#define IDP_DRIx64 114 +#define IDP_DLLVISTA 115 + +#define HSH_AUTH_PROC 113 diff --git a/winpcap_oem/OEM/WinpcapOem/resrc1.h b/winpcap_oem/OEM/WinpcapOem/resrc1.h new file mode 100644 index 00000000..ab6ebea9 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/resrc1.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by WinpcapOem.rc +// +#define Wpcap 1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/winpcap_oem/OEM/WinpcapOem/version.h b/winpcap_oem/OEM/WinpcapOem/version.h new file mode 100644 index 00000000..cdc0a800 --- /dev/null +++ b/winpcap_oem/OEM/WinpcapOem/version.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by NetMonInstaller.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/winpcap_oem/OEM/bin2c/BIN2C.C b/winpcap_oem/OEM/bin2c/BIN2C.C new file mode 100644 index 00000000..d469ee37 --- /dev/null +++ b/winpcap_oem/OEM/bin2c/BIN2C.C @@ -0,0 +1,122 @@ + +/* BIN2C V1.0 CODED BY CHRISTIAN PADOVANO ON 17-MAY-1995 + + this little utility translates a binary file in a useful C structure + that can be included in a C source. + + to contact me write to EMAIL: Christian_Padovano@amp.flashnet.it +*/ + + +#include +#include + +#define BUF_LEN 1 +#define LINE 12 + +/* Tell u the file size in bytes */ + +long int filesize( FILE *fp ) + { + long int save_pos, size_of_file; + + save_pos = ftell( fp ); + fseek( fp, 0L, SEEK_END ); + size_of_file = ftell( fp ); + fseek( fp, save_pos, SEEK_SET ); + return( size_of_file ); + } + + +/* lower chars --> upper chars */ + +void Upper_chars(char *buffer) +{ + unsigned int c; + + for (c=0; c <= strlen(buffer)-1; c++) *(buffer+c)=toupper( *(buffer+c) ); +} + + +void main( argc, argv ) +int argc; +char *argv[]; +{ + FILE *source,*dest; + unsigned char buffer[BUF_LEN], Dummy[20]; + int c; + + if ( (argc < 4) ) + { + + if ( ( argc == 2 ) && ( strcmp(argv[1],"/?")==0 ) ) + { + puts(" - <<< BIN2C V1.0 >>> by Christian Padovano - \n"); + puts("USAGE: Bin2C "); + puts("\n = name of the C structure in the destination file name.\n"); + puts(" = without extension '.h' it will be added by program."); + exit(0L); + } + else + { + puts("Bad arguments !!! You must give me all the parameters !!!!\n" + "Type 'BIN2C /?' to read the help !!!! "); + exit(0L); + } + + } + + if( (source=fopen( argv[1], "rb" )) == NULL ) + { + printf("ERROR : I can't find source file %s\n",argv[1]); + exit(20L); + } + + strcpy(Dummy,argv[2]); + strcat(Dummy,".h"); /* add suffix .h to target name */ + + if( (dest=fopen( Dummy, "wb+" )) == NULL ) + { + printf("ERROR : I can't open destination file %s\n",Dummy); + (void)fcloseall(); + exit(20L); + } + + + strcpy(Dummy,argv[3]); + Upper_chars(Dummy); /* lower to upper chars */ + strcat(Dummy,"_LEN"); /* add the suffix _LEN to the struct name */ + /* for the #define stantment */ + + + /* It writes the header information */ + fprintf( dest, "\n#define %s %ld\n\n", Dummy, filesize(source) ); + fprintf( dest, " static unsigned char %s[]=\n {\n ", argv[3] ); + + if( ferror( dest ) ) + { + printf( "ERROR writing on target file: %s\n",argv[2] ); + (void)fcloseall(); + exit(20L); + } + + do + { + for ( c=0; ((c <= LINE) && (! feof( source ) )) ; c++) + { + fread( buffer, 1, 1, source ); + if (! feof( source ) ) fprintf(dest,"0x%02x,",*buffer); + else fprintf(dest,"0x%02x",*buffer); + } + fprintf(dest,"\n "); + } + while( ! feof( source ) ); + + fprintf(dest,"};\n\n"); + + (void)fcloseall(); + +} + + + diff --git a/winpcap_oem/OEM/bin2c/bin2c.exe b/winpcap_oem/OEM/bin2c/bin2c.exe new file mode 100644 index 00000000..f02c5750 Binary files /dev/null and b/winpcap_oem/OEM/bin2c/bin2c.exe differ diff --git a/winpcap_oem/WinPcap OEM.sln b/winpcap_oem/WinPcap OEM.sln new file mode 100644 index 00000000..9a293d8d --- /dev/null +++ b/winpcap_oem/WinPcap OEM.sln @@ -0,0 +1,164 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Packet (NT4)", "packetNtx\Dll\Project\PacketNT4.vcproj", "{33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinPcap NTx Driver", "..\winpcap\packetNtx\driver\WinPcap NTx Driver_2003.vcproj", "{5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinpcapOem", "OEM\WinpcapOem\WinpcapOem.vcproj", "{E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}" + ProjectSection(ProjectDependencies) = postProject + {8D305FC1-A748-4C63-B419-585BF03165D9} = {8D305FC1-A748-4C63-B419-585BF03165D9} + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D} = {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D} + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2} = {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2} + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB} = {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wpcap", "wpcap\PRJ\wpcap.vcproj", "{CAEF56E3-4959-4C10-81F5-06C8E86C301E}" + ProjectSection(ProjectDependencies) = postProject + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D} = {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Packet (NoNetMon)", "packetNtx\Dll\Project\PacketVista.vcproj", "{8D305FC1-A748-4C63-B419-585BF03165D9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Packet (NetMon)", "packetNtx\Dll\Project\PacketNetMon.vcproj", "{A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug_TNT|Win32 = Debug_TNT|Win32 + Debug_TNT|x64 = Debug_TNT|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release STEP1|Win32 = Release STEP1|Win32 + Release STEP1|x64 = Release STEP1|x64 + Release STEP2|Win32 = Release STEP2|Win32 + Release STEP2|x64 = Release STEP2|x64 + Release_TNT|Win32 = Release_TNT|Win32 + Release_TNT|x64 = Release_TNT|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug_TNT|Win32.ActiveCfg = Debug|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug_TNT|Win32.Build.0 = Debug|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug_TNT|x64.ActiveCfg = Debug|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug_TNT|x64.Build.0 = Debug|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug|Win32.ActiveCfg = Debug|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug|Win32.Build.0 = Debug|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Debug|x64.ActiveCfg = Debug|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release STEP1|Win32.ActiveCfg = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release STEP1|Win32.Build.0 = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release STEP1|x64.ActiveCfg = Release|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release STEP1|x64.Build.0 = Release|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release STEP2|x64.ActiveCfg = Release|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release_TNT|Win32.ActiveCfg = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release_TNT|Win32.Build.0 = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release_TNT|x64.ActiveCfg = Release SIGNED|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release_TNT|x64.Build.0 = Release SIGNED|x64 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release|Win32.ActiveCfg = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release|Win32.Build.0 = Release|Win32 + {33BCE0DE-2404-4647-8F2D-DA5D00F04A3D}.Release|x64.ActiveCfg = Release|x64 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Debug_TNT|Win32.ActiveCfg = Debug|Win32 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Debug_TNT|x64.ActiveCfg = Debug|x64 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Debug|Win32.ActiveCfg = Debug|Win32 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Debug|x64.ActiveCfg = Debug|x64 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Release STEP1|Win32.ActiveCfg = Release|Win32 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Release STEP1|x64.ActiveCfg = Release|x64 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Release STEP2|x64.ActiveCfg = Release|x64 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Release_TNT|Win32.ActiveCfg = Release|Win32 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Release_TNT|x64.ActiveCfg = Release|x64 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Release|Win32.ActiveCfg = Release|Win32 + {5E91F1EF-C30E-43F7-9187-E37A0BDA7FDB}.Release|x64.ActiveCfg = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|Win32.ActiveCfg = Debug_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|Win32.Build.0 = Debug_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|x64.ActiveCfg = Debug_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug_TNT|x64.Build.0 = Debug_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|Win32.ActiveCfg = Debug|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|Win32.Build.0 = Debug|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|x64.ActiveCfg = Debug|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Debug|x64.Build.0 = Debug|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP1|Win32.ActiveCfg = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP1|x64.ActiveCfg = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP2|Win32.Build.0 = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP2|x64.ActiveCfg = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release STEP2|x64.Build.0 = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|Win32.ActiveCfg = Release_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|Win32.Build.0 = Release_TNT|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|x64.ActiveCfg = Release_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release_TNT|x64.Build.0 = Release_TNT|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|Win32.ActiveCfg = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|Win32.Build.0 = Release|Win32 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|x64.ActiveCfg = Release|x64 + {E491DDDD-D07C-49E8-BA60-0EEA963E2E8D}.Release|x64.Build.0 = Release|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug_TNT|Win32.ActiveCfg = Debug REMOTE TNT|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug_TNT|Win32.Build.0 = Debug REMOTE TNT|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug_TNT|x64.ActiveCfg = Debug REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug_TNT|x64.Build.0 = Debug REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug|Win32.ActiveCfg = Debug REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug|Win32.Build.0 = Debug REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug|x64.ActiveCfg = Debug REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Debug|x64.Build.0 = Debug REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release STEP1|Win32.ActiveCfg = Release REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release STEP1|x64.ActiveCfg = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release STEP2|Win32.ActiveCfg = Release REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release STEP2|Win32.Build.0 = Release REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release STEP2|x64.ActiveCfg = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release STEP2|x64.Build.0 = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release_TNT|Win32.ActiveCfg = Release REMOTE TNT|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release_TNT|Win32.Build.0 = Release REMOTE TNT|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release_TNT|x64.ActiveCfg = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release_TNT|x64.Build.0 = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release|Win32.ActiveCfg = Release REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release|Win32.Build.0 = Release REMOTE|Win32 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release|x64.ActiveCfg = Release REMOTE|x64 + {CAEF56E3-4959-4C10-81F5-06C8E86C301E}.Release|x64.Build.0 = Release REMOTE|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug_TNT|Win32.ActiveCfg = Debug|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug_TNT|Win32.Build.0 = Debug|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug_TNT|x64.ActiveCfg = Debug|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug_TNT|x64.Build.0 = Debug|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug|Win32.ActiveCfg = Debug|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug|Win32.Build.0 = Debug|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug|x64.ActiveCfg = Debug|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Debug|x64.Build.0 = Debug|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release STEP1|Win32.ActiveCfg = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release STEP1|Win32.Build.0 = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release STEP1|x64.ActiveCfg = Release|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release STEP1|x64.Build.0 = Release|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release STEP2|x64.ActiveCfg = Release|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release_TNT|Win32.ActiveCfg = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release_TNT|Win32.Build.0 = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release_TNT|x64.ActiveCfg = Release SIGNED|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release_TNT|x64.Build.0 = Release SIGNED|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release|Win32.ActiveCfg = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release|Win32.Build.0 = Release|Win32 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release|x64.ActiveCfg = Release|x64 + {8D305FC1-A748-4C63-B419-585BF03165D9}.Release|x64.Build.0 = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug_TNT|Win32.ActiveCfg = Debug|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug_TNT|Win32.Build.0 = Debug|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug_TNT|x64.ActiveCfg = Debug|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug_TNT|x64.Build.0 = Debug|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug|Win32.ActiveCfg = Debug|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug|Win32.Build.0 = Debug|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug|x64.ActiveCfg = Debug|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Debug|x64.Build.0 = Debug|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release STEP1|Win32.ActiveCfg = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release STEP1|Win32.Build.0 = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release STEP1|x64.ActiveCfg = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release STEP1|x64.Build.0 = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release STEP2|Win32.ActiveCfg = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release STEP2|x64.ActiveCfg = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release_TNT|Win32.ActiveCfg = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release_TNT|Win32.Build.0 = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release_TNT|x64.ActiveCfg = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release_TNT|x64.Build.0 = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release|Win32.ActiveCfg = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release|Win32.Build.0 = Release|Win32 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release|x64.ActiveCfg = Release|x64 + {A3042039-CBC3-4F02-BD4E-A372F2BE2ED2}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/winpcap_oem/build_tnt_bin.bat b/winpcap_oem/build_tnt_bin.bat new file mode 100644 index 00000000..c79d38e3 --- /dev/null +++ b/winpcap_oem/build_tnt_bin.bat @@ -0,0 +1,19 @@ +@echo off + +if "%1"=="" (set __DEST_FOLDER=.\TntBin) ELSE (set __DEST_FOLDER=%1) + +echo ****************************************************************** +echo The bin folder for The Network Toolkit will be created in folder +echo %__DEST_FOLDER% +echo ****************************************************************** +pause + +echo Creating %__DEST_FOLDER% folder +mkdir %__DEST_FOLDER% >nul 2>nul + +xcopy /v /Y .\wpcap\PRJ\Release_REMOTE\wpcap.dll %__DEST_FOLDER%\ +xcopy /v /Y .\OEM\WinPcapOEM\release_TNT\packet.dll %__DEST_FOLDER%\ + +echo Folder %__DEST_FOLDER% created successfully + +set __DEST_FOLDER= diff --git a/winpcap_oem/build_wpdpack_oem.bat b/winpcap_oem/build_wpdpack_oem.bat new file mode 100755 index 00000000..40c6fcb3 --- /dev/null +++ b/winpcap_oem/build_wpdpack_oem.bat @@ -0,0 +1,22 @@ +@echo off + +if "%1"=="" (set WOEM_WPD_VANILLA_FOLDER=.\WpdPack\) ELSE (set WOEM_WPD_VANILLA_FOLDER=%1) + +echo ************************************************ +echo The developer's pack will be created in folder +echo %WOEM_WPD_VANILLA_FOLDER% +echo ************************************************ +rem pause + +call create_include_oem.bat ..\winpcap\ %WOEM_WPD_VANILLA_FOLDER% +rem PAUSE +call create_lib_oem.bat %WOEM_WPD_VANILLA_FOLDER% +rem PAUSE +call create_bin_oem.bat %WOEM_WPD_VANILLA_FOLDER% +rem PAUSE +call create_examples_oem.bat %WOEM_WPD_VANILLA_FOLDER% +rem PAUSE +call create_docs_oem.bat %WOEM_WPD_VANILLA_FOLDER% +rem echo Copying the license agreement file +rem xcopy /v /Y "LicenseAgreement.pdf" %WOEM_WPD_VANILLA_FOLDER%. >nul +set WOEM_WPD_VANILLA_FOLDER= diff --git a/winpcap_oem/build_wpdpack_oem_with_npfim.bat b/winpcap_oem/build_wpdpack_oem_with_npfim.bat new file mode 100644 index 00000000..98ecc1cd --- /dev/null +++ b/winpcap_oem/build_wpdpack_oem_with_npfim.bat @@ -0,0 +1,58 @@ +@echo off + +set OEM_WPD_NPFIM_DEST_FOLDER=.\WpdPack_NpfIm\ + +if "%1"=="-CERTIFIED" ( + echo Using NpfImLoader CERTIFIED DEVPACK + set NPFIM_LOADER_DEVPACK=..\NpfIm\NpfImLoader_DevPack_CERTIFIED + ) else ( + echo use -CERTIFIED to use NpfImLoader CERTIFIED DEVPACK + set NPFIM_LOADER_DEVPACK=..\NpfIm\NpfImLoader_DevPack + ) + +set NPFIM_DEVPACK=..\NpfIm\NpfIm_DevPack + +echo ************************************************ +echo The developer's pack will be created in folder +echo %OEM_WPD_NPFIM_DEST_FOLDER% +echo ************************************************ + +call create_include_oem.bat ..\winpcap\ %OEM_WPD_NPFIM_DEST_FOLDER% +call create_lib_oem.bat %OEM_WPD_NPFIM_DEST_FOLDER% +call create_bin_oem.bat %OEM_WPD_NPFIM_DEST_FOLDER% +call create_examples_oem.bat %OEM_WPD_NPFIM_DEST_FOLDER% +call create_docs_oem.bat %OEM_WPD_NPFIM_DEST_FOLDER% + +echo Copying the license agreement file +xcopy /v /Y "LicenseAgreement.pdf" %OEM_WPD_NPFIM_DEST_FOLDER% >nul + +rem now we copy the certified files from the NpfIm engine + +echo Copying NpfIm specific files + +rem NOTE: we do not copy all the lib/h files, only the ones really needed, +rem i.e. the ones for the loader +xcopy /v /Y %NPFIM_LOADER_DEVPACK%\*.h* %OEM_WPD_NPFIM_DEST_FOLDER%\include\ >nul +xcopy /v /Y %NPFIM_LOADER_DEVPACK%\*.lib %OEM_WPD_NPFIM_DEST_FOLDER%\lib\ >nul + +rem NOTE: but we copy all the binaries... +xcopy /v /Y %NPFIM_LOADER_DEVPACK%\*.dll %OEM_WPD_NPFIM_DEST_FOLDER%\bin\ >nul +xcopy /v /Y %NPFIM_DEVPACK%\*.dll %OEM_WPD_NPFIM_DEST_FOLDER%\bin\ >nul + +rem copy the available sample, IfListNpfIm. We assume that the sample is in ..\NpfIm\Sample + +mkdir %OEM_WPD_NPFIM_DEST_FOLDER%\Examples-Remote\IfListNpfIm >nul 2>nul +xcopy /v /Y ..\NpfIm\Samples\IfListNpfIm\*.c* %OEM_WPD_NPFIM_DEST_FOLDER%\Examples-Remote\IfListNpfIm\ > nul +xcopy /v /Y ..\NpfIm\Samples\IfListNpfIm\*.h* %OEM_WPD_NPFIM_DEST_FOLDER%\Examples-Remote\IfListNpfIm\ > nul +xcopy /v /Y ..\NpfIm\Samples\IfListNpfIm\*.vcproj %OEM_WPD_NPFIM_DEST_FOLDER%\Examples-Remote\IfListNpfIm\ > nul +xcopy /v /Y ..\NpfIm\Samples\IfListNpfIm\*.sln %OEM_WPD_NPFIM_DEST_FOLDER%\Examples-Remote\IfListNpfIm\ > nul + +rem copy the documentation for npfimLoader +mkdir %OEM_WPD_NPFIM_DEST_FOLDER%\docs\NpfImLoader 2>nul >nul +xcopy /s/e/v/Y ..\NpfIm\LowLevelDll\docs\NpfImLoader\*.* %OEM_WPD_NPFIM_DEST_FOLDER%\docs\NpfImLoader\ > nul +del /f/s/q %OEM_WPD_NPFIM_DEST_FOLDER%\docs\WinPcap >nul 2>nul +rd %OEM_WPD_NPFIM_DEST_FOLDER%\docs\WinPcap >nul 2>nul +ren %OEM_WPD_NPFIM_DEST_FOLDER%\docs\html WinPcap +copy /v ..\NpfIm\LowLevelDll\docs\WinPcapPro_docs.html %OEM_WPD_NPFIM_DEST_FOLDER%\docs\. > nul + +set OEM_WPD_NPFIM_DEST_FOLDER= \ No newline at end of file diff --git a/winpcap_oem/create_bin_oem.bat b/winpcap_oem/create_bin_oem.bat new file mode 100755 index 00000000..44d619fa --- /dev/null +++ b/winpcap_oem/create_bin_oem.bat @@ -0,0 +1,36 @@ +@echo off + +IF "%1"=="" (set WPDPACKDESTDIR=.\WpdPack\) ELSE (set WPDPACKDESTDIR=%1) + +echo Creating \bin folder +mkdir %WPDPACKDESTDIR% >nul 2>nul +mkdir %WPDPACKDESTDIR%\bin >nul 2>nul +mkdir %WPDPACKDESTDIR%\bin\x64 >nul 2>nul +mkdir %WPDPACKDESTDIR%\bin\x86 >nul 2>nul + +rem if not exist .\oem\WinPcapOem\Binaries_SIGNED\wpcap.dll ( +rem echo Not using the signed version of the wpcap.dll +rem xcopy /v /Y .\wpcap\PRJ\Release_REMOTE\wpcap.dll %WPDPACKDESTDIR%\bin\ >nul +rem ) else ( +rem echo Using the signed version of wpcap.dll +rem xcopy /v /y .\oem\WinPcaPOem\binaries_signed\wpcap.dll %WPDPACKDESTDIR%\bin\ >nul +rem ) +rem +rem if not exist .\oem\WinPcapOem\Binaries_signed\packet.dll ( +rem echo Not using the signed version of packet.dll +rem xcopy /v /Y .\OEM\WinPcapOEM\release\packet.dll %WPDPACKDESTDIR%\bin\ >nul +rem ) else ( +rem echo Using the signed version of packet.dll +rem xcopy /v /y .\oem\WinPcaPOem\binaries_signed\packet.dll %WPDPACKDESTDIR%\bin\ >nul +rem ) + + +xcopy /v /y ".\wpcap\PRJ\Release REMOTE\x86\wpcap.dll" %WPDPACKDESTDIR%\bin\x86\ >nul +xcopy /v /y ".\wpcap\PRJ\Release REMOTE\x64\wpcap.dll" %WPDPACKDESTDIR%\bin\x64\ >nul +xcopy /v /y ".\OEM\WinpcapOem\Release\x86\packet.dll" %WPDPACKDESTDIR%\bin\x86\ >nul +xcopy /v /y ".\OEM\WinpcapOem\Release\x64\packet.dll" %WPDPACKDESTDIR%\bin\x64\ >nul + +echo Folder \bin created successfully + +set WPDPACKDESTDIR= + diff --git a/winpcap_oem/create_docs_oem.bat b/winpcap_oem/create_docs_oem.bat new file mode 100755 index 00000000..03e3a5b7 --- /dev/null +++ b/winpcap_oem/create_docs_oem.bat @@ -0,0 +1,35 @@ +@echo off + +IF "%1"=="" (set WPDPACKDESTDIR=.\WpdPack\) ELSE (set WPDPACKDESTDIR=%1) + +IF NOT EXIST .\Examples ( + echo Copying the examples locally... + call create_local_examples.bat %1 %2 %3 + ) + +echo Creating \docs folder +mkdir %WPDPACKDESTDIR% >nul 2>nul +mkdir %WPDPACKDESTDIR%\docs >nul 2>nul +mkdir %WPDPACKDESTDIR%\docs\html >nul 2>nul + +pushd dox\prj\ + +@echo #### Deleting existing WinPcap documentation +del /q docs\*.* >nul +@echo #### Creating new documentation +doxygen winpcap_oem_noc.dox > nul +@echo #### Copying all gif files +xcopy ..\pics\*.gif docs\. /v /y /q > nul +xcopy ..\pics\*.jpg docs\. /v /y /q > nul + +popd + +xcopy /v /Y .\dox\WinPcapPro_docs.html %WPDPACKDESTDIR%\docs\ >nul +xcopy /v /Y .\dox\prj\docs\*.* %WPDPACKDESTDIR%\docs\html\ >nul +xcopy /v /Y ..\winpcap\dox\*.gif %WPDPACKDESTDIR%\docs\html\ >nul +xcopy /v /Y ..\winpcap\dox\pics\*.gif %WPDPACKDESTDIR%\docs\html\ >nul +xcopy /v /Y .\dox\pics\*.gif %WPDPACKDESTDIR%\docs\html\ >nul +xcopy /v /Y .\dox\pics\*.jpg %WPDPACKDESTDIR%\docs\html\ >nul +echo Folder \docs created successfully +set WPDPACKDESTDIR= +set WINPCAPSOURCEDIR= diff --git a/winpcap_oem/create_examples_oem.bat b/winpcap_oem/create_examples_oem.bat new file mode 100755 index 00000000..2ff0bd30 --- /dev/null +++ b/winpcap_oem/create_examples_oem.bat @@ -0,0 +1,45 @@ +@echo off + +IF NOT EXIST .\Examples ( + echo Copying the examples locally... + call create_local_examples.bat + ) + + +IF "%1"=="" (set WPDPACKDESTDIR=.\WpdPack\) ELSE (set WPDPACKDESTDIR=%1) + +set WINPCAPSOURCEDIR=.\ + +echo Creating \Examples folder +mkdir %WPDPACKDESTDIR% >nul 2>nul +mkdir %WPDPACKDESTDIR%\Examples-pcap >nul 2>nul +mkdir %WPDPACKDESTDIR%\Examples-remote >nul 2>nul + +xcopy /s/e/v /Y %WINPCAPSOURCEDIR%\Examples %WPDPACKDESTDIR%\Examples-remote >nul + +rem *** Delete Netmeter since it's no more part of the Developer's pack *** +rd /S /Q %WPDPACKDESTDIR%\Examples-remote\NetMeter\ >nul + +rem *** Delete kdump since the feature is not available at the moment *** +rd /S /Q %WPDPACKDESTDIR%\Examples-remote\kdump\ >nul + +xcopy /s/e/v /Y %WINPCAPSOURCEDIR%\Examples-pcap %WPDPACKDESTDIR%\Examples-pcap >nul + + +rem *** Delete WinPcapStress, since it's not a real example *** +rd /S /Q %WPDPACKDESTDIR%\Examples-pcap\winpcap_stress + +rem *** Delete stats, since it's not a real example *** +rd /S /Q %WPDPACKDESTDIR%\Examples-pcap\stats + + + +echo Folder \Examples created successfully +set WPDPACKDESTDIR= +set WINPCAPSOURCEDIR= + +echo ******************************************************************** +echo * * +echo * Now you can build the examples from the developers' pack folder! * +echo * * +echo ******************************************************************** diff --git a/winpcap_oem/create_include_oem.bat b/winpcap_oem/create_include_oem.bat new file mode 100755 index 00000000..865739d6 --- /dev/null +++ b/winpcap_oem/create_include_oem.bat @@ -0,0 +1,34 @@ +@echo off + +IF "%2"=="" (set WPDPACKDESTDIR=.\WpdPack\) ELSE (set WPDPACKDESTDIR=%2) + +IF ""=="%1" (set WINPCAPSOURCEDIR=.\) ELSE (set WINPCAPSOURCEDIR=%1) + +echo Creating \Include folder +mkdir %WPDPACKDESTDIR% 2>nul >nul +mkdir %WPDPACKDESTDIR%\Include 2>nul >nul +mkdir %WPDPACKDESTDIR%\Include\pcap 2>nul >nul + +xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\pcap\*.h %WPDPACKDESTDIR%\Include\pcap\ >nul +xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\PCAP.H %WPDPACKDESTDIR%\Include\ >nul +xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\pcap-bpf.h %WPDPACKDESTDIR%\Include\ >nul +xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\pcap-namedb.h %WPDPACKDESTDIR%\Include\ >nul +xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\remote-ext.h %WPDPACKDESTDIR%\Include\ >nul +xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\pcap-stdinc.h %WPDPACKDESTDIR%\Include\ >nul +xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\Win32-Extensions\Win32-Extensions.h %WPDPACKDESTDIR%\Include\ >nul +xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\Win32\Include\bittypes.h %WPDPACKDESTDIR%\Include\ >nul +xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\Win32\Include\ip6_misc.h %WPDPACKDESTDIR%\Include\ >nul + +xcopy /v /Y %WINPCAPSOURCEDIR%\Common\Packet32.h %WPDPACKDESTDIR%\Include\ >nul + +rem xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\bucket_lookup.h %WPDPACKDESTDIR%\Include\ >nul +rem xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\count_packets.h %WPDPACKDESTDIR%\Include\ >nul +rem xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\memory_t.h %WPDPACKDESTDIR%\Include\ >nul +rem xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\normal_lookup.h %WPDPACKDESTDIR%\Include\ >nul +rem xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\tcp_session.h %WPDPACKDESTDIR%\Include\ >nul +rem xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\time_calls.h %WPDPACKDESTDIR%\Include\ >nul +rem xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\tme.h %WPDPACKDESTDIR%\Include\ >nul + +echo Folder \Include created successfully +set WPDPACKDESTDIR= +set WINPCAPSOURCEDIR= diff --git a/winpcap_oem/create_lib_oem.bat b/winpcap_oem/create_lib_oem.bat new file mode 100755 index 00000000..0c39b503 --- /dev/null +++ b/winpcap_oem/create_lib_oem.bat @@ -0,0 +1,18 @@ +@echo off + +IF "%1"=="" (set WPDPACKDESTDIR=.\WpdPack\) ELSE (set WPDPACKDESTDIR=%1) + +echo Creating \Lib folder +mkdir %WPDPACKDESTDIR% >nul 2>nul +mkdir %WPDPACKDESTDIR%\Lib >nul 2>nul +mkdir %WPDPACKDESTDIR%\Lib\x64 >nul 2>nul + +xcopy /v /Y ".\wpcap\PRJ\Release REMOTE\x86\wpcap.lib" %WPDPACKDESTDIR%\Lib\ >nul +xcopy /v /Y ".\wpcap\PRJ\Release REMOTE\x64\wpcap.lib" %WPDPACKDESTDIR%\Lib\x64\ >nul +xcopy /v /Y .\OEM\WinPcapOEM\release\x86\packet.lib %WPDPACKDESTDIR%\Lib\ >nul +xcopy /v /Y .\OEM\WinPcapOEM\release\x64\packet.lib %WPDPACKDESTDIR%\Lib\x64\ >nul + +echo Folder \Lib created successfully + +set WPDPACKDESTDIR= + diff --git a/winpcap_oem/create_local_examples.bat b/winpcap_oem/create_local_examples.bat new file mode 100644 index 00000000..d6179cd2 --- /dev/null +++ b/winpcap_oem/create_local_examples.bat @@ -0,0 +1,51 @@ +@echo off + +set DESTDIR=.\ + +set SOURCEDIR=..\winpcap\ + +echo Creating Local Examples folders +mkdir %DESTDIR%\Examples-pcap >nul 2>nul +mkdir %DESTDIR%\Examples >nul 2>nul + +xcopy /s/e/v /Y %SOURCEDIR%\Examples %DESTDIR%\Examples + +xcopy /s/e/v /Y %SOURCEDIR%\Examples-pcap %DESTDIR%\Examples-pcap + +rem *** Apply the patches for the OEM initialization *** + +copy /v /y Examples.diff %DESTDIR%\Examples\. +copy /v /y Examples-pcap.diff %DESTDIR%\Examples-pcap\. + +pushd %DESTDIR%\Examples\ +patch -p1 < Examples.diff + +if NOT %ERRORLEVEL%==0 ( + echo ---- Error patching the examples!! + pause + ) +del Examples.diff > nul 2>nul + +popd + +pushd %DESTDIR%\Examples-pcap\ +patch -p1 < Examples-pcap.diff + +if NOT %ERRORLEVEL%==0 ( + echo ---- Error patching the examples-pcap!! + pause + ) +del Examples-pcap.diff > nul 2>nul + +popd + + +echo Local Examples created successfully +set DESTDIR= +set SOURCEDIR= + +echo ************************************************************************* +echo * * +echo * Now you can build the documentation from the developers' pack folder! * +echo * * +echo ************************************************************************* diff --git a/winpcap_oem/dox/WinPcapPro_docs.html b/winpcap_oem/dox/WinPcapPro_docs.html new file mode 100644 index 00000000..3b9be927 --- /dev/null +++ b/winpcap_oem/dox/WinPcapPro_docs.html @@ -0,0 +1,9 @@ + + + + + + + diff --git a/winpcap_oem/dox/doxygen_groups.txt b/winpcap_oem/dox/doxygen_groups.txt new file mode 100644 index 00000000..6d637459 --- /dev/null +++ b/winpcap_oem/dox/doxygen_groups.txt @@ -0,0 +1,89 @@ +/*! + \defgroup internals WinPcap Professional internals + \htmlinclude internals.htm +*/ + +/*! + \ingroup internals + \defgroup NPF NPF driver internals manual + \htmlinclude npf.htm +*/ + +/*! + \defgroup wpcap WinPcap Professional user's manual + \htmlinclude wpcap.htm +*/ + +/*! + \ingroup wpcap + \defgroup language Filtering expression syntax + \htmlinclude language.htm +*/ + + +/*! + \ingroup wpcap + \defgroup wpcapsamps Using WinPcap Professional in your programs + \htmlinclude wpcap_samp.htm + + \htmlinclude wpcap_samp1.htm + \include pktdump_ex\pktdump_ex.c + + \htmlinclude wpcap_samp2.htm + \include pcap_filter/pcap_filter.c +*/ + + + + + +/*! + \defgroup remote Remote Capture + \htmlinclude wpcap_remote.htm +*/ + +/*! + \ingroup remote + \defgroup remote_struct Exported Structures and Definitions +*/ + +/*! + \ingroup remote + \defgroup remotefunc Exported Functions +*/ + +/*! + \ingroup remote + \defgroup remote_pri_func Internal Functions +*/ + +/*! + \ingroup remote + \defgroup remote_pri_struct Internal Structures and Definitions +*/ + + +/*! + \ingroup remote_struct + \defgroup remote_source_string Strings related to the new source syntax +*/ + +/*! + \ingroup remote_struct + \defgroup remote_source_ID Identifiers related to the new source syntax +*/ + +/*! + \ingroup remote_struct + \defgroup remote_open_flags Flags defined in the pcap_open() function +*/ + +/*! + \ingroup remote_struct + \defgroup remote_samp_methods Sampling methods defined in the pcap_setsampling() function +*/ + +/*! + \ingroup remote_struct + \defgroup remote_auth_methods Authentication methods supported by the RPCAP protocol +*/ diff --git a/winpcap_oem/dox/footer.htm b/winpcap_oem/dox/footer.htm new file mode 100644 index 00000000..5af336e0 --- /dev/null +++ b/winpcap_oem/dox/footer.htm @@ -0,0 +1,7 @@ + +
+

    +Copyright (c) 2005 - 2009 CACE Technologies. All rights reserved.

+ + + diff --git a/winpcap_oem/dox/header.htm b/winpcap_oem/dox/header.htm new file mode 100644 index 00000000..fa5133df --- /dev/null +++ b/winpcap_oem/dox/header.htm @@ -0,0 +1,23 @@ + + +WinPcap Professional Documentation + + + + + + +
WinPcapPro_logo.jpg
+ + +
+ + + diff --git a/winpcap_oem/dox/intro.htm b/winpcap_oem/dox/intro.htm new file mode 100644 index 00000000..4a8391ab --- /dev/null +++ b/winpcap_oem/dox/intro.htm @@ -0,0 +1,154 @@ + + + + + + + + + + +
+ +

Introduction

+ + +

This Manual describes the +programming interface of WinPcap Professional. It provides detailed +descriptions of the functions and structures exported to programmers, along +with several tutorials and +examples.  + +

+

You can follow the links at the top of this page to reach sections of interest. + +

+

What is WinPcap

+

WinPcap is an open source library for packet capture and network analysis for +the Win32 platforms.

+

Most networking applications access the network through widely used operating +system primitives such as sockets.  It is easy to access data on the +network with this approach since the operating system copes with the low level +details (protocol handling, packet reassembly, etc.) and provides a familiar +interface that is similar to the one used to read and write files. + +

+

Sometimes, however, the 'easy way' is not up to the task, since some +applications require direct access to packets on the network.  That is, they +need access to the "raw" data on the network without the interposition of +protocol processing by the operating system.

+

The purpose of WinPcap is to give this kind of access to Win32 applications; +it provides facilities to:

+
    +
  • capture + raw packets, both the ones destined to the machine where it's running and + the ones exchanged by other hosts (on shared media)
  • +
  • filter + the packets according to user-specified rules before dispatching them to the + application
  • +
  • transmit raw packets to the network
  • +
  • gather statistical information on the network traffic
  • +
+

This set of capabilities is obtained by means of a device driver, that is +installed inside the networking portion of Win32 kernels, plus a couple of DLLs.

+

All these features are exported through a powerful programming interface, +easily exploitable by the applications and available on different OSes. The main +goal of this manual is to document this interface, with the help of several +examples.  If you are interested in starting your exploration right away +you can go directly to the WinPcap user's manual.

+

What is WinPcap Professional

+

WinPcap Professional is a customized version of WinPcap, +specifically tailored for companies needing to embed the WinPcap technology +inside their applications. Here are the main features of WinPcap Professional:

+
    +
  • no installation required.
  • +
  • easy to include in third party applications (you + just put the WinPcap Professional DLLs in the same folder of your application).
  • +
  • no conflicts with versions of WinPcap previously + installed on the target machine, since WinPcap Professional loads its own drivers.
  • +
  • loads the driver when the user starts your + application, unloads the driver when the user closes your application.
  • +
  • support for +
      +
    • Windows NT4
    • +
    • Windows 2000
    • +
    • Windows XP (x86 and x64)
    • +
    • Windows Server 2003 (x86 and x64)
    • +
    • Windows Server 2003 R2 (x86 and x64)
    • +
    • Windows Vista (x86 and x64).
    • +
    • Windows Server 2008 (x86 and x64).
    • +
    • Windows 7 (x86 and x64).
    • +
    • Windows Server 2008 R2 (x86 and x64).
    • +
    + +
  • +
+ +

Including WinPcap Professional in your application and deploying it in your installer +is extremely easy, just follow the instructions in section +Using WinPcap Professional in your +programs.

+ +

What kind of programs use WinPcap

+

The WinPcap programming interface can be used by many types of network tools +for analysis, troubleshooting, security and +monitoring. In particular, classical tools that rely on WinPcap are:

+ +
    +
  • network and protocol analyzers
  • +
  • network monitors
  • +
  • traffic loggers
  • +
  • traffic generators
  • +
  • user-level bridges and routers
  • +
  • network intrusion detection systems (NIDS)
  • +
  • network scanners
  • +
  • security tools
  • +
+

What WinPcap cannot do

+

WinPcap receives and sends the packets independently from the host +protocols, like TCP-IP. This means that it isn't able to block, filter or +manipulate the traffic generated by other programs on the same machine: it +simply "sniffs" the packets that transit on the wire. Therefore, it does not +provide the appropriate support for applications like traffic shapers, QoS +schedulers and personal firewalls.

+ +

Purpose of this manual

+

The purpose of this manual is to provide a comprehensive and easy way to +browse the documentation of the WinPcap architecture.

+

The Manual contains all the information about functions and data +structures exported by the WinPcap API, a manual that explains how to write +packet filters and a page that explains how to include it in an application. A +tutorial with several code samples is provided as well; it can be used to learn +the basics of the WinPcap API using a step-by-step approach, but it also offers +code snippets that demonstrate advanced features.  

+

Additional Documentation

+

For additional and up-to-date documentation, we suggest that you look at  http://www.winpcap.org/docs/ +

+

In particular, if you are interested in +the structure and the internals of WinPcap, we suggest reading the +following documents:

+ + +

Note

+

For consistency with the literature, we will use the term packet even + though frame is more accurate since the capture process is done at + the data-link layer and the data-link header is included in the captured + data.

+ + + + diff --git a/winpcap_oem/dox/main.txt b/winpcap_oem/dox/main.txt new file mode 100644 index 00000000..f984f133 --- /dev/null +++ b/winpcap_oem/dox/main.txt @@ -0,0 +1,25 @@ +/*! + + \mainpage Documentation + +- \ref wpcap + - \ref wpcap_def + - \ref wpcapfunc + - \ref language + - \ref wpcapsamps + - \ref wpcap_tut + - \ref wpcap_tut1 + - \ref wpcap_tut2 + - \ref wpcap_tut3 + - \ref wpcap_tut4 + - \ref wpcap_tut5 + - \ref wpcap_tut6 + - \ref wpcap_tut7 + - \ref wpcap_tut8 + - \ref wpcap_tut9 + +\htmlinclude intro.htm + + +*/ + diff --git a/winpcap_oem/dox/pics/CACE_logo.jpg b/winpcap_oem/dox/pics/CACE_logo.jpg new file mode 100644 index 00000000..625c70f1 Binary files /dev/null and b/winpcap_oem/dox/pics/CACE_logo.jpg differ diff --git a/winpcap_oem/dox/pics/OEM_logo.jpg b/winpcap_oem/dox/pics/OEM_logo.jpg new file mode 100644 index 00000000..a98a4a68 Binary files /dev/null and b/winpcap_oem/dox/pics/OEM_logo.jpg differ diff --git a/winpcap_oem/dox/pics/WinPcapPro_logo.jpg b/winpcap_oem/dox/pics/WinPcapPro_logo.jpg new file mode 100644 index 00000000..076883b2 Binary files /dev/null and b/winpcap_oem/dox/pics/WinPcapPro_logo.jpg differ diff --git a/winpcap_oem/dox/prj/winpcap_oem_noc.dox b/winpcap_oem/dox/prj/winpcap_oem_noc.dox new file mode 100644 index 00000000..15b718d0 --- /dev/null +++ b/winpcap_oem/dox/prj/winpcap_oem_noc.dox @@ -0,0 +1,1344 @@ +# Doxyfile 1.5.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = "WinPcap Professional " + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 4.1.2.2536 + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = ./ + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = NO + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is +# documented as struct with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code where the coding convention is that all structs are +# typedef'ed and only the typedef is referenced never the struct's name. + +TYPEDEF_HIDES_STRUCT = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be extracted +# and appear in the documentation as a namespace called 'anonymous_namespace{file}', +# where file will be replaced with the base name of the file that contains the anonymous +# namespace. By default anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = YES + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = YES + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../../../winpcap/dox/libpcap/incs/pcap.h \ + ../../../winpcap/dox/libpcap/funcs/pcap.h \ + ../../../winpcap/wpcap/Win32-Extensions/Win32-Extensions.h \ + ../main.txt \ + ../wpcap_tut.txt \ + ../wpcap_tut1.txt \ + ../wpcap_tut2.txt \ + ../wpcap_tut3.txt \ + ../wpcap_tut4.txt \ + ../wpcap_tut5.txt \ + ../wpcap_tut6.txt \ + ../wpcap_tut7.txt \ + ../wpcap_tut8.txt \ + ../wpcap_tut9.txt \ + ../doxygen_groups.txt \ + ../../../winpcap/dox/wpcap_remote.htm \ + ../../../winpcap/wpcap/libpcap/pcap-remote.h \ + ../../../winpcap/wpcap/libpcap/remote-ext.h \ + ../../../winpcap/wpcap/libpcap/rpcapd/fileconf.h \ + ../../../winpcap/wpcap/libpcap/rpcapd/utils.h \ + ../../../winpcap/wpcap/libpcap/rpcapd/daemon.h \ + ../../../winpcap/wpcap/libpcap/rpcapd/rpcapd.h \ + ../../../winpcap/wpcap/libpcap/rpcapd/win32-svc.h \ + ../../wpcap/pcap_oem.c + +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = *.cpp \ + *.c \ + *.h \ + *.txt \ + *.htm + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = test + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = ../../Examples/ \ + ../../../WinPcap/dox/ \ + ../ + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = ../../../Winpcap/dox/pics/ \ + ../pics/ + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH +# then you must also enable this option. If you don't then doxygen will produce +# a warning and turn it on anyway + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = docs + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = ../header.htm + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = ../footer.htm + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = ../style.css + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = YES + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = WIN32 \ + _DEBUG_TO_FILE \ + EXPAND_AS_DEFINED \ + EXPAND_AS_DEFINED \ + = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = gif + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the number +# of direct children of the root node in a graph is already larger than +# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/winpcap_oem/dox/style.css b/winpcap_oem/dox/style.css new file mode 100644 index 00000000..0094c621 --- /dev/null +++ b/winpcap_oem/dox/style.css @@ -0,0 +1,358 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Verdana,Arial,Helvetica; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 190%; +} +H2 { + font-size: 150%; +} +H3 { + font-size: 120%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; + white-space: nowrap; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { font-size: 9pt; font-weight: bold; } +.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } +.directory > h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } diff --git a/winpcap_oem/dox/wpcap_samp.htm b/winpcap_oem/dox/wpcap_samp.htm new file mode 100644 index 00000000..1cf88763 --- /dev/null +++ b/winpcap_oem/dox/wpcap_samp.htm @@ -0,0 +1,110 @@ + + + + + + + + + + +

Creating an application that uses WinPcap Professional

+

To create an application that uses wpcap.dll with Microsoft Visual C++, +follow these +steps:

+
    +
  • Include the file pcap.h at the beginning of every source file that + uses the functions exported by library.
  • +
  • If your program uses the remote extensions (pcap_findalldevs_ex() is among the remote extensions), + remember to add HAVE_REMOTE among your preprocessor definitions.
  • Set the options of the linker to include the wpcap.lib library + file specific for your target (x86 or x64). wpcap.lib for x86 can + be found in the \lib\x86 folder of the WinPcap Professional developer's + pack, wpcap.lib for x64 can + be found in the \lib\x64 folder.
  • Set the options of the linker to include the winsock library file (for + example wsock32.lib). This file is distributed with the C compiler + and contains the socket functions for Windows. It is needed by some libpcap + functions.
  • +
  • Initialize WinPcap Professional before calling *any* pcap function by calling + pcap_start_oem. Here is + some sample code you may use:
  • +
    char errbuf[PCAP_ERRBUF_SIZE];
    + ...
    + if (pcap_start_oem(errbuf, 0) == -1)
    + {
    +    printf("Error initializing WinPcap Professional: %s\n", errbuf);
    +    exit(1);
    + }
    +  
  • Place the WinPcap Professional DLLs available in the \bin folder of the + developer's pack into the working directory of your application. The DLLs + for x86 are available in the \bin\x86 folder, the ones for x64 are available + in the \lib\x64 folder.
    + IMPORTANT NOTE: in order to avoid conflicts with any existing + installation of WinPcap, you should avoid putting the WinPcap Professional DLLs in + the system folder (usually c:\windows\system32) or generally in a folder on + your PATH.
  • +
+

How to properly set Microsoft Visual Studio
+
+
Visual Studio 6

+
    +
  • To add a preprocessor definition, you must select Settings from the Project menu, then select C/C++ + from the tab control, and under the category General, you must add + the definition under the Preprocessor Definitions text box. +
  • To add a new library to the project with Microsoft Visual C++, you must + select Settings from the Project menu, then select Link + from the tab control, and then add the name of the new library in the Object/library + modules editbox. +
  • To add a new path where Microsoft Visual C++ will look for the libraries, + you must select Options from the Tools menu, then + Directories + from the tab control, Library files from the Show directories + for combobox, and the add the path in the Directories box. +
  • To add a new path where Microsoft Visual C++ will look for include files, you must select Options from the Tools menu, then + Directories + from the tab control, Include files from the Show directories + for combobox, and the add the path in the Directories box.
  • +
+

Visual Studio 2005 (needed to compile x64 applications)

+
    +
  • To add a preprocessor definition, you must select Properties from the Project menu, then select C/C++ + from the list control on the left, and under the category Preprocessor, you must add + the definition under the Preprocessor Definitions text box. +
  • To add a new library to the project, you must + select Properties from the Project menu, then select Linker + from the list control on the left, and under the category Input add the name of the new library in the + Additional Dependencies text box.
  • To add a new path where Microsoft Visual + Studio will look for the libraries, + you must select Options from the Tools menu, then + Project and Solutions from the list control on the left, VC++ + Directories, then choose Library Files in the Show directories + for combobox, and the add the path in the box below. +
  • To add a new path where Microsoft Visual + Studio will look for the include files, + you must select Options from the Tools menu, then + Project and Solutions from the list control on the left, VC++ + Directories, then choose Include Files in the Show directories + for combobox, and the add the path in the box below. +
+

 

+

Deploying WinPcap Professional in your application installation

+

Installing WinPcap Professional with your application is extremely easy: you should +just copy the DLLs available in the \bin folder of the developer's pack (i.e. +packet.dll and wpcap.dll) into the working directory of your application. Be +sure to copy the DLLs matching the architecture of your application, x86 or  +x64.

+

IMPORTANT NOTE: in order to avoid conflicts with any existing installation of +WinPcap, you should avoid putting the WinPcap Professional DLLs in the system folder +(usually c:\windows\system32) or generally in a folder on your PATH.

+

Sample programs

+

A couple of sample programs are provided to show the usage of the WinPcap API. The +source of the examples, along with all the files needed to compile and run them, can be found in the Developer's +Pack of WinPcap Professional. For didactic purpose we provide here a browsable version of +the code: it is possible to click on the variables and functions to jump the +documentation of each of them. For a more complete set of samples, please refer +to the WinPcap Professional +Tutorial Section.

+ + + + \ No newline at end of file diff --git a/winpcap_oem/dox/wpcap_samp1.htm b/winpcap_oem/dox/wpcap_samp1.htm new file mode 100644 index 00000000..8d31e217 --- /dev/null +++ b/winpcap_oem/dox/wpcap_samp1.htm @@ -0,0 +1,21 @@ + + + + + + + + + + + +

Packet Dump

+

This program reads packets from a file or a network adapter, depending on +a command line switch. If a source is not provided, the program shows a list of +available adapters, one of which can be selected. Once the +capture is started, the program prints the timestamp, the length and the raw +contents of the packets. Once compiled, it will run on all the Win32 platforms.

+ + + + diff --git a/winpcap_oem/dox/wpcap_samp2.htm b/winpcap_oem/dox/wpcap_samp2.htm new file mode 100644 index 00000000..49dd9297 --- /dev/null +++ b/winpcap_oem/dox/wpcap_samp2.htm @@ -0,0 +1,28 @@ + + + + + + + + + + + +

Packet Filter

+ +

This is a more complete example of libpcap usage. It shows, among other +things, how to create and set filters and how to save a capture to disk. It can +be compiled under. Pcap_filter (pf.exe) is a general-purpose packet filtering application: its +input parameters are a source of packets (it can be a physical interface or a +file), a filter and an output file. It takes packets from the source until +CTRL+C is pressed or the whole file is processed, applies the filter to the +incoming packets and saves them to the output file if they satisfy the filter. +Pcap_filter can be used to dump network data according to a particular filter, +but also to extract a set of packets from a previously saved file. The format of +both input and output files is the format used by libpcap, i.e. same of WinDump, tcpdump +and many other network tools.

+ + + + diff --git a/winpcap_oem/dox/wpcap_tut.txt b/winpcap_oem/dox/wpcap_tut.txt new file mode 100644 index 00000000..774e54a8 --- /dev/null +++ b/winpcap_oem/dox/wpcap_tut.txt @@ -0,0 +1,17 @@ +/** @ingroup wpcap + */ + + +/** @defgroup wpcap_tut WinPcap Professional tutorial: a step by step guide to using WinPcap + * @{ + + +This section shows how to use the features of the WinPcap API. It is organized as a tutorial, subdivided into a set of lessons that will introduce the reader, in a step-by-step fashion, to program development using WinPcap, from the basic functions (obtaining the adapter list, starting a capture, etc.) to the most advanced ones (handling send queues and gathering statistics about network traffic). + +Several code snippets, as well as simple but complete programs are provided as a reference: all of the source code contains links to the rest of the manual, making it is possible to click on functions and data structures to jump to the corresponding documentation. + +The samples are written in plain C, so a basic knowledge of C programming is required. Also, since this is a tutorial about a library dealing with "raw" networking packets, good knowledge of networks and network protocols is assumed. + +\ref wpcap_tut1 "Next >>>" + +@}*/ diff --git a/winpcap_oem/dox/wpcap_tut1.txt b/winpcap_oem/dox/wpcap_tut1.txt new file mode 100644 index 00000000..b9049a3b --- /dev/null +++ b/winpcap_oem/dox/wpcap_tut1.txt @@ -0,0 +1,83 @@ +/** @ingroup wpcap_tut + */ + + +/** @defgroup wpcap_tut1 Obtaining the device list + * @{ + +Typically, the first thing that a WinPcap-based application does is get a list of attached network adapters. Both libpcap and WinPcap provide the pcap_findalldevs_ex() function for this purpose: this function returns a linked list of pcap_if structures, each of which contains comprehensive information about an attached adapter. In particular, the fields \e name and \e description contain the name and a human readable description, respectively, of the corresponding device. + +The following code retrieves the adapter list and shows it on the screen, printing an error if no adapters are found. + +\code +#include "pcap.h" + +main() +{ + pcap_if_t *alldevs; + pcap_if_t *d; + int i=0; + char errbuf[PCAP_ERRBUF_SIZE]; + + /* start WinPcap Professional */ + if (pcap_start_oem(errbuf, 0) == -1) + { + fprintf(stderr, "Error starting WinPcap Professional: %s\n", errbuf); + exit(1); + } + + /* Retrieve the device list from the local machine */ + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL /* auth is not needed */, &alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d= alldevs; d != NULL; d= d->next) + { + printf("%d. %s", ++i, d->name); + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if (i == 0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return; + } + + /* We don't need any more the device list. Free it */ + pcap_freealldevs(alldevs); +} +\endcode + +Some comments about this code. + +First of all, \ref pcap_findalldevs_ex() and \ref pcap_start_oem(), like other libpcap functions, have an \e errbuf parameter. This parameter points to a string filled by libpcap with a description of the error if something goes wrong. + +Second, remember that not all the OSes supported by libpcap provide a description of the network interfaces, therefore if we want to write a portable application, we must consider the case in which \e description is null: we print the string "No description available" in that situation. + +Note finally that we free the list with pcap_freealldevs() once when we have finished with it. + +Let's try to compile and run the code of this first sample. In order to compile it on Windows, you will need to create a project, +following the instructions in the section \ref wpcapsamps of this manual. +However, we suggest that you use the WinPcap Professional developer's pack, since it provides many examples already configured as projects +including all the code presented in this tutorial and the \e includes and \e libraries needed to compile and run the examples. + +\note if you create your own project, remember to add the preprocessor directives WPCAP and HAVE_REMOTE in order to compile and link this example. + +Assuming we have compiled the program, let's try to run it. On a particular WinXP workstation, the result we optained is + +
+   1. \\Device\\NPF_{4E273621-5161-46C8-895A-48D0E52A0B83} (Realtek RTL8029(AS) Ethernet Adapter)
+   2. \\Device\\NPF_{5D24AE04-C486-4A96-83FB-8B5EC6C7F430} (3Com EtherLink PCI) 
+
+ +As you can see, the name of the network adapters (that will be passed to libpcap when opening the devices) under Windows are quite unreadable, so the parenthetical descriptions can be very helpful. + +\ref wpcap_tut "<<< Previous" \ref wpcap_tut2 "Next >>>" + +@}*/ diff --git a/winpcap_oem/dox/wpcap_tut2.txt b/winpcap_oem/dox/wpcap_tut2.txt new file mode 100644 index 00000000..8c2a38d6 --- /dev/null +++ b/winpcap_oem/dox/wpcap_tut2.txt @@ -0,0 +1,21 @@ +/** @ingroup wpcap_tut + */ + +/** @defgroup wpcap_tut2 Obtaining advanced information about installed devices + * @{ + +Lesson 1 (\ref wpcap_tut1) demonstrated how to get basic information (i.e. device name and description) about available adapters. Actually, WinPcap provides also other advanced information. In particular, every pcap_if structure returned by pcap_findalldevs_ex() contains also a list of pcap_addr structures, with: +- a list of addresses for that interface. +- a list of netmasks (each of which corresponds to an entry in the addresses list). +- a list of broadcast addresses (each of which corresponds to an entry in the addresses list). +- a list of destination addresses (each of which corresponds to an entry in the addresses list). + +Additionally, pcap_findalldevs_ex() can also return remote adapters and a list of pcap files that are located in a given local folder. + +The following sample provides an ifprint() function that prints the complete contents of a pcap_if structure. It is invoked by the program for every entry returned by pcap_findalldevs_ex(). + +\include iflist/iflist.c + +\ref wpcap_tut1 "<<< Previous" \ref wpcap_tut3 "Next >>>" + +@}*/ diff --git a/winpcap_oem/dox/wpcap_tut3.txt b/winpcap_oem/dox/wpcap_tut3.txt new file mode 100644 index 00000000..1b32d593 --- /dev/null +++ b/winpcap_oem/dox/wpcap_tut3.txt @@ -0,0 +1,31 @@ +/** @ingroup wpcap_tut + */ + + +/** @defgroup wpcap_tut3 Opening an adapter and capturing the packets + * @{ + +Now that we've seen how to obtain an adapter to play with, let's start the real job, opening an adapter and capturing some traffic. In this lesson we'll write a program that prints some information about each packet flowing through the adapter. + +The function that opens a capture device is pcap_open(). The parameters, \e snaplen, \e flags and \e to_ms deserve some explanation. + +\e snaplen specifies the portion of the packet to capture. On some OSes (like xBSD and Win32), the packet driver can be configured to capture only the initial part of any packet: this decreases the amount of data to copy to the application and therefore improves the efficiency of the capture. In this case we use the value 65536 which is higher than the greatest MTU that we could encounter. In this manner we ensure that the application will always receive the whole packet. + +\e flags: the most important flag is the one that indicates if the adapter will be put in promiscuous mode. In normal operation, an adapter only captures packets from the network that are destined to it; the packets exchanged by other hosts are therefore ignored. Instead, when the adapter is in promiscuous mode it captures all packets whether they are destined to it or not. This means that on shared media (like non-switched Ethernet), WinPcap will be able to capture the packets of other hosts. Promiscuous mode is the default for most capture applications, so we enable it in the following example. + +\e to_ms specifies the read timeout, in milliseconds. A read on the adapter (for example, with pcap_dispatch() or pcap_next_ex()) will always return after \e to_ms milliseconds, even if no packets are available from the network. \e to_ms also defines the interval between statistical reports if the adapter is in statistical mode (see the lesson "\ref wpcap_tut9" for information about statistical mode). Setting \e to_ms to 0 means no timeout, a read on the adapter never returns if no packets arrive. A -1 timeout on the other side causes a read on the adapter to always return immediately. + + +\include misc/basic_dump.c + +Once the adapter is opened, the capture can be started with pcap_dispatch() or pcap_loop(). These two functions are very similar, the difference is that pcap_ dispatch() returns (although not guaranteed) when the timeout expires while pcap_loop() doesn't return until \e cnt packets have been captured, so it can block for an arbitrary period on an under-utilized network. pcap_loop() is enough for the purpose of this sample, while pcap_dispatch() is normally used in a more complex program. + +Both of these functions have a \e callback parameter, \e packet_handler, pointing to a function that will receive the packets. This function is invoked by libpcap for every new packet coming from the network and receives a generic status (corresponding to the \e user parameter of pcap_loop() and pcap_dispatch()), a header with some information on the packet like the timestamp and the length and the actual data of the packet including all the protocol headers. Note that the frame CRC is normally not present, because it is removed by the network adapter after frame validation. Note also that most adapters discard packets with wrong CRCs, therefore WinPcap is normally not able to capture them. + +The above example extracts the timestamp and the length of every packet from the pcap_pkthdr header and prints them on the screen. + +Please note that there may be a drawback using pcap_loop() mainly related to the fact that the handler is called by the packet capture driver; therefore the user application does not have direct control over it. Another approach (and to have more readable programs) is to use the pcap_next_ex() function, which is presented in the next example (\ref wpcap_tut4). + +\ref wpcap_tut2 "<<< Previous" \ref wpcap_tut4 "Next >>>" + +@}*/ diff --git a/winpcap_oem/dox/wpcap_tut4.txt b/winpcap_oem/dox/wpcap_tut4.txt new file mode 100644 index 00000000..ccbc4e5e --- /dev/null +++ b/winpcap_oem/dox/wpcap_tut4.txt @@ -0,0 +1,27 @@ +/** @ingroup wpcap_tut + */ + + +/** @defgroup wpcap_tut4 Capturing the packets without the callback + * @{ + +The example program in this lesson behaves exactly like the previous program (\ref wpcap_tut3), but it uses pcap_next_ex() instead of pcap_loop(). + +The callback-based capture mechanism of pcap_loop() is elegant and it could be a good choice in some situations. However, handling a callback is sometimes not practical -- it often makes the program more complex especially in situations with multithreaded applications or C++ classes. + +In these cases, pcap_next_ex() retrievs a packet with a direct call -- using pcap_next_ex() packets are received only when the programmer wants them. + +The parameters of this function are the same as a capture callback -- it takes an adapter descriptor and a couple of pointers that will be initialized and returned to the user (one to a pcap_pkthdr structure and another to a buffer with the packet data). + +In the following program, we recycle the callback code of the previous lesson's example and move it inside main() right after the call to pcap_next_ex(). + + +\include misc/basic_dump_ex.c + +Why do we use pcap_next_ex() instead of the old pcap_next()? Because pcap_next() has some drawbacks. First of all, it is inefficient because it hides the callback method but still relies on pcap_dispatch(). Second, it is not able to detect EOF, so it's not very useful when gathering packets from a file. + +Notice also that pcap_next_ex() returns different values for success, timeout elapsed, error and EOF conditions. + +\ref wpcap_tut3 "<<< Previous" \ref wpcap_tut5 "Next >>>" + +@}*/ diff --git a/winpcap_oem/dox/wpcap_tut5.txt b/winpcap_oem/dox/wpcap_tut5.txt new file mode 100644 index 00000000..feddf3fd --- /dev/null +++ b/winpcap_oem/dox/wpcap_tut5.txt @@ -0,0 +1,50 @@ +/** @ingroup wpcap_tut + */ + + +/** @defgroup wpcap_tut5 Filtering the traffic + * @{ + +One of the most powerful features offered by WinPcap (and by libpcap as well) is the filtering engine. It provides a very efficient way to receive subsets of the network traffic, and is (usually) integrated with the capture mechanism provided by WinPcap. The functions used to filter packets are pcap_compile() and pcap_setfilter(). + +pcap_compile() takes a string containing a high-level Boolean (filter) expression and produces a low-level byte code that can be interpreted by the fileter engine in the packet driver. The syntax of the boolean expression can be found in the \ref language section of this documentation. + +pcap_setfilter() associates a filter with a capture session in the kernel driver. Once pcap_setfilter() is called, the associated filter will be applied to all the packets coming from the network, and all the conformant packets (i.e., packets for which the Boolean expression evaluates to true) will be actually copied to the application. + +The following code shows how to compile and set a filter. Note that we must retrieve the netmask from the pcap_if structure that describes the adapter, because some filters created by pcap_compile() require it. + +The filter passed to pcap_compile() in this code snippet is "ip and tcp", which means to "keep only the packets that are both IPv4 and TCP and deliver them to the application". + +\code + if (d->addresses != NULL) + /* Retrieve the mask of the first address of the interface */ + netmask=((struct sockaddr_in *)(d->addresses->netmask))->sin_addr.S_un.S_addr; + else + /* If the interface is without an address we suppose to be in a C class network */ + netmask=0xffffff; + + + //compile the filter + if (pcap_compile(adhandle, &fcode, "ip and tcp", 1, netmask) < 0) + { + fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + //set the filter + if (pcap_setfilter(adhandle, &fcode) < 0) + { + fprintf(stderr,"\nError setting the filter.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } +\endcode + +If you want to see some code that uses the filtering functions shown in this lesson, look at the example presented in the next Lesson, \ref wpcap_tut6. + +\ref wpcap_tut4 "<<< Previous" \ref wpcap_tut6 "Next >>>" + +@}*/ diff --git a/winpcap_oem/dox/wpcap_tut6.txt b/winpcap_oem/dox/wpcap_tut6.txt new file mode 100644 index 00000000..9c9f9705 --- /dev/null +++ b/winpcap_oem/dox/wpcap_tut6.txt @@ -0,0 +1,48 @@ +/** @ingroup wpcap_tut + */ + +/** @defgroup wpcap_tut6 Interpreting the packets + * @{ + +Now that we are able to capture and filter network traffic, we want to put our knowledge to work with a simple "real world" application. + +In this lesson we will take code from the previous lessons and use these pieces to build a more useful program. the main purpose of the current program is to show how the protocol headers of a captured packet can be parsed and interpreted. +The resulting application, called UDPdump, prints a summary of the UDP traffic on our network. + +We have chosen to parse and display the UDP protocol because it is more accessible than other protocols such as TCP and consequently is an excellent initial example. Let's look at the code: + +\include UDPdump/udpdump.c + +First of all, we set the filter to "ip and udp". In this way we are sure that packet_handler() will receive only UDP packets over IPv4: this simplifies the parsing and increases the efficiency of the program. + +We have also created a couple of structs that describe the IP and UDP headers. These structs are used by packet_handler() to properly locate the various header fields. + +packet_handler(), although limited to a single protocol dissector (UDP over IPv4), shows how complex "sniffers" like tcpdump/WinDump decode the network traffic. Since we aren't interested in the MAC header, we skip it. +For simplicity and before starting the capture, we check the MAC layer with pcap_datalink() to make sure that +we are dealing with an Ethernet network. This way we can be sure that the MAC header is exactly 14 bytes. + +The IP header is located just after the MAC header. We will extract the IP source and destination addresses from the +IP header. + +Reaching the UDP header is a bit more complicated, because the IP header doesn't have a fixed length. +Therefore, we use the IP header's length field to know its size. +Once we know the location of the UDP header, we extract the source and destination ports. + +The extracted values are printed on the screen, and the result is something like: + + +1. \\Device\\Packet_{A7FD048A-5D4B-478E-B3C1-34401AC3B72F} (Xircom +t 10/100 Adapter) \n +Enter the interface number (1-2):1\n + +listening on Xircom CardBus Ethernet 10/100 Adapter... \n +16:13:15.312784 len:87 130.192.31.67.2682 -> 130.192.3.21.53 \n +16:13:15.314796 len:137 130.192.3.21.53 -> 130.192.31.67.2682 \n +16:13:15.322101 len:78 130.192.31.67.2683 -> 130.192.3.21.53 \n + + +Each of the final 3 lines represents a different packet. + +\ref wpcap_tut5 "<<< Previous" \ref wpcap_tut7 "Next >>>" + +@}*/ diff --git a/winpcap_oem/dox/wpcap_tut7.txt b/winpcap_oem/dox/wpcap_tut7.txt new file mode 100644 index 00000000..d949f9e8 --- /dev/null +++ b/winpcap_oem/dox/wpcap_tut7.txt @@ -0,0 +1,67 @@ +/** @ingroup wpcap_tut + */ + +/** @defgroup wpcap_tut7 Handling offline dump files + * @{ + +In this lession we are going to learn how to handle packet capture to a file (dump to file). +WinPcap offers a wide range of functions to save the network traffic to a file and to read the content of dumps -- this lesson will teach how to use all of these functions. We'll see also how to use the kernel dump feature of WinPcap to obtain high-performance dumps +(NOTE: At the moment, due to some problems with the new kernel buffer, this feature has been disabled). + +The format for dump files is the libpcap one. This format contains the data of the captured packets in binary form and is a standard used by many network tools including WinDump, Ethereal and Snort. + +Saving packets to a dump file + +First of all, let's see how to write packets in libpcap format. + +The following example captures the packets from the selected interface and saves them on a file +whose name is provided by the user. + +\include misc\savedump.c + +As you can see, the structure of the program is very similar to the ones we have seen in the previous lessons. +The differences are: +- a call to pcap_dump_open() is issued once the interface is opened. This call opens a dump file and associates it with the interface. +- the packets are written to this file with a pcap_dump() from the packet_handler() callback. The parameters of +pcap_dump() are in 1-1 correspondence with the parameters of pcap_handler(). + +Reading packets from a dump file + +Now that we have a dump file available, we can try to read its content. +The following code opens a WinPcap/libpcap dump file and displays every packet contained in the file. +The file is opened with pcap_open_offline(), then the usual pcap_loop() is used to sequence through the packets. +As you can see, reading packets from an offline capture is nearly identical to receiving them from a physical interface. + +This example introduces another function: pcap_createsrcsrc(). +This function is required to create a source string that begins with a marker used to tell WinPcap the type of the source, +e.g. "rpcap://" if we are going to open an adapter, or "file://" if we are going to open a file. +This step is not required when pcap_findalldevs_ex() is used (the returned values already contain these strings). +However, it is required in this example because the name of the file is read from the user input. + +\include misc\readfile.c + +The following example has the same purpose of the last one, but pcap_next_ex() is used instead of the pcap_loop() callback method. + +\include misc\readfile_ex.c + +Writing packets to a dump file with pcap_live_dump + +NOTE: At the moment, due to some problems with the new kernel buffer, this feature has been disabled. + +Recent versions of WinPcap provide a further way to save network traffic to disk, the pcap_live_dump() function. pcap_live_dump() takes three parameters: a file name, the maximum size (in bytes) that this file is allowed to reach and the maximum amount of packets that the file is allowed to contain. Zero means no limit for both these values. Notice that the program can set a filter (with pcap_setfilter(), see the tutorial \ref wpcap_tut5) before calling pcap_live_dump() to define the subset of the traffic that will be saved. + +pcap_live_dump() is non-blocking, therefore it starts the dump and returns immediately: The dump process goes on asynchronously until the maximum file size or the maximum amount of packets has been reached. + +The application can wait or check the end of the dump with pcap_live_dump_ended(). +\b Beware that if the \e sync parameter is nonzero, this function will block your application forever if the limits are both 0. + +\include kdump\kdump.c + +The difference between pcap_live_dump() and pcap_dump(), apart from the possibility to set limits, is performance. pcap_live_dump() exploits the ability of the WinPcap NPF driver to write dumps from kernel level, minimizing the number of context switches and memory copies. + +Obviously, since this feature is currently not available on other operating systems, +pcap_live_dump() is WinPcap specific and is present only under Win32. + +\ref wpcap_tut6 "<<< Previous" \ref wpcap_tut8 "Next >>>" + +@}*/ diff --git a/winpcap_oem/dox/wpcap_tut8.txt b/winpcap_oem/dox/wpcap_tut8.txt new file mode 100644 index 00000000..6a81f9e9 --- /dev/null +++ b/winpcap_oem/dox/wpcap_tut8.txt @@ -0,0 +1,59 @@ +/** @ingroup wpcap_tut + */ + +/** @defgroup wpcap_tut8 Sending Packets + * @{ + +Although the name \e WinPcap indicates clearly that the purpose of the library is packet capture, other useful features for raw networking are provided. Among them, the user can find a complete set of functions to send packets. + +Note that the original libpcap library at the moment doesn't provide any way to send packets, therefore all the functions shown here are WinPcap extensions and will not work under Unix. + +Sending a single packet with pcap_sendpacket() + +The simplest way to send a packet is shown in the following code snippet. After opening an adapter, pcap_sendpacket() is called to send a hand-crafted packet. +pcap_sendpacket() takes as arguments a buffer containing the data to send, the length of the buffer +and the adapter that will send it. +Notice that the buffer is sent to the net as is, without any manipulation. This means that the application has to create the correct protocol headers in order to send something meaningful. + +\include misc/sendpack.c + +Send queues + +While pcap_sendpacket() offers a simple and immediate way to send a single packet, send queues provides an advanced, powerful and optimized mechanism to send a collection of packets. +A send queue is a container for a variable number of packets that will be sent to the network. +It has a size, that represents the maximum amount of bytes it can store. + +A send queue is created calling the pcap_sendqueue_alloc() function, specifying the size of the new send queue. + +Once the send queue is created, pcap_sendqueue_queue() can be used to add a packet to the send queue. +This function takes a pcap_pkthdr with the timestamp and the length and a buffer with the data of the packet. +These parameters are the same as those received by pcap_next_ex() and pcap_handler(), therefore queuing a packet that was +just captured or read from a file is a matter of passing these parameters to pcap_sendqueue_queue(). + +To transmit a send queue, WinPcap provides the pcap_sendqueue_transmit() function. +Note the third parameter: if nonzero, the send will be \e synchronized, +i.e. the relative timestamps of the packets will be respected. +This operation requires a remarkable amount of CPU, because the synchronization takes place in the +kernel driver using "busy wait" loops. Although this operation is quite CPU intensive, +it often results in very high precision +packet transmissions (often around few microseconds or less). + +Note that transmitting a send queue with pcap_sendqueue_transmit() is much more efficient than performing a series of pcap_sendpacket(), because the send queue is buffered at kernel level drastically decreasing the number of context switches. + +When a queue is no longer needed, +it can be deleted with pcap_sendqueue_destroy() that frees all the buffers associated with the send queue. + +The next program shows how to use send queues. +It opens a capture file with pcap_open_offline(), +then it moves the packets from the file to a properly allocated send queue. +At his point it transmits the queue, synchronizing it if requested by the user. + +Note that the link-layer of the dumpfile is compared with the one of the interface that will send the packets using pcap_datalink(), and a warning is printed if they are different -- it is important that the capture-file link-layer be the +same as the adapter's link layer for otherwise the tranmission is pointless. + +\include sendcap/sendcap.c + +\ref wpcap_tut7 "<<< Previous" \ref wpcap_tut9 "Next >>>" + + +@}*/ diff --git a/winpcap_oem/dox/wpcap_tut9.txt b/winpcap_oem/dox/wpcap_tut9.txt new file mode 100644 index 00000000..009f69d9 --- /dev/null +++ b/winpcap_oem/dox/wpcap_tut9.txt @@ -0,0 +1,52 @@ +/** @ingroup wpcap_tut + */ + +/** @defgroup wpcap_tut9 Gathering Statistics on the network traffic + * @{ + +This lesson shows another advanced feature of WinPcap: the ability to collect statistics about network traffic. The statistical engine makes use of the kernel-level packet filter to efficiently classify the incoming packet. +You can take a look at the \ref NPF if you want to know more details. + +In order to use this feature, the programmer must open an adapter and put it in \e statistical \e mode. +This can be done with pcap_setmode(). In particular, MODE_STAT must be used as the \e mode argument of this function. + +With statistical mode, making an application that monitors the TCP traffic load is a matter of few lines of code. +The following sample shows how to do it. + +\include tcptop/tcptop.c + +Before enabling statistical mode, the user has the option to set a filter that defines the subset of network traffic that will be monitored. See the paragraph on the \ref language for details. +If no filter has been set, all of the traffic will be monitored. + +Once + +- the filter is set +- pcap_setmode() is called +- callback invocation is enabled with pcap_loop() + +the interface descriptor starts to work in statistical mode. +Notice the fourth parameter (\e to_ms) of pcap_open(): it defines the interval among the statistical samples. +The callback function receives the samples calculated by the driver every \e to_ms milliseconds. These samples are encapsulated in the second and third parameters of the callback function, as shown in the following figure: + +\image html stats_wpcap.gif + + +Two 64-bit counters are provided: the number of packets and the amount of bytes received during the last interval. + +In the example, the adapter is opened with a timeout of 1000 ms. +This means that dispatcher_handler() is called once per second. +At this point a filter that keeps only tcp packets is compiled and set. +Then pcap_setmode() and pcap_loop() are called. +Note that a struct timeval pointer is passed to pcap_loop() as the \e user parameter. +This structure will be used to store a timestamp in order to calculate the interval between two samples. +dispatcher_handler()uses this interval to obtain the bits per second and the +packets per second and then prints these values on the screen. + +Note finally that this example is by far more efficient than a program that captures the packets in the traditional way and calculates statistics at user-level. +Statistical mode requires the minumum amount of data copies and context switches and therefore the CPU is optimized. Moreover, a very small amount of memory is required. + +\ref wpcap_tut8 "<<< Previous" + +@}*/ + + diff --git a/winpcap_oem/packetNtx/CompileDriver.bat b/winpcap_oem/packetNtx/CompileDriver.bat new file mode 100644 index 00000000..023488a9 --- /dev/null +++ b/winpcap_oem/packetNtx/CompileDriver.bat @@ -0,0 +1,142 @@ +@echo off + + +if "%_BUILDARCH%"=="x86" goto x86_build +if "%_BUILDARCH%"=="AMD64" goto amd64_build +if "%_BUILDARCH%"=="IA64" goto ia64_build +if "%_BUILDARCH%"=="" goto nt4_build + +echo ****************************************************** +echo ERROR: unknown build architecture (%_BUILDARCH%) +echo ****************************************************** + +goto end + +:x86_build + +echo ****************************************************** +echo * Compiling the driver for Windows NT5.x 32 bit * +echo ****************************************************** + +mkdir .\driver\bin 2> nul +mkdir .\driver\bin\2k 2> nul + +copy driver\NPF.RC ..\..\winpcap\packetntx\driver\NPF.RC + +//set TARGETPATH=..\..\..\winpcap_oem\PacketNtx\driver\bin\2k +set NPF_C_DEFINES=-DNDIS50 -DWPCAP_OEM +rem ** enable the following line to enable the TME extensions ** +rem set NPF_TME_FILES=tme.c count_packets.c tcp_session.c functions.c bucket_lookup.c normal_lookup.c win_bpf_filter_init.c +rem set NPF_C_DEFINES=%NPF_C_DEFINES% -DHAVE_BUGGY_TME_SUPPORT + +set NPF_JIT_FILES=jitter.c + +pushd ..\..\winpcap\packetntx\driver + +prefast build -cefw + +popd + +set TARGETPATH= +set NPF_C_DEFINES= +set NPF_TME_FILES= +set NPF_JIT_FILES= + +goto end + +:amd64_build + +echo ******************************************************* +echo * Compiling the driver for Windows NT5.x x64 (AMD64) * +echo ******************************************************* + +mkdir driver\bin 2> nul +mkdir driver\bin\xp 2> nul + +copy driver\NPF.RC ..\..\winpcap\packetntx\driver\NPF.RC + +set TARGETPATH=..\..\..\winpcap_oem\PacketNtx\driver\bin\xp +set NPF_C_DEFINES=-DNDIS50 -DWPCAP_OEM + +rem +rem The TME extensions and the JIT is not supported on x64, at the moment +rem +set NPF_TME_FILES= +set NPF_JIT_FILES= + +pushd ..\..\winpcap\packetntx\driver + +build -cefw + +popd + +set TARGETPATH= +set NPF_C_DEFINES= +set NPF_TME_FILES= +set NPF_JIT_FILES= + +goto end + +:ia64_build + +echo ******************************************************* +echo * Compiling the driver for Windows NT5.x IA64 * +echo ******************************************************* + +echo .. +echo ERROR: IA64 is not supported by WinPcap. +echo .. + +goto end + +:nt4_build + +echo ******************************************************* +echo * Compiling the driver for Windows NT4 * +echo * * +echo * NOTE: the script didn't detect the actual BUILD env * +echo * so it assumed NT4 DDK. * +echo ******************************************************* + +mkdir .\driver\bin 2> nul +mkdir .\driver\bin\NT4 2> nul +mkdir .\driver\bin\NT4\i386 2> nul +mkdir .\driver\bin\NT4\i386\free 2> nul +mkdir .\driver\bin\NT4\i386\checked 2> nul + +copy driver\NPF.RC ..\..\winpcap\packetntx\driver\NPF.RC + +set NPF_C_DEFINES=-DNDIS30 -D__NPF_NT4__ -DWPCAP_OEM + +rem ** enable the following line to enable the TME extensions ** +rem set NPF_TME_FILES=tme.c count_packets.c tcp_session.c functions.c bucket_lookup.c normal_lookup.c win_bpf_filter_init.c +rem set NPF_C_DEFINES=%NPF_C_DEFINES% -DHAVE_BUGGY_TME_SUPPORT + +set NPF_JIT_FILES=jitter.c + +if NOT "%NPF_COMPILED%" == "1" ( + set Include=%BASEDIR%\src\network\inc;%BASEDIR%\inc;%Include% + set NPF_COMPILED=1 + ) + +pushd ..\..\winpcap\packetntx\driver + +mkdir .\bin 2> nul +mkdir .\bin\i386 2> nul +mkdir .\bin\i386\free 2> nul +mkdir .\bin\i386\checked 2> nul + +build -cefw + +popd + +xcopy /s /e /v ..\..\winpcap\packetntx\driver\bin\i386\* .\driver\bin\NT4\i386\ + +set TARGETPATH= +set NPF_C_DEFINES= +set NPF_TME_FILES= +set NPF_JIT_FILES= + +goto end + +:end \ No newline at end of file diff --git a/winpcap_oem/packetNtx/CompileDriverNew.bat b/winpcap_oem/packetNtx/CompileDriverNew.bat new file mode 100644 index 00000000..dfebcb22 --- /dev/null +++ b/winpcap_oem/packetNtx/CompileDriverNew.bat @@ -0,0 +1,74 @@ +@echo off + +if "%2" == "checked" ( + set __BUILD_TYPE=checked +) else ( + set __BUILD_TYPE=free +) + +if "%1"=="x86" goto x86_build +if "%1"=="AMD64" goto amd64_build + +echo ****************************************************** +echo ERROR: unknown or unspecified build architecture (%1) +echo ****************************************************** + +goto end + +:x86_build + +echo ****************************************************** +echo * Compiling the driver for Windows NT5.x 32 bit * +echo ****************************************************** + +mkdir driver\bin 2> nul +copy driver\NPF.RC ..\..\winpcap\packetntx\driver\NPF.RC + +set TARGETSUFFIX=\..\..\..\..\winpcap_oem\PacketNtx\driver\bin\2k +set NPF_C_DEFINES=-DNDIS50 -DWPCAP_OEM + +rem ** enable the following line to enable the TME extensions ** +rem set NPF_TME_FILES=tme.c count_packets.c tcp_session.c functions.c bucket_lookup.c normal_lookup.c win_bpf_filter_init.c +rem set NPF_C_DEFINES=%NPF_C_DEFINES% -DHAVE_BUGGY_TME_SUPPORT + +ddkbuild -WLHXP -prefast %__BUILD_TYPE% ..\..\winpcap\packetntx\driver -cefw + +rem ** enable the following line to enable the TME extensions ** +rem set NPF_TME_FILES= +rem set NPF_JIT_FILES= +set NPF_C_DEFINES= +set TARGETSUFFIX= + +goto end + +:amd64_build + +echo ******************************************************* +echo * Compiling the driver for Windows NT5.x x64 (AMD64) * +echo ******************************************************* + +mkdir driver\bin 2> nul +mkdir driver\bin\xp 2> nul + +copy driver\NPF.RC ..\..\winpcap\packetntx\driver\NPF.RC +set TARGETSUFFIX=\..\..\..\..\winpcap_oem\PacketNtx\driver\bin\xp +set NPF_C_DEFINES=-DNDIS50 -DWPCAP_OEM + +rem +rem The TME extensions and the JIT is not supported on x64, at the moment +rem +rem set NPF_TME_FILES= +rem set NPF_JIT_FILES= + +ddkbuild -WLHNETA64 -prefast %__BUILD_TYPE% ..\..\winpcap\packetntx\driver -cefw + +set NPF_C_DEFINES= +rem set NPF_TME_FILES= +rem set NPF_JIT_FILES= +set TARGETSUFFIX= + +goto end + +:end + +set __BUILD_TYPE= diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.dsp b/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.dsp new file mode 100644 index 00000000..19b2bd9b --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.dsp @@ -0,0 +1,164 @@ +# Microsoft Developer Studio Project File - Name="PacketAndWan" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=PacketAndWan - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "PacketAndWan.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "PacketAndWan.mak" CFG="PacketAndWan - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "PacketAndWan - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "PacketAndWan - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "PacketAndWan - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../../dag/include" /I "../../../dag/drv/windows" /I "../../../common" /I "..\..\driver" /D "NDEBUG" /D "HAVE_DAG_API" /D "WIN32" /D "_WINDOWS" /D "WPCAP_OEM" /FR /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Iphlpapi.lib version.lib npptools.lib /nologo /subsystem:windows /dll /machine:I386 /out:"Release/Packet.dll" + +!ELSEIF "$(CFG)" == "PacketAndWan - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../../dag/include" /I "../../../dag/drv/windows" /I "../../../common" /I "..\..\driver" /D "HAVE_DAG_API" /D "WIN32" /D "_WINDOWS" /D "WPCAP_OEM" /FR /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Iphlpapi.lib version.lib npptools.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug/Packet.dll" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none /incremental:no + +!ENDIF + +# Begin Target + +# Name "PacketAndWan - Win32 Release" +# Name "PacketAndWan - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\AdInfo.c +# End Source File +# Begin Source File + +SOURCE=..\..\driver\bucket_lookup.c +# End Source File +# Begin Source File + +SOURCE=..\..\driver\count_packets.c +# End Source File +# Begin Source File + +SOURCE=..\..\driver\functions.c +# End Source File +# Begin Source File + +SOURCE=..\..\driver\normal_lookup.c +# End Source File +# Begin Source File + +SOURCE=..\PACKET32.C +# End Source File +# Begin Source File + +SOURCE=..\..\driver\tcp_session.c +# End Source File +# Begin Source File + +SOURCE=..\..\driver\tme.c +# End Source File +# Begin Source File + +SOURCE=..\WanPacket\WanPacket.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\driver\win_bpf_filter.c +# End Source File +# Begin Source File + +SOURCE=..\..\driver\win_bpf_filter_init.c +# End Source File +# End Group +# Begin Group "Include Files" + +# PROP Default_Filter "*.h*" +# Begin Source File + +SOURCE=..\..\..\Common\Packet32.h +# End Source File +# Begin Source File + +SOURCE=..\WanPacket\WanPacket.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\WpcapNames.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\Packet.def +# End Source File +# Begin Source File + +SOURCE=..\version.rc +# End Source File +# End Target +# End Project diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.dsw b/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.dsw new file mode 100644 index 00000000..5ffbfb7b --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "PacketAndWan"=.\PacketAndWan.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.rc b/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.rc new file mode 100644 index 00000000..97a21c98 --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.rc @@ -0,0 +1,64 @@ +// Microsoft Visual C++ generated resource script. +// + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#include ""PacketAndWan.rc2""\r\n" + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include "PacketAndWan.rc2" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.rc2 b/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.rc2 new file mode 100644 index 00000000..3a8f6258 --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketAndWan.rc2 @@ -0,0 +1,46 @@ +// +// WinPcapOem.rc2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +#include "..\..\..\version.h" +#include "..\..\..\..\winpcap\common\WpcapNames.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + PRODUCTVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", WINPCAPOEM_COMPANY_NAME + VALUE "FileDescription", "packet.dll (NT5) Dynamic Link Library" + VALUE "FileVersion", WINPCAPOEM_VER_STRING + VALUE "InternalName", WINPCAPOEM_PRODUCT_NAME + VALUE "LegalCopyright", WINPCAPOEM_COPYRIGHT_STRING + VALUE "LegalTrademarks", "" + VALUE "OriginalFilename", "packet.dll" + VALUE "ProductName", WINPCAPOEM_PRODUCT_NAME " (" NPF_DRIVER_NAME ")" + VALUE "ProductVersion", WINPCAPOEM_VER_STRING + VALUE "Build Description", WINPCAPOEM_BUILD_DESCRIPTION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketNT4.rc b/winpcap_oem/packetNtx/Dll/Project/PacketNT4.rc new file mode 100644 index 00000000..0b8cff2f --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketNT4.rc @@ -0,0 +1,64 @@ +// Microsoft Visual C++ generated resource script. +// + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#include ""PacketNT4.rc2""\r\n" + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include "PacketNT4.rc2" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketNT4.rc2 b/winpcap_oem/packetNtx/Dll/Project/PacketNT4.rc2 new file mode 100644 index 00000000..50487b40 --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketNT4.rc2 @@ -0,0 +1,46 @@ +// +// WinPcapOem.rc2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +#include "..\..\..\version.h" +#include "..\..\..\..\winpcap\common\WpcapNames.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + PRODUCTVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", WINPCAPOEM_COMPANY_NAME + VALUE "FileDescription", "packet.dll (NT4) Dynamic Link Library" + VALUE "FileVersion", WINPCAPOEM_VER_STRING + VALUE "InternalName", WINPCAPOEM_PRODUCT_NAME + VALUE "LegalCopyright", WINPCAPOEM_COPYRIGHT_STRING + VALUE "LegalTrademarks", "" + VALUE "OriginalFilename", "packet.dll" + VALUE "ProductName", WINPCAPOEM_PRODUCT_NAME " (" NPF_DRIVER_NAME ")" + VALUE "ProductVersion", WINPCAPOEM_VER_STRING + VALUE "Build Description", WINPCAPOEM_BUILD_DESCRIPTION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketNT4.vcproj b/winpcap_oem/packetNtx/Dll/Project/PacketNT4.vcproj new file mode 100644 index 00000000..88d8333b --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketNT4.vcproj @@ -0,0 +1,451 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketNetMon.vcproj b/winpcap_oem/packetNtx/Dll/Project/PacketNetMon.vcproj new file mode 100644 index 00000000..f3729d8e --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketNetMon.vcproj @@ -0,0 +1,569 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketVista.rc b/winpcap_oem/packetNtx/Dll/Project/PacketVista.rc new file mode 100644 index 00000000..96ab5095 --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketVista.rc @@ -0,0 +1,64 @@ +// Microsoft Visual C++ generated resource script. +// + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#include ""PacketVista.rc2""\r\n" + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include "PacketVista.rc2" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketVista.rc2 b/winpcap_oem/packetNtx/Dll/Project/PacketVista.rc2 new file mode 100644 index 00000000..06cddda1 --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketVista.rc2 @@ -0,0 +1,46 @@ +// +// WinPcapOem.rc2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +#include "..\..\..\version.h" +#include "..\..\..\..\winpcap\common\WpcapNames.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + PRODUCTVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", WINPCAPOEM_COMPANY_NAME + VALUE "FileDescription", "packet.dll (Vista) Dynamic Link Library" + VALUE "FileVersion", WINPCAPOEM_VER_STRING + VALUE "InternalName", WINPCAPOEM_PRODUCT_NAME + VALUE "LegalCopyright", WINPCAPOEM_COPYRIGHT_STRING + VALUE "LegalTrademarks", "" + VALUE "OriginalFilename", "packet.dll" + VALUE "ProductName", WINPCAPOEM_PRODUCT_NAME " (" NPF_DRIVER_NAME ")" + VALUE "ProductVersion", WINPCAPOEM_VER_STRING + VALUE "Build Description", WINPCAPOEM_BUILD_DESCRIPTION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/winpcap_oem/packetNtx/Dll/Project/PacketVista.vcproj b/winpcap_oem/packetNtx/Dll/Project/PacketVista.vcproj new file mode 100644 index 00000000..7172fc4d --- /dev/null +++ b/winpcap_oem/packetNtx/Dll/Project/PacketVista.vcproj @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winpcap_oem/packetNtx/Driver/Driver.vcproj b/winpcap_oem/packetNtx/Driver/Driver.vcproj new file mode 100644 index 00000000..38ccfe55 --- /dev/null +++ b/winpcap_oem/packetNtx/Driver/Driver.vcproj @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winpcap_oem/packetNtx/Driver/npf.rc b/winpcap_oem/packetNtx/Driver/npf.rc new file mode 100644 index 00000000..cd34caa3 --- /dev/null +++ b/winpcap_oem/packetNtx/Driver/npf.rc @@ -0,0 +1,44 @@ +#include "..\..\..\winpcap_oem\version.h" +#include "..\..\common\WpcapNames.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + PRODUCTVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x3L + FILESUBTYPE 0x7L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", WINPCAPOEM_COMPANY_NAME +#ifdef __NPF_NT4__ + VALUE "FileDescription", "npf.sys (NT4) Kernel Driver" +#elif defined(_AMD64_) + VALUE "FileDescription", "npf.sys (NT5/6 AMD64) Kernel Driver" +#else + VALUE "FileDescription", "npf.sys (NT5/6 x86) Kernel Driver" +#endif + VALUE "FileVersion", WINPCAPOEM_VER_STRING + VALUE "InternalName", WINPCAPOEM_PRODUCT_NAME + VALUE "LegalCopyright", WINPCAPOEM_COPYRIGHT_STRING + VALUE "LegalTrademarks", "" + VALUE "OriginalFilename", "npf.sys" + VALUE "ProductName", WINPCAPOEM_PRODUCT_NAME " (" NPF_DRIVER_NAME ")" + VALUE "ProductVersion", WINPCAPOEM_VER_STRING + VALUE "Build Description", WINPCAPOEM_BUILD_DESCRIPTION + VALUE "PrivateBuild", WINPCAPOEM_PRIVATE_BUILD + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/winpcap_oem/release procedures TNT OEM.txt b/winpcap_oem/release procedures TNT OEM.txt new file mode 100644 index 00000000..caaf2080 --- /dev/null +++ b/winpcap_oem/release procedures TNT OEM.txt @@ -0,0 +1,191 @@ +$Header: /usr/cvsroot/winpcap_oem/release\040procedures\040TNT\040OEM.txt,v 1.5 2006/09/13 12:34:44 gianlucav Exp $ +WINPCAP PRO TOOLKIT RELEASE PROCEDURE +===================================== + +Needed tools +------------ +- Visual Studio .NET 2003 +- The cygnus environment on your path (needed to execute step 10 and 11). + + +Dependencies +------------ +- you need to have the Airpcap developer's pack in + %BUILD_TREE%\Airpcap_Devpack +- you need to have the NpfIm compiled sources in + %BUILD_TREE%\NpfIm + You should also have run the "NpfIm\build_dev_pack.bat" script + to have the devpacks ready + + +How to compile OEM WinPcap for the toolkit. +------------------------------------------- + +1. Download winpcap (HEAD) and winpcap_oem from the CVS into %BUILD_TREE% + +2. Modify the version info into + %BUILD_TREE%\winpcap_oem\version.h. + the version for the TNT is x.y.1.z. The variable + WINPCAPOEM_VER_STRING + should be modified adding a ".tnt" at the end of the numbers. + +3. Modify the device string into + %BUILD_TREE%\winpcap\common\wpcapnames.h (first two defines) + +4. Download the libpcap sources (usually 0_9 branch) into + %BUILD_TREE%\libpcap_ + +5. Commit %BUILD_TREE%\winpcap_oem\version.h into the CVS. This should be the + *only* modified file in this module. + +6. Tag the %BUILD_TREE%\winpcap_oem module with the tag + WINPCAP_PRO__TNT_ + +7. Tag the %BUILD_TREE%\winpcap module with the tag + WINPCAP_PRO__TNT_ + +8. Take the contents of %BUILD_TREE%\libpcap_ and copy it into + %BUILD_TREE%\winpcap\wpcap\libpcap + +9. From the command line, go to folder + %BUILD_TREE%\winpcap\wpcap\libpcap + +10. On the command line, type "patch -p1 < remote_code.patch" + +11. CD into %BUILD_TREE%\winpcap\wpcap\prj and execute + "build_scanner_parser.bat" + +12. Check that the version of libpcap in + %BUILD_TREE%\winpcap\wpcap\libpcap\pcap.c line 865 + "static const char pcap_version_string[] = "libpcap version 0.9[.x]";" + makes sense (??? WHAT DOES IT MEAN???) + +13. Check that the version of wpcap in + %BUILD_TREE%\winpcap\wpcap\libpcap\pcap.c line 875 + "static const char wpcap_version_string[] = "4.0";" + is correct. + + +14. Zip the contents of the five folders + %BUILD_TREE%\winpcap_oem + %BUILD_TREE%\winpcap + %BUILD_TREE%\libpcap_ + %BUILD_TREE%\AirPcap_Devpack + %BUILD_TREE%\NpfIm + | + V + %BUILD_TREE%\sources.zip + +15. Open a Win 2000 DDK Free build environment. Go into + %BUILD_TREE%\winpcap_oem\packetntx. + Execute "compileDriver.bat". Prefast 1.5.2402 should issue 9 warnings + (20070508). + Close the build environment. + NOTE: DO NOT EXECUTE 15. 16. and 17. at the same time, they overwrite files in + the build process that are incompatible between the two builds. + +16. Open the WinNT4 DDK Release build environment. Go into + %BUILD_TREE%\winpcap_oem\packetntx. + Execute "compileDriver.bat". Close the build + environment. + NOTE: DO NOT EXECUTE 15. 16. and 17. at the same time, they overwrite files in + the build process that are incompatible between the two builds. + +17. Open the Windows Server 2003 Free x64 build environment. Go into + %BUILD_TREE%\winpcap_oem\packetntx. + Execute "compileDriver.bat". Close the build + environment. + NOTE: DO NOT EXECUTE 15. 16. and 17. at the same time, they overwrite files in + the build process that are incompatible between the two builds. + + +SIGNED BINARIES BUILD + + 18s. Open %BUILD_TREE%\winpcap_oem\WinPcap OEM.sln with Visual Studio 2003. + Choose the "Release TNT SIGNED STEP1" configuration, and then use Build->Rebuild Solution. + No warnings should be generated. + + 19s. Sign all the binaries in + %BUILD_TREE%\winpcap_oem\OEM\WinPcapOem\Binaries_SIGNED, namely + npfnt.sys + npf2k.sys + npfx64.sys + packetnt.dll + packet2k.dll + packetVista.dll + with the company certificate + cross certificate + + The generic command is + signtool sign /v /ac MSCV-VSClass3.cer /s my /n "CACE TECHNOLOGIES, LLC" + /t http://timestamp.verisign.com/scripts/timestamp.dll + + 20s. Go back to Visual studio 2003. Choose the "Release TNT SIGNED STEP2" configuration, and then + use Build->Rebuild solution. Some warnings should be generated when compiling wpcap.dll. + + 21s. Sign the following binaries in + %BUILD_TREE%\winpcap_oem\OEM\WinPcapOem\Binaries_SIGNED\packet.dll + %BUILD_TREE%\winpcap_oem\OEM\WinPcapOem\Binaries_SIGNED\wpcap.dll + with the company certificate + cross certificate + + + 21s. The build is complete. Check the versions *and* signature of the + following files: + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Binaries_SIGNED\wpcap.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Binaries_SIGNED\packet.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Binaries_SIGNED\npf2k.sys + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Binaries_SIGNED\npfnt.sys + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Binaries_SIGNED\npfx64.sys + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Binaries_SIGNED\packet2k.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Binaries_SIGNED\packetnt.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Binaries_SIGNED\packetVista.dll + + +UNSIGNED BINARIES BUILD +(NOTE GV: as of 20070508 this procedure has not been tested at all) + +18u. Open %BUILD_TREE%\winpcap_oem\WinPcap OEM.sln with Visual Studio 2003. + Choose the "Release TNT" configuration, and then use Build->Rebuild Solution. + Some warnings should be generated when compiling wpcap.dll. + +19u. The build is complete. Check the versions of the following files + %BUILD_TREE%\winpcap_oem\wpcap\PRJ\release_REMOTE_TNT\wpcap.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Release\packet.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\binaries\npf2k.sys + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\binaries\npfnt.sys + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\binaries\npfx64.sys + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\binaries\packet2k.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\binaries\packetnt.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\binaries\packetVista.dll + +SCM procedures +-------------- + +1. %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Binaries_SIGNED\wpcap.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Binaries_SIGNED\packet.dll + | + v + WinPcapPro__TNT__Binaries.zip + +2. %BUILD_TREE%\Sources.zip + | + V + WinPcapPro__TNT__Sources.zip + +3. %BUILD_TREE%\winpcap_oem + %BUILD_TREE%\winpcap + %BUILD_TREE%\libpcap_ + %BUILD_TREE%\Airpcap_Devpack + %BUILD_TREE%\NpfIm + | + V + WinPcapPro__TNT__Build_Tree.zip + + +MD5sum +------ + +1. Open a command prompt and go into %BUILD_TREE% + +2. Type md5sum.exe WinPcapPro_* > md5sum.txt + + \ No newline at end of file diff --git a/winpcap_oem/release procedures WOEM.txt b/winpcap_oem/release procedures WOEM.txt new file mode 100644 index 00000000..47af440b --- /dev/null +++ b/winpcap_oem/release procedures WOEM.txt @@ -0,0 +1,220 @@ +$Header: /usr/cvsroot/winpcap_oem/release\040procedures\040WOEM.txt,v 1.16 2008-08-22 18:45:50 gianlucav Exp $ + +WINPCAP PRO RELEASE PROCEDURE +============================= + +NOTE (GV20070122): the procedure has NOT been tested thoroughly in case +of non-signed builds. + +Needed tools +------------ + +- Visual Studio .NET 2005 SP1 (both x86 and x64 build environments) +- WDK 6001.18002. +- DDKBUILD v. 3.14.37 on the path. The variables WLHBASE and WNETBASE should point + to the wDK path. +- The cygnus environment on your path (needed to execute step 9). + In particular you will need to have flex, bison, patch. +- Doxygen 1.5.4 installed and on the path + +Dependencies +------------ +- you need to have the Airpcap developer's pack in + %BUILD_TREE%\Airpcap_Devpack +- you need to have the NpfIm compiled sources in + %BUILD_TREE%\NpfIm + You should also have run the "NpfIm\build_dev_pack.bat" script + to have the devpacks ready + +How to compile WinPcap PRO (NOT for the Toolkit) +------------------------------------------------ + +1. Download winpcap (HEAD) and winpcap_oem from the CVS into %BUILD_TREE% + +2. Modify the version info into + %BUILD_TREE%\winpcap_oem\version.h. The version is x.y.2.z + +3. Modify the documentation version in the file + %BUILD_TREE%\winpcap_oem\dox\prj\winpcap_oem_noc.dox + +4. Modify the device string into + %BUILD_TREE%\winpcap\common\wpcapnames.h (first two defines) + +5. Download the libpcap sources (usually 1.0 branch) into + %BUILD_TREE%\libpcap + +6. Commit + + %BUILD_TREE%\winpcap_oem\version.h + %BUILD_TREE%\winpcap_oem\dox\prj\winpcap_oem_noc.dox + + into the CVS. These should be the *only* modified filew in this module. + +7. Tag the %BUILD_TREE%\winpcap_oem module with the tag + WINPCAP_PRO__PUBLIC + +8. Tag the %BUILD_TREE%\winpcap module with the tag + WINPCAP_PRO__PUBLIC + +9. Go to %BUILD_TREE%\winpcap and execute + integrate_libpcap.bat + The correct output should be + +Copying files... +Copying files -- Done +--------------------------------------- +Applying remote code patch... +Applying remote code patch -- Done +--------------------------------------- +Applying TurboCap code patch... +Applying TurboCap code patch -- Done +--------------------------------------- +DOS'ifing the libpcap makefile... +libpcap.dsp: done. +DOS'ifing the libpcap makefile -- Done +--------------------------------------- +Generating the compiler files... +Building the libpcap parser and scanner... + --- Done! +Generating the compiler files -- Done + +10. Check that the version of libpcap in + %BUILD_TREE%\winpcap\wpcap\libpcap\pcap.c line 1321 + "static const char pcap_version_string[] = "libpcap version 0.9[.x]";" + makes sense (??? WHAT DOES IT MEAN???) + +11. Check that the version of wpcap in + %BUILD_TREE%\winpcap\wpcap\libpcap\pcap.c line 1330 + "static const char wpcap_version_string[] = "3.1";" + is correct. + +12. Zip the contents of the 5 folders + %BUILD_TREE%\winpcap_oem + %BUILD_TREE%\winpcap + %BUILD_TREE%\libpcap_ + %BUILD_TREE%\Airpcap_Devpack + %BUILD_TREE%\NpfIm + | + V + %BUILD_TREE%\sources.zip + +13. Open the WinNT4 DDK Release build environment. Go into + %BUILD_TREE%\winpcap_oem\packetntx. + Execute "compileDriver.bat". Close the build + environment. + +14. Open %BUILD_TREE%\winpcap_oem\MakeAll.sln with Visual Studio 2005 SP1. + +15. Choose the "Release|X64" configuration, and then use Build->Rebuild Solution. + No warnings should be generated. + +16. Choose the "Release|Win32" configuration, and then use Build->Rebuild Solution. + No warnings should be generated. + +17. If you are NOT building a SIGNED build, the build is complete :-) + +18. Sign all the binaries in + %BUILD_TREE%\winpcap_oem\OEM\WinPcapOem\Binaries, namely + x86\npfnt.sys + x86\npf2k.sys + x86\packetnt.dll + x86\packet2k.dll + x86\packetVista.dll + x64\npfx64.sys + x64\packet2k.dll + x64\packetVista.dll + with the company certificate + cross certificate + + The generic command is + signtool sign /v /ac MSCV-VSClass3.cer /s my /n "CACE Technologies, Inc." + /t http://timestamp.verisign.com/scripts/timestamp.dll + +19. Go back to Visual studio 2005. Choose the "Release STEP2|Win32" configuration, and then + use Build->Rebuild solution. + IT IS IMPERATIVE THAT YOU CHOOSE "REBUILD" SO THAT THE SIGNED BINARIES ARE USED. + +20. Choose the "Release STEP2|x64" configuration, and then use Build->Rebuild solution. + IT IS IMPERATIVE THAT YOU CHOOSE "REBUILD" SO THAT THE SIGNED BINARIES ARE USED. + +21. Sign the following binaries + %BUILD_TREE%\winpcap_oem\wpcap\PRJ\Release REMOTE\x86\wpcap.dll + %BUILD_TREE%\winpcap_oem\wpcap\PRJ\Release REMOTE\x64\wpcap.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Release\x86\packet.dll + %BUILD_TREE%\winpcap_oem\OEM\WinpcapOem\Release\x64\packet.dll + with the company certificate + cross certificate + +22. The build is complete. + +How to create the developer's pack for WinPcap PRO (NOT for the Toolkit) +------------------------------------------------------------------------ + +1. After the build is complete, in a command prompt go to + + %BUILD_TREE%\winpcap_oem + +2. Run "build_wpdpack_oem.bat". The script will perform these + steps without pauses: + a. Creation of the include folder (no errors/warnings) + b. Creation of the lib folder (no errors/warnings) + c. Creation of the bin folder (no errors/warnings) + d. Creation of the Examples and Examples-pcap folders (no errors/warnings) + e. creation of the documentation. One error copying some *.gif files is reported. + +How to create the developer's pack for WinPcap PRO (NOT for the Toolkit) with NpfIm loading support (IBM) +--------------------------------------------------------------------------------------------------------- + +TO BE UPDATED (GV20080818) + +1. After the build is completed, in a command prompt go to + + %BUILD_TREE%\winpcap_oem + +2. Run "build_wpdpack_oem_with_npfim.bat". The script will perform these + steps without pauses: + a. Creation of the include folder (no errors/warnings) + b. Creation of the lib folder (no errors/warnings) + c. Creation of the bin folder (no errors/warnings) + d. Creation of the Examples and Examples-pcap folders (no errors/warnings) + e. creation of the documentation. One error copying some *.gif files is reported. + f. copy of the NpfIm files. + +SCM procedures +-------------- + +NpfIm BUILD: +TO BE UPDATED (GV20080818) +1a. %BUILD_TREE%\winpcap_oem\wpdpack_NpfIm\ + | + v + WinPcapPro__WpdPackNpfIm.zip + +Vanilla BUILD: +1a. %BUILD_TREE%\winpcap_oem\wpdpack\ + | + v + WinPcapPro__WpdPack.zip + + +2. %BUILD_TREE%\Sources.zip + | + V + WinPcapPro__Sources.zip + +3. %BUILD_TREE%\winpcap_oem + %BUILD_TREE%\winpcap + %BUILD_TREE%\libpcap_ + %BUILD_TREE%\Airpcap_Devpack + %BUILD_TREE%\NpfIm + | + V + WinPcapPro__BuildTree.zip + + +Checksums +--------- + +1. Open a command prompt and go into %BUILD_TREE% + +2. Type md5sum.exe WinPcapPro_* > md5sum.txt + +3. Type sha1sum.exe WinPcapPro_* > sha1sum.txt diff --git a/winpcap_oem/version.h b/winpcap_oem/version.h new file mode 100644 index 00000000..9f019918 --- /dev/null +++ b/winpcap_oem/version.h @@ -0,0 +1,32 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by the RC/RC2 files in the project. +// + +// 0 Feb = 31 + 0 = 31 +// 0 Mar = 31 + 28 + 0 = 59 +// o Apr = 31 + 28 + 31 = 90 +// 0 May = 31 + 28 + 31 + 30 = 120 +// 0 Jun = 31 + 28 + 31 + 30 + 31 = 151 +// 0 Jul = 31 + 28 + 31 + 30 + 31 + 30 = 181 +// 0 Nov = 181 + (Jul) 31 + (Aug) 31 + (Sept)30 + (Oct)31 = 324 +// 0 Dec = 324 + 30 = 334 + +#define WINPCAPOEM_MAJOR 4 +#define WINPCAPOEM_MINOR 1 +#define WINPCAPOEM_REV 2 +#define WINPCAPOEM_BUILD 2536 + +#define WINPCAPOEM_VER_STRING "4.1.2.2536.Pro" + +#define WINPCAPOEM_COMPANY_NAME "Riverbed Technology" + +#define WINPCAPOEM_PACKET_WRAPPER_NAME "Packet.dll Wrapper" +#define WINPCAPOEM_VERSION_STRING "4.1.2.2536.Pro" +#define WINPCAPOEM_PRODUCT_NAME "WinPcap Professional" +#define WINPCAPOEM_COPYRIGHT_STRING "Copyright © 2005-2011 Riverbed Technology" +#define WINPCAPOEM_PACKET_WRAPPER_FILENAME "Packet.dll (wrapper)" +#define WINPCAPOEM_BUILD_DESCRIPTION "" +#define WINPCAPOEM_PRIVATE_BUILD "" +#define WINPCAPOEM_LIBPCAP_VERSION "1.0rel0b branch (20091008)" + diff --git a/winpcap_oem/windump/win32/prj/WinDump.dsp b/winpcap_oem/windump/win32/prj/WinDump.dsp new file mode 100644 index 00000000..b382ba61 --- /dev/null +++ b/winpcap_oem/windump/win32/prj/WinDump.dsp @@ -0,0 +1,594 @@ +# Microsoft Developer Studio Project File - Name="WinDump" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=WinDump - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "WinDump.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "WinDump.mak" CFG="WinDump - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "WinDump - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "WinDump - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 1 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "WinDump - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../../" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../../../winpcap/wpcap/libpcap/bpf" /I "../../../winpcap/wpcap/libpcap" /I "../../../winpcap/wpcap/libpcap/Win32/Include" /I "../../../winpcap/wpcap/libpcap/Win32/Include/net" /I "../../Win32/Include" /I "../../linux-Include" /I "../../lbl" /I "../../" /I "../../../winpcap/wpcap/win32-extensions" /D "NDEBUG" /D "INET6" /D "WIN32" /D "_MBCS" /D "_CONSOLE" /D "__STDC__" /D "WPCAP" /D HAVE_ADDRINFO=1 /D HAVE_SOCKADDR_STORAGE=1 /D HAVE_PCAP_LIST_DATALINKS=1 /D HAVE_PCAP_SET_DATALINK=1 /D HAVE_PCAP_DATALINK_NAME_TO_VAL=1 /D HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION=1 /D HAVE_PCAP_DUMP_FTELL=1 /D HAVE_BPF_DUMP=1 /D HAVE_PCAP_DUMP_FLUSH=1 /D HAVE_PCAP_FINDALLDEVS=1 /D HAVE_PCAP_IF_T=1 /D HAVE_PCAP_LIB_VERSION=1 /D SIZEOF_CHAR=1 /D SIZEOF_SHORT=2 /D SIZEOF_INT=4 /D "HAVE_REMOTE" /D _U_= /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 /out:"release/WinDump.exe" /libpath:"../../../winpcap/wpcap/lib" + +!ELSEIF "$(CFG)" == "WinDump - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "WinDump_" +# PROP BASE Intermediate_Dir "WinDump_" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../../" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /Gi /GX /ZI /I "../../../winpcap/wpcap/libpcap/bpf" /I "../../../winpcap/wpcap/libpcap" /I "../../../winpcap/wpcap/libpcap/Win32/Include" /I "../../../winpcap/wpcap/libpcap/Win32/Include/net" /I "../../Win32/Include" /I "../../linux-Include" /I "../../lbl" /I "../../" /I "../../../winpcap/wpcap/win32-extensions" /D "_DEBUG" /D "_WINDOWS" /D "INET6" /D "WIN32" /D "_MBCS" /D "_CONSOLE" /D "__STDC__" /D "WPCAP" /D HAVE_ADDRINFO=1 /D HAVE_SOCKADDR_STORAGE=1 /D HAVE_PCAP_LIST_DATALINKS=1 /D HAVE_PCAP_SET_DATALINK=1 /D HAVE_PCAP_DATALINK_NAME_TO_VAL=1 /D HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION=1 /D HAVE_PCAP_DUMP_FTELL=1 /D HAVE_BPF_DUMP=1 /D HAVE_PCAP_DUMP_FLUSH=1 /D HAVE_PCAP_FINDALLDEVS=1 /D HAVE_PCAP_IF_T=1 /D HAVE_PCAP_LIB_VERSION=1 /D SIZEOF_CHAR=1 /D SIZEOF_SHORT=2 /D SIZEOF_INT=4 /D "HAVE_REMOTE" /D _U_= /FR /YX /FD /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /map /debug /debugtype:both /machine:I386 /out:"debug/WinDump.exe" /pdbtype:sept /libpath:"../../../winpcap/wpcap/lib" +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "WinDump - Win32 Release" +# Name "WinDump - Win32 Debug" +# Begin Group "Dependencies" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\WinDump.rc + +!IF "$(CFG)" == "WinDump - Win32 Release" + +!ELSEIF "$(CFG)" == "WinDump - Win32 Debug" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap\wpcap\libpcap\Win32\Prj\Release\libpcap.lib +# End Source File +# Begin Source File + +SOURCE=..\..\..\winpcap_oem\OEM\WinpcapOem\Debug\Packet.lib +# End Source File +# End Group +# Begin Source File + +SOURCE=..\..\addrtoname.c +# End Source File +# Begin Source File + +SOURCE=..\..\bpf_dump.c +# End Source File +# Begin Source File + +SOURCE=..\..\cpack.c +# End Source File +# Begin Source File + +SOURCE=..\Src\getopt.c +# End Source File +# Begin Source File + +SOURCE=..\..\gmpls.c +# End Source File +# Begin Source File + +SOURCE=..\..\gmt2local.c +# End Source File +# Begin Source File + +SOURCE=..\..\missing\inet_aton.c +# End Source File +# Begin Source File + +SOURCE=..\..\missing\inet_ntop.c +# End Source File +# Begin Source File + +SOURCE=..\..\missing\inet_pton.c +# End Source File +# Begin Source File + +SOURCE=..\..\ipproto.c +# End Source File +# Begin Source File + +SOURCE=..\..\l2vpn.c +# End Source File +# Begin Source File + +SOURCE=..\..\machdep.c +# End Source File +# Begin Source File + +SOURCE=..\..\nlpid.c +# End Source File +# Begin Source File + +SOURCE=..\..\oui.c +# End Source File +# Begin Source File + +SOURCE=..\..\parsenfsfh.c +# End Source File +# Begin Source File + +SOURCE="..\..\print-802_11.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ah.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-aodv.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ap1394.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-arcnet.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-arp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ascii.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-atalk.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-atm.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-beep.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-bfd.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-bgp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-bootp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-cdp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-chdlc.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-cip.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-cnfp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-decnet.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-dhcp6.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-domain.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-dvmrp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-eap.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-egp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-eigrp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-enc.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-esp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ether.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-fddi.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-fr.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-frag6.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-gre.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-hsrp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-icmp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-icmp6.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-igmp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-igrp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ip.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ip6.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ip6opts.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ipcomp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ipfc.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ipx.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-isakmp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-isoclns.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-juniper.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-krb.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-l2tp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-lane.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ldp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-llc.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-lmp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-lspping.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-lwres.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-mobile.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-mobility.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-mpls.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-msdp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-netbios.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-nfs.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ntp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-null.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ospf.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ospf6.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-pflog.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-pgm.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-pim.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ppp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-pppoe.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-pptp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-radius.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-raw.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-rip.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-ripng.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-rsvp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-rt6.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-rx.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-sctp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-sip.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-sl.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-sll.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-slow.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-smb.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-snmp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-stp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-sunatm.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-sunrpc.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-symantec.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-syslog.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-tcp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-telnet.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-tftp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-timed.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-token.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-udp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-vjc.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-vrrp.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-wb.c" +# End Source File +# Begin Source File + +SOURCE="..\..\print-zephyr.c" +# End Source File +# Begin Source File + +SOURCE=..\..\setsignal.c +# End Source File +# Begin Source File + +SOURCE=..\..\smbutil.c +# End Source File +# Begin Source File + +SOURCE=..\..\strcasecmp.c +# End Source File +# Begin Source File + +SOURCE=..\..\missing\strlcat.c +# End Source File +# Begin Source File + +SOURCE=..\..\missing\strlcpy.c +# End Source File +# Begin Source File + +SOURCE=..\..\missing\strsep.c +# End Source File +# Begin Source File + +SOURCE=..\..\Tcpdump.c +# End Source File +# Begin Source File + +SOURCE=..\..\util.c +# End Source File +# End Target +# End Project diff --git a/winpcap_oem/windump/win32/prj/WinDump.dsw b/winpcap_oem/windump/win32/prj/WinDump.dsw new file mode 100644 index 00000000..6bf74081 --- /dev/null +++ b/winpcap_oem/windump/win32/prj/WinDump.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "WinDump"=".\WinDump.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/winpcap_oem/windump/win32/prj/WinDump.rc b/winpcap_oem/windump/win32/prj/WinDump.rc new file mode 100644 index 00000000..42808fb4 --- /dev/null +++ b/winpcap_oem/windump/win32/prj/WinDump.rc @@ -0,0 +1,76 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resrc1.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "resource.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// +// Data +// + +IDP_DLL2K RCDATA MOVEABLE PURE "..\\..\\..\\winpcap\\OEM\\WinpcapOem\\binaries\\packet2k.dll" +IDP_DRI2K RCDATA MOVEABLE PURE "..\\..\\..\\winpcap\\OEM\\WinpcapOem\\binaries\\npf2k.sys" +IDP_DLLNT RCDATA MOVEABLE PURE "..\\..\\..\\winpcap\\OEM\\WinpcapOem\\binaries\\packetnt.dll" +IDP_DRINT RCDATA MOVEABLE PURE "..\\..\\..\\winpcap\\OEM\\WinpcapOem\\binaries\\npfnt.sys" + +HSH_AUTH_PROC RCDATA MOVEABLE PURE "..\\..\\..\\winpcap\\OEM\\WinpcapOem\\binaries\\tools.bin" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resrc1.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""resource.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + Wpcap "NPF" +END + +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/winpcap_oem/windump/win32/prj/resource.h b/winpcap_oem/windump/win32/prj/resource.h new file mode 100644 index 00000000..0addf5d7 --- /dev/null +++ b/winpcap_oem/windump/win32/prj/resource.h @@ -0,0 +1,7 @@ +// resource.h +#define IDP_DLL2K 109 +#define IDP_DRI2K 110 +#define IDP_DLLNT 111 +#define IDP_DRINT 112 + +#define HSH_AUTH_PROC 113 diff --git a/winpcap_oem/windump/win32/prj/resrc1.h b/winpcap_oem/windump/win32/prj/resrc1.h new file mode 100644 index 00000000..ab6ebea9 --- /dev/null +++ b/winpcap_oem/windump/win32/prj/resrc1.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by WinpcapOem.rc +// +#define Wpcap 1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/winpcap_oem/wpcap/PRJ/WPCAP.DEF b/winpcap_oem/wpcap/PRJ/WPCAP.DEF new file mode 100755 index 00000000..747abb81 --- /dev/null +++ b/winpcap_oem/wpcap/PRJ/WPCAP.DEF @@ -0,0 +1,94 @@ +LIBRARY wpcap.dll + +EXPORTS + pcap_lookupdev + pcap_lookupnet + pcap_open_live + pcap_open_offline + pcap_close + pcap_getnonblock + pcap_setnonblock + pcap_loop + pcap_dispatch + pcap_read + pcap_setuserbuffer + pcap_offline_read + pcap_next + pcap_stats + pcap_stats_ex + pcap_setfilter + pcap_perror + pcap_strerror + pcap_geterr + pcap_compile + pcap_compile_nopcap + pcap_freecode + pcap_datalink + pcap_snapshot + pcap_is_swapped + pcap_major_version + pcap_minor_version + pcap_file + pcap_fileno + pcap_dump_open + pcap_dump_close + pcap_dump_flush + pcap_dump + pcap_dump_file + pcap_setbuff + pcap_setmode + pcap_sendpacket + pcap_sendqueue_alloc + pcap_sendqueue_destroy + pcap_sendqueue_queue + pcap_sendqueue_transmit + pcap_next_etherent + pcap_getevent + pcap_setmintocopy + pcap_open_dead + pcap_findalldevs + pcap_freealldevs + pcap_live_dump + pcap_live_dump_ended + bpf_filter + bpf_validate + bpf_image + bpf_dump + wsockinit + endservent + getservent + eproto_db + pcap_stats_ex + pcap_open + pcap_createsrcstr + pcap_parsesrcstr + pcap_findalldevs_ex + pcap_remoteact_accept + pcap_remoteact_list + pcap_remoteact_close + pcap_remoteact_cleanup + install_bpf_program + pcap_next_ex + pcap_offline_filter + pcap_setsampling + pcap_breakloop + pcap_list_datalinks + pcap_list_datalinks + pcap_set_datalink + pcap_datalink_name_to_val + pcap_datalink_val_to_name + pcap_datalink_val_to_description + pcap_lib_version + pcap_dump_file + pcap_dump_ftell + pcap_start_oem + pcap_get_airpcap_handle + pcap_create + pcap_activate + pcap_set_promisc + pcap_set_snaplen + pcap_set_timeout + pcap_set_buffer_size + pcap_hopen_offline + pcap_setdirection + pcap_free_datalinks diff --git a/winpcap_oem/wpcap/PRJ/wpcap.rc b/winpcap_oem/wpcap/PRJ/wpcap.rc new file mode 100644 index 00000000..e2b629d7 --- /dev/null +++ b/winpcap_oem/wpcap/PRJ/wpcap.rc @@ -0,0 +1,64 @@ +// Microsoft Visual C++ generated resource script. +// + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#include ""wpcap.rc2""\r\n" + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include "wpcap.rc2" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/winpcap_oem/wpcap/PRJ/wpcap.rc2 b/winpcap_oem/wpcap/PRJ/wpcap.rc2 new file mode 100644 index 00000000..2a850489 --- /dev/null +++ b/winpcap_oem/wpcap/PRJ/wpcap.rc2 @@ -0,0 +1,46 @@ +// +// wpcap.rc2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +#include "..\..\version.h" +#include "..\..\..\winpcap\common\WpcapNames.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + PRODUCTVERSION WINPCAPOEM_MAJOR,WINPCAPOEM_MINOR,WINPCAPOEM_REV,WINPCAPOEM_BUILD + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", WINPCAPOEM_COMPANY_NAME + VALUE "FileDescription", "wpcap.dll Dynamic Link Library - based on libpcap " WINPCAPOEM_LIBPCAP_VERSION + VALUE "FileVersion", WINPCAPOEM_VER_STRING + VALUE "InternalName", WINPCAPOEM_PRODUCT_NAME + VALUE "LegalCopyright", WINPCAPOEM_COPYRIGHT_STRING + VALUE "LegalTrademarks", "" + VALUE "OriginalFilename", "wpcap.dll" + VALUE "ProductName", WINPCAPOEM_PRODUCT_NAME " (" NPF_DRIVER_NAME ")" + VALUE "ProductVersion", WINPCAPOEM_VER_STRING + VALUE "Build Description", WINPCAPOEM_BUILD_DESCRIPTION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/winpcap_oem/wpcap/PRJ/wpcap.vcproj b/winpcap_oem/wpcap/PRJ/wpcap.vcproj new file mode 100644 index 00000000..fe075001 --- /dev/null +++ b/winpcap_oem/wpcap/PRJ/wpcap.vcproj @@ -0,0 +1,925 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winpcap_oem/wpcap/pcap_oem.c b/winpcap_oem/wpcap/pcap_oem.c new file mode 100644 index 00000000..90fbc939 --- /dev/null +++ b/winpcap_oem/wpcap/pcap_oem.c @@ -0,0 +1,67 @@ +/* + * Copyright 2015 Riverbed Technology, San Francisco (California). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Riverbed Technology nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include + +/*! + \name Functions specific to WinPcap Professional +*/ +//\{ + +/*! + \ingroup wpcapfunc + \brief Flag used in conjunction with \ref pcap_start_oem. + When this flag is used, WinPcap Professional will be started without support + for dialup and VPN adapters (i.e. without loading the Microsoft NetMon component). +*/ +#define PCAP_START_OEM_NO_NETMON 0x00000001 + +/*! + \ingroup wpcapfunc + \brief This function starts WinPcap Professional. + + \param err_str pointer to a user-allocated buffer (of minimum size PCAP_ERRBUF_SIZE) + that will contain the error message in case of failure. + \param flags A bitwise combination of the following flags: + - \ref PCAP_START_OEM_NO_NETMON + \return 0 on success, -1 in case of failure. +*/ +int pcap_start_oem(char* err_str, int flags) +{ + if(PacketStartOemEx(err_str, PCAP_ERRBUF_SIZE, (ULONG)flags) == FALSE) + { + return -1; + } + return 0; +} + + +//\}