<commit_before>//////////////////////////////////////////////////////////////////////
// Project: pcap-ndis6
// Description: WinPCAP fork with NDIS6.x support 
// License: MIT License, read LICENSE file in project root for details
//
// Copyright (c) 2017 ChangeDynamix, LLC
// All Rights Reserved.
// 
// https://changedynamix.io/
// 
// Author: <NAME>
// 
// Based on original WinPcap source code - https://www.winpcap.org/
// Copyright(c) 1999 - 2005 NetGroup, Politecnico di Torino(Italy)
// Copyright(c) 2005 - 2007 CACE Technologies, Davis(California)
// Filter driver based on Microsoft examples - https://github.com/Microsoft/Windows-driver-samples
// Copyrithg(C) 2015 Microsoft
// All rights reserved.
//////////////////////////////////////////////////////////////////////



#include "precomp.h"
#include "Events.h"
#include "KernelUtil.h"

volatile ULONG _curEventId = 0;

EVENT* CreateEvent()
{
	DEBUGP(DL_TRACE, "===>CreateEvent...\n");
	EVENT *event = FILTER_ALLOC_MEM(FilterDriverObject, sizeof(EVENT));
	if(!event)
	{
		return NULL;
	}
	NdisZeroMemory(event, sizeof(EVENT));

	InterlockedIncrement((volatile long*)&_curEventId);
	LARGE_INTEGER timestamp = KeQueryPerformanceCounter(NULL);
	
	sprintf(event->Name, EVENT_NAME_FMT, _curEventId, timestamp.QuadPart);

	char name[1024];
	sprintf(name, "\\BaseNamedObjects\\%s", event->Name);

	DEBUGP(DL_TRACE, " event name %s\n", name);

	PUNICODE_STRING name_u = CreateString(name);

	if(!name_u)
	{
		DEBUGP(DL_TRACE, "<===CreateEvent failed to alloc string\n");
		FILTER_FREE_MEM(event);
		return NULL;
	}

	DEBUGP(DL_TRACE, " event name unicode = 0x%08x, handle=0x%08x\n", name, event->EventHandle);

	DEBUGP(DL_TRACE, "  calling IoCreateNotificationEvent\n");<commit_msg>small bug in debug log<commit_after>//////////////////////////////////////////////////////////////////////
// Project: pcap-ndis6
// Description: WinPCAP fork with NDIS6.x support 
// License: MIT License, read LICENSE file in project root for details
//
// Copyright (c) 2017 ChangeDynamix, LLC
// All Rights Reserved.
// 
// https://changedynamix.io/
// 
// Author: <NAME>
// 
// Based on original WinPcap source code - https://www.winpcap.org/
// Copyright(c) 1999 - 2005 NetGroup, Politecnico di Torino(Italy)
// Copyright(c) 2005 - 2007 CACE Technologies, Davis(California)
// Filter driver based on Microsoft examples - https://github.com/Microsoft/Windows-driver-samples
// Copyrithg(C) 2015 Microsoft
// All rights reserved.
//////////////////////////////////////////////////////////////////////



#include "precomp.h"
#include "Events.h"
#include "KernelUtil.h"

volatile ULONG _curEventId = 0;

EVENT* CreateEvent()
{
	DEBUGP(DL_TRACE, "===>CreateEvent...\n");
	EVENT *event = FILTER_ALLOC_MEM(FilterDriverObject, sizeof(EVENT));
	if(!event)
	{
		return NULL;
	}
	NdisZeroMemory(event, sizeof(EVENT));

	InterlockedIncrement((volatile long*)&_curEventId);
	LARGE_INTEGER timestamp = KeQueryPerformanceCounter(NULL);
	
	sprintf(event->Name, EVENT_NAME_FMT, _curEventId, timestamp.QuadPart);

	char name[1024];
	sprintf(name, "\\BaseNamedObjects\\%s", event->Name);

	DEBUGP(DL_TRACE, " event name %s\n", name);

	PUNICODE_STRING name_u = CreateString(name);

	if(!name_u)
	{
		DEBUGP(DL_TRACE, "<===CreateEvent failed to alloc string\n");
		FILTER_FREE_MEM(event);
		return NULL;
	}

	DEBUGP(DL_TRACE, " event name unicode = 0x%08x, handle=0x%08x\n", name_u, event->EventHandle);

	DEBUGP(DL_TRACE, "  calling IoCreateNotificationEvent\n");
{'fraction_non_alphanumeric': 0.21266838635712237, 'fraction_numerical': 0.02120951562052164, 'mean_word_length': 3.0723453908984832, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5749818', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1100, 'n_words': 263}