[ros-dev] [ros-diffs] [gedmurphy] 72178: [FLTLIB] - Stub out fltlib.dll. - Add basic implementations for FilterLoad and FilterUnload - Remove the wine code, this lib talks directly to fltmgr.sys and is therefore a react...
Thomas Faber
thomas.faber at reactos.org
Thu Aug 11 07:49:36 UTC 2016
On 2016-08-10 00:10, gedmurphy at svn.reactos.org wrote:
> + /* Calc and allocate a buffer to hold our filter name */
> + BufferLength = wcslen(lpFilterName) * sizeof(WCHAR);
> + FilterName = RtlAllocateHeap(GetProcessHeap(),
> + 0,
> + BufferLength + sizeof(UNICODE_STRING));
> + if (FilterName == NULL)
> + {
> + CloseHandle(hFltMgr);
> + return HRESULT_FROM_WIN32(ERROR_OUTOFMEMORY);
> + }
> +
> + /* Build up the filter name into a real life string */
> + FilterName->Buffer = (PWCH)(FilterName + 1);
> + FilterName->Length = BufferLength;
> + FilterName->MaximumLength = BufferLength;
> + RtlCopyMemory(FilterName->Buffer, lpFilterName, BufferLength);
> +
> + /* Tell the filter manager to load the filter for us */
> + dwError = SendIoctl(hFltMgr,
> + Load ? IOCTL_LOAD_FILTER : IOCTL_UNLOAD_FILTER,
> + FilterName,
> + BufferLength + sizeof(UNICODE_STRING));
> +
> + /* Cleaup and bail*/
> + CloseHandle(hFltMgr);
> + return HRESULT_FROM_WIN32(dwError);
> }
You're leaking this allocation.
> +// Hack - our SDK reports NTDDI_VERSION as 0x05020100 (from _WIN32_WINNT 0x502)
> +// which doesn't pass the FLT_MGR_BASELINE check in fltkernel.h
> +#define NTDDI_VERSION NTDDI_WS03SP1
We typically set this kind of thing in CMakeLists.txt.. however maybe
we should define it this way by default
More information about the Ros-dev
mailing list