I know I can capture the packet by using DNIS
(Presumably "using NDIS".)
Yes, NDIS is the operating system mechanism that provides hooks for packet capture.
As you're asking on Stack Overflow, presumably you want to write a program to capture packets, rather than using an existing program.
You could write your own code to use NDIS (which works at least as far back as Windows NT 4.0, and probably earlier and, with different code, Windows 9x as well), but that's code that would run in the kernel, and that's a bit more difficult.
However, WinPcap and Npcap already have that kernel code, and a library that runs in user mode, providing the same API as libpcap on UN*X; the easiest way would probably be to install WinPcap or Npcap on your machine, along with the Software Development Kit for WinPcap or Npcap, and use that.
If you're programming in C or C++, you can use the API directly. In other languages, including .NET languages, there are wrappers for libpcap/WinPcap - see this list of wrappers, for example.