반응형

Filter-Hook Drivers

 

Filter-Hook Driver는 타 드라이버에 비해 아주 간단하게 작성할 수 있다.

그렇다면 작성이 편리한 Filter-Hook Driver가 왜 범용적으로 사용되지 않는 것일까?

아래의 MSDN문서를 읽어보면 그 이유를 알 수 있다.

Filter-hook driver OS상에 단 하나의 드라이버만 설치될 수 있으며,

이로 인해 다른 Filter-hook driver가 선점하고 있다면, 이후에 등록하려는 Filter-hook dirver는 등록 자체가 실패해 버린다.( 실제로 이러한 문제 때문에 드라이버를 재개발한 케이스가 있으니 참고하기 바란다.)

 

Windows Driver Kit: Network Devices and Protocols

http://msdn.microsoft.com/en-us/library/ff546489.aspx


filter-hook driver
는 네트워크 패킷을 필터링 하는데 사용하는 kernel-mode driver이다. Filter-hook drivers는 시스템이 제공하는 Internet Protocol (IP) filter driver의 기능을 확장한다. filter-hook driver Windows 2000혹은 그 이후의 OS에서만 설치될 수 있다.

오직 하나의 filter-hook 드라이버만이 OS상에 설치될 수 있으며, IP filter driver에 의해 사용될 수 있다. filter-hook driver IP filter driver를 위한 extension hook포인터가 Null인 경우에만 자기 자신을 IP filter driver에 등록할 수 있다. filter-hook driver가 등록된 이후, IP filter driver는 자신에게 extension hook을 설치할 filter-hook드라이버를 위한 file object를 할당한다.

Note Windows Vista의 경우 filter-hook or firewall-hook drivers를 사용하지 말고, 대신에 Windows Filtering Platform Callout Drivers를 사용하라.

 

반응형

'Windows Programming > 드라이버' 카테고리의 다른 글

[TDI Filter Driver] tdifw  (0) 2008.09.23
WDK는 VC6.0에서 빌드되지 않는다.  (0) 2008.07.24
Network Driver의 종류  (0) 2008.07.21
DeviceObject 삭제  (1) 2008.06.20
데이타 버퍼 어드레싱  (0) 2008.06.11
반응형

Windows Driver Kit: Network Devices and Protocols

Using the Network Driver Design Guide (NDIS 5.1)

http://msdn.microsoft.com/en-us/library/ms797076.aspx


Windows 기반 OS는 몇가지 타입의 kernel-mode network driver를 지원한다. 이 문서는 이러한 종류의 네트워크 드라이버를 어떻게 작성하는지 기술하고 있다. topic은 지원되는 네트워크 드라이버 타입과 각 타입의 네트워크 드라이버를 개발하기 전에 읽어야 할 가이드의 섹션에 대해 간략히 설명하고 있다.

Microsoft Windows 2000과 그 이후 버전의 OS는 네 가지 타입의 kernel-mode 네트워크 드라이버를 지원한다.

· Miniport drivers

miniport driver network interface card(NIC) 를 직접관리하고, higher-level 드라이버와의 인터페이스를 제공한다.

· Intermediate drivers

intermediate driver legacy transport driver와 같은 upper-level protocol dirverminiport driver interface역할을 한다. intermediate protocol driver를 개발하는 전형적인 예는 존재하는 lagacy transport driver miniport드라이버(that manages a NIC for a new media type unknown to the transport driver.) 사이의 매채변환(media translation)을 수행하는 것이다.

· Protocol drivers

upper-level protocol driver TDI interface 또는 가능한 application-specific 인터페이스를 기술한다. at its upper edge to provide services to users of the network. At its lower edge, a protocol driver provides a protocol interface to pass packets to and receive incoming packets from the next-lower driver.

Another type of protocol driver is a connection-oriented call manager. A call manager provides call setup and tear-down services for connection-oriented clients, which are also protocol drivers.

· Filter-hook driver

A filter-hook driver는 패킷을 필터링 하는데 사용된다. 이 드라이버는 OS에서 제공하는 IP Filter Driver의 기능을 확장한다.


For general information about Windows network architecture and programming considerations, see Network Architecture for Kernel-Mode Drivers and Network Driver Programming Considerations. For information about network INF files, which are used to install network components, see Installing Network Components. If your network driver requires a notify object—for example, to control bindings—see also Notify Objects for Network Components.

To find out which additional sections to read for a particular driver type, see the following sections.

Miniport Drivers (NDIS 5.1)

There are several types of miniport drivers. Read the sections that are recommended for the type of driver you are writing:

To learn about connectionless miniport drivers

If you are writing a miniport driver that controls a NIC for connectionless network media, such as Ethernet, FDDI, or Token Ring; read:

Introduction to NDIS Miniport Drivers

Overview of Miniport Driver Operations and Functions

Miniport Driver DriverEntry Function and Initialization

Transferring Data

Obtaining and Setting Miniport Driver Information and NDIS Support for WMI

Plug and Play for NDIS Miniport Drivers

Power Management for NDIS Miniport Drivers

Reset, Halt, and Shutdown Functions

To learn about connection-oriented miniport drivers

If you are writing a miniport driver that controls a NIC for connection-oriented network media, such as ATM or ISDN, read:

All the sections listed for connectionless miniport drivers

Connection-Oriented NDIS

To learn about WAN miniport drivers

If you are writing a miniport driver that controls a WAN NIC, read:

All the sections listed for connectionless miniport drivers

WAN Miniport Drivers

To learn about integrated miniport driver call managers (MCM)

If you are writing a miniport driver that controls a connection-oriented NIC and that also provides call manager services, read:

All the sections listed for connectionless miniport drivers

Connection-Oriented NDIS

To learn about miniports with a WDM lower interface

If you are writing a miniport driver that has a WDM lower interface read:

All the sections listed for connectionless miniport drivers

Miniport Driver with a WDM Lower Interface

To learn about IrDA miniport drivers

If you are writing a miniport driver that controls an IrDA adapter, read:

All the sections listed for connectionless miniport drivers

IrDA Miniport Drivers

To learn about additional miniport capabilities

To learn about additional miniport capabilities, read:

Task Offload

Load Balancing and Failover

Intermediate Drivers (NDIS 5.1)

You can write an intermediate driver that has either a connectionless or a connection-oriented lower edge. Read the sections that are recommended for the type of driver you are writing:

To learn about intermediate drivers that have a connectionless lower edge

If you are writing an intermediate driver whose lower edge provides an interface to connectionless miniport drivers, read:

NDIS Intermediate Drivers

To learn about intermediate drivers that have a connection-oriented lower edge

If you are writing an intermediate driver whose lower edge provides an interface to connection-oriented miniport drivers, read:

NDIS Intermediate Drivers

Connection-Oriented NDIS

Protocol Drivers (NDIS 5.1)

You can write a protocol driver that has either a connectionless or a connection-oriented lower edge. In addition, your protocol driver can expose a transport driver interface (TDI) at its upper edge and can also provide Winsock support. Read the sections that are recommended for the type of driver you are writing:

To learn about protocol drivers that have a connectionless lower edge

If you are writing a protocol driver whose lower edge provides an interface to connectionless miniport drivers, read:

NDIS Protocol Drivers

To learn about protocol drivers that are connection-oriented clients, or that are connection-oriented providers of call manager services

If you are writing a connection-oriented client, which provides an interface to connection-oriented miniport drivers, or if you will be writing a connection-oriented call manager, read:

NDIS Protocol Drivers
Connection-Oriented NDIS

To learn about protocol drivers that have a TDI upper edge

If you are writing a protocol that has a TDI upper edge, read:

NDIS Protocol Drivers

TDI Transports and Their Clients

TDI Routines, Macros, and Callbacks

TDI Operations

To learn about protocol drivers that have Winsock support

If you are writing a protocol that provides Winsock support, read:

NDIS Protocol Drivers

Transport Helper DLLs for Windows Sockets

Filter-Hook Drivers (NDIS 5.1)

To learn about filter hook drivers, read the following section:

                 Filter-Hook Drivers

 

반응형

'Windows Programming > 드라이버' 카테고리의 다른 글

WDK는 VC6.0에서 빌드되지 않는다.  (0) 2008.07.24
Filter-Hook Driver  (0) 2008.07.21
DeviceObject 삭제  (1) 2008.06.20
데이타 버퍼 어드레싱  (0) 2008.06.11
Device Object naming  (0) 2008.05.30
반응형

디버깅시 Local 변수값이 표시되지 않는 경우

 

WinDbg로 디버깅시 Local변수가 확인이 안되는 문제가 발생했다.
아니 지금까지 계속 그랬는데 오늘 눈에 띄었다.

빌드도 정상이고 동작도 정상인데, 코드에 BreakPoint를 걸어 디버깅을 시도해 보니

멀쩡히 선언되어 있는 로컬변수가 Locals Winodw에 표시가 되지 않는것 아닌가?
dv
명령어를 쳐봐도 해당변수에 대한 정보가 없다
.
그렇다고 다 안보이는 것도 아니고 3개중 1개만 안보인다
.

-
빌드 옵션의 문제가 아닌가하는 생각에, DDK 빌드관련 페이지를 검색
...

덕분에 VC6.0을 이용해서 드라이버를 빌드할 수 있는 방법을 찾긴했으니 삽질은 아니었다
.
Go To Definition
등의 메뉴를 사용할 수 있어 편하겠다만은 빌드옵션이 넘 복잡하고

하나 하나 뜯어볼 형편이 안되는 관계로 우선은 그냥 예전방식을 사용할란다.
(
궁금하신 분은
http://www.codeproject.com/KB/applications/driverwizard.aspx를 참고하시라
.)

지금 쓰는 방식은 makefile Project를 이용해서 IDE 환경만 빌리는 방식이다 - (이 방법은 Chris Cant Windows WDM Driver Model에 보면 나와 있다
)

-
아무튼 코드프로젝트의 위자드를 사용하니, 로컬변수가 모두 표시된다
.
-
두개를 비교해본다
.
-
동일한 코드를 빌드했음에도 확실히 차이가 난다
.
-
위자드를 쓰는 방법밖에는 없는건가
?

저녁을 먹고 올라오다 불현듯, 얼마전에 본 소스의 첫째줄이 생각났다
.
#pragma optimize("", off)
이 한줄이다
.
아마도 optimize되는 과정에서 로컬변수에 대한 디버깅 정보가 빠지는건 아닐까
???

[
덧붇임: 2008.07.23]

최적화와 로컬변수 디버깅정보 누락에 대한 해답이 될만한 포스트를 찾았다.
자세한 정보는 링크를 참조
.!!!
http://blog.naver.com/process3?Redirect=Log&logNo=20036617483

---- 발췌 ----
3
번 원본 코드를 최적화 옵션을 주고 컴파일 하고 default로 컴파일 했을 때의 차이를 쉽게 알 수 있습니다.
, 최적화를 사용하면 사용하지 않는 로컬 변수등을 컴파일러가 스스로 제거하고 최소한의 코드를 만듭니다., 적은수의 OPCODE를 만들어서 CPU 부하를 줄입니다.

그러나, 최적화는 양날의 검입니다. 최적화 옵션을 사용하면 차후에 덤프 디버그 할때 FPO 등과 로컬 변수등이 제대로 나오지 않아서 디버깅 하는것이 상당히 어려워 집니다

[
덧붇임: 2009.07.21] - by 좋은향기
최적화 옵션으로 빌드할 경우,
지역변수 정보뿐만 아니라, 간단한 함수의 경우 스택프레임 구성이 생략될수 있다.

 

 

반응형
반응형

IE 관련 Registry

 

[ HTTP USER-AGENT 태그 ]

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform


[ 설치된 ActiveX 컨트롤 관련 정보 ]

HKLM\SOFTWARE\Microsoft\Code Store Database\Distribution Units


[ 영역별 설정 정보 저장위치]

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones

[0] – Computer(내컴퓨터)
[1] - Local intranet(
로컬 인트라넷
)
[2] - Trusted sites(
신뢰할 수 있는 사이트
)
[3] – Internet(
인터넷
)
[4] - Restricted sites(
제한된 사이트
)


[ 보호모드 해제(인터넷 영역)]

HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3]

보호모드 해제 - "2500" = dword:00000003

 

반응형
반응형

듀얼 모니터에서의 좌표값 확인

 

듀얼모니터를 사용하는 경우 윈도우나 마우스의 좌표가 음수(-)값이 나올 수 있다.
디스플레이 설정에서 우측의 모니터를 Primary모니터로 잡는 경우, 우측 모니터의 좌 상단이 (0,0)좌표가 되며, 왼쪽 모니터의 X좌표는 음수 값을 갖게 된다.

마우스나 윈도우의 좌표를 LPARAM의 전달하는 메시지의 경우,
보통 HIWORD(lParam), LOWORD(lParam)를 사용해서 좌표를 파싱하게 되는데

HIWORD()
LOWORD() 매크로의 경우, WORD값 즉 양수만을 리턴 하므로 정상적인 좌표가 계산되지 않는다.

이경우,

HIWORD() 대신 GET_X_LPARAM()
LOWORD() 대신 GET_Y_LPARAM()

을 사용하면 정상적인 좌표값을 얻울 수 있다.

 

GET_X_LPARAM()GET_Y_LPARAM()은 다음과 같이 정의 되어 있으며, <windowsx.h>에 정의되어 있다.

#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
#define GET_Y_LPARAM(lp) ((int)(short
)HIWORD(lp))

참고로 HIWORD() LOWORD()의 정의는 다음과 같다

#define HIWORD(l) ((WORD) (((DWORD) (l) >> 16) & 0xFFFF))
#define LOWORD(l) ((WORD) (l))

참고 페이지
http://msdn.microsoft.com/en-us/library/ms534600(VS.85).aspx

 

 

반응형

'Windows Programming' 카테고리의 다른 글

[Win32] Windows Message – Control 제어  (0) 2009.06.02
Windows Mobile 전원 상태 감시  (0) 2008.08.12
COM DLL만으로 tlb파일 생성및 COM사용하기  (0) 2008.04.28
Afx의 의미  (0) 2008.04.14
스크린 크기 구하기  (0) 2008.04.02
반응형

XP Firewall을 관장하는 서비스

 

n  서비스 관리자를 통해 서비스 목록을 살펴보면 'Windows Firewall/Internet Connection Sharing(ICS)'라는 서비스가 존재하며 이 서비스가 Firewall을 관장하는 서비스로 추측된다.

n  근거는 다음과 같다.

1) 서비스 항목의 설명
  
네트워크 주소 변환, 주소 지정, 이름 확인 및/또는 홈 네트워크나 소규모 네트워크에의 침입을 방지
  
하는 서비스를 공급합니다.

 

2) 해당 서비스를 중지하면, 방화벽 해제 프로세스(Windows 보안경고 창)가 팝업 되지 않는다.



사용자 삽입 이미지

반응형

+ Recent posts