Type error compiling examples on VS2012

Casting the divert layer argument for the DivertOpen function resolves
a type error in VS2012.
This commit is contained in:
Daan Raman
2013-03-07 11:40:13 +01:00
parent d9e1d687cc
commit 0266a1048f
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ int __cdecl main(int argc, char **argv)
console = GetStdHandle(STD_OUTPUT_HANDLE);
// Divert traffic matching the filter:
handle = DivertOpen(argv[1], 0, priority, DIVERT_FLAG_SNIFF);
handle = DivertOpen(argv[1], (DIVERT_LAYER)0, priority, DIVERT_FLAG_SNIFF);
if (handle == INVALID_HANDLE_VALUE)
{
if (GetLastError() == ERROR_INVALID_PARAMETER)
+1 -1
View File
@@ -149,7 +149,7 @@ int __cdecl main(int argc, char **argv)
console = GetStdHandle(STD_OUTPUT_HANDLE);
// Divert traffic matching the filter:
handle = DivertOpen(argv[1], 0, priority, 0);
handle = DivertOpen(argv[1], (DIVERT_LAYER)0, priority, 0);
if (handle == INVALID_HANDLE_VALUE)
{
if (GetLastError() == ERROR_INVALID_PARAMETER)
+1 -1
View File
@@ -56,7 +56,7 @@ int __cdecl main(int argc, char **argv)
}
// Divert traffic matching the filter:
handle = DivertOpen(argv[1], 0, 0, 0);
handle = DivertOpen(argv[1], (DIVERT_LAYER)0, 0, 0);
if (handle == INVALID_HANDLE_VALUE)
{
if (GetLastError() == ERROR_INVALID_PARAMETER)
+1 -1
View File
@@ -163,7 +163,7 @@ int __cdecl main(int argc, char **argv)
"ip && " // Only IPv4 supported
"tcp.DstPort == 80 && " // HTTP (port 80) only
"tcp.PayloadLength > 0", // TCP data packets only
0, priority, 0
(DIVERT_LAYER)0, priority, 0
);
if (handle == INVALID_HANDLE_VALUE)
{