{"id":193,"date":"2010-04-18T00:25:26","date_gmt":"2010-04-18T09:25:26","guid":{"rendered":"\/blog\/?p=193"},"modified":"2023-09-21T09:39:12","modified_gmt":"2023-09-21T00:39:12","slug":"ddk-driverextension-%ea%b3%bc-deviceextension%ec%9d%98-%ec%b0%a8%ec%9d%b4%ec%a0%90","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=193","title":{"rendered":"[DDK] DriverExtension \uacfc DeviceExtension\uc758 \ucc28\uc774\uc810"},"content":{"rendered":"\n<p class=\"article_post\">\uc77c\ub2e8 <font color=\"#ff0000\">DriverExtension<\/font>\uc5d0 \ub300\ud574\uc11c \n\uc54c\uc544\ubcf4\uba74,<br \/>\n<\/p><div class=\"dp-highlighter\">\n<ol class=\"dp-cpp\"><li class=\"alt\"><span><span class=\"keyword\"><strong><font color=\"#006699\">typedef<\/font><\/strong><\/span><span>&nbsp;<\/span><span class=\"keyword\"><strong><font color=\"#006699\">struct<\/font><\/strong><\/span><span>&nbsp;_DRIVER_EXTENSION \n &nbsp;<\/span><\/span> \n<\/li><li><span>{ &nbsp; <\/span> \n<\/li><li class=\"alt\"><span>&nbsp; &nbsp; &nbsp;PDRIVER_OBJECT DriverObject; &nbsp; <\/span> \n<\/li><li><span>&nbsp; &nbsp; &nbsp;<\/span><span class=\"datatypes\"><strong><font color=\"#2e8b57\">LONG<\/font><\/strong><\/span><span>&nbsp;* AddDevice; &nbsp; <\/span> \n<\/li><li class=\"alt\"><span>&nbsp; &nbsp; &nbsp;<\/span><span class=\"datatypes\"><strong><font color=\"#2e8b57\">ULONG<\/font><\/strong><\/span><span>&nbsp;Count; &nbsp; <\/span> \n<\/li><li><span>&nbsp; &nbsp; &nbsp;UNICODE_STRING ServiceKeyName; &nbsp; <\/span> \n<\/li><li class=\"alt\"><span>&nbsp; &nbsp; &nbsp;PIO_CLIENT_EXTENSION ClientDriverExtension; &nbsp; <\/span> \n<\/li><li><span>&nbsp; &nbsp; &nbsp;PFS_FILTER_CALLBACKS FsFilterCallbacks; &nbsp; <\/span> \n<\/li><li class=\"alt\"><span>} DRIVER_EXTENSION, *PDRIVER_EXTENSION; &nbsp;<\/span><\/li><\/ol><\/div>\n<div class=\"article_post\">&lt;TEXTAREA class=\"cpp\" style=\"DISPLAY: none\" name=code \nrows=10 cols=60&gt;typedef struct _DRIVER_EXTENSION { PDRIVER_OBJECT \nDriverObject; LONG * AddDevice; ULONG Count; UNICODE_STRING ServiceKeyName; \nPIO_CLIENT_EXTENSION ClientDriverExtension; PFS_FILTER_CALLBACKS \nFsFilterCallbacks; } DRIVER_EXTENSION, *PDRIVER_EXTENSION; &lt;\/TEXTAREA&gt; \n<br \/><br \/>DriverExtension\uc740 \uc2dc\uc791\ud558\ub294 DriverEntry \ub8e8\ud2f4\uc5d0\uc11c \ud560\ub2f9\ub418\uba70 \ub4dc\ub77c\uc774\ubc84\uc758 \uc804\uc5ed\uc801\uc778 \uc790\ub8cc\ub97c \uc800\uc7a5\ud560\ub54c \uc0ac\uc6a9\ub41c\ub2e4. \n<br \/><br \/>DeviceExtension\uacfc \uac70\uc758 \ud761\uc0ac\ud55c \uc758\ubbf8\uc774\uc9c0\ub9cc \ub0b4\ud3ec\ud558\ub294 \ubc94\uc704\ub294 \ub2e4\ub974\ub2e4. <\/div>\n\n<p class=\"article_post\">IoAllocateDriverObjectExtension()\ub294 DriverExtension\uc744 \ud560\ub2f9\ud558\ub294 \n\uc5ed\ud560\uc744 \ud558\uba70 <br \/><br \/>IoGetDriverObjectExtension()\ub294 \uc774 \uba54\ubaa8\ub9ac\uc758 \uc8fc\uc18c\ub97c \uc5bb\ub294 \uc5ed\ud560\uc744 \ud55c\ub2e4. \n<br \/><br \/>DriverExtension \uba54\ubaa8\ub9ac\ub97c \ud574\uc81c\ud574\uc8fc\ub294 \ud568\uc218\ub294 \uc5c6\ub2e4. <br \/><br \/>\uc65c\ub0d0\ud558\uba74 Driver Unload \uac00 \uc2e4\ud589\ub418\ub294 \n\uc2dc\uc810\uc5d0\uc11c I\/O Manager\uac00 \uc54c\uc544\uc11c \ucc98\ub9ac\ud574 \uc8fc\uae30\ub54c\ubb38\uc774\ub2e4. <br \/>\n<\/p><div class=\"dp-highlighter\">\n<ol class=\"dp-cpp\"><li class=\"alt\"><span><span>NTSTATUS &nbsp; <\/span><\/span> \n<\/li><li><span>DriverDeviceControl( &nbsp; <\/span> \n<\/li><li class=\"alt\"><span>&nbsp; &nbsp; PDEVICE_OBJECT DeviceObject, &nbsp; <\/span> \n<\/li><li><span>&nbsp; &nbsp; PIRP Irp &nbsp; <\/span> \n<\/li><li class=\"alt\"><span>&nbsp; &nbsp; ) &nbsp; <\/span> \n<\/li><li><span>{ &nbsp; <\/span> \n<\/li><li class=\"alt\"><span>&nbsp; &nbsp; PDEVICE_EXTENSION deviceExtension =&nbsp;DeviceObject-&gt;DeviceExtension; \n &nbsp;<\/span> \n<\/li><li><span>&nbsp; <\/span> \n<\/li><li class=\"alt\"><span>&nbsp; &nbsp; <\/span><span class=\"keyword\"><strong><font color=\"#006699\">return<\/font><\/strong><\/span><span>&nbsp;SmartcardDeviceControl( \n &nbsp;<\/span> \n<\/li><li><span>&nbsp; &nbsp; &nbsp; &nbsp; &amp;(deviceExtension-&gt;SmartcardExtension), &nbsp; <\/span> \n<\/li><li class=\"alt\"><span>&nbsp; &nbsp; &nbsp; &nbsp; Irp &nbsp; <\/span> \n<\/li><li><span>&nbsp; &nbsp; &nbsp; &nbsp; ); &nbsp; <\/span> \n<\/li><li class=\"alt\"><span>} &nbsp;<\/span><\/li><\/ol><\/div>\n<div class=\"article_post\">&lt;TEXTAREA class=\"cpp\" style=\"DISPLAY: none\" name=code \nrows=10 cols=60&gt;NTSTATUS DriverDeviceControl( PDEVICE_OBJECT DeviceObject, \nPIRP Irp ) { PDEVICE_EXTENSION deviceExtension = \nDeviceObject-&gt;DeviceExtension; return SmartcardDeviceControl( \n&amp;(deviceExtension-&gt;SmartcardExtension), Irp ); } &lt;\/TEXTAREA&gt; <br \/>\uc704\ub294 \nDevice Extension\uc744 \uc0ac\uc6a9\ud558\ub294 \uc608\uc81c\uc774\ub2e4.<br \/><br \/>\uadf8\ub9ac\uace0 <font color=\"#ff0000\">DeviceExtension<\/font> \uba54\ubaa8\ub9ac\ub294 AddDevice \ub8e8\ud2f4\uc5d0\uc11c \ud560\ub2f9\ub418\uba70 \uac01 \uc7a5\uce58 \uace0\uc720\uc758 \uc815\ubcf4\ub97c \ub2f4\uc744\uc218 \n\uc788\ub2e4. <br \/><br \/>\uc774\ub294 DriverExtension\uacfc\ub294 \ub2e4\ub974\ub2e4. DriverExtension\uc774 \uac01 \uc7a5\uce58\uc758 \ub4dc\ub77c\uc774\ubc84\ub9c8\ub2e4 \ubaa8\ub450 \uacf5\uc720\ud558\ub294 \ub370\uc774\ud130 \n\uc774\uc9c0\ub9cc <br \/><br \/>DeviceExtension\uc740 \uacf5\uc720\ub418\uc9c0 \uc54a\ub294\ub2e4. <br \/><br \/>IoCreateDevice()\uc5d0 \uc758\ud574 \nDeviceObject\ub97c \uc0dd\uc131\ud560\ub54c DeviceExtension \uba54\ubaa8\ub9ac\ub97c \ud560\ub2f9 \ud560\uc218 \uc788\uc73c\uba70 <br \/><br \/>IoDeleteDevice()\ub85c \nDeviceObject\ub97c \uc0ad\uc81c\ud560\ub54c DeviceExtension\uc744 \ud574\uc81c\ud560 \uc218 \uc788\ub2e4. <br \/><br \/>&nbsp;\uc774\ub458\uc758 <font color=\"#ff0000\">\ucc28\uc774\uc810\uc744 \uc694\uc57d<\/font>\ud558\uba74 AddDevice \ub8e8\ud2f4\uc548\uc5d0\uc11c DeviceObject\ub97c \uc0dd\uc131\ud560\ub54c \uace0\uc720 \uc815\ubcf4\ub97c \uc800\uc7a5\ud558\uae30 \n<br \/><br \/>\uc704\ud574\uc11c DeviceExtension\uc744 \uc0ac\uc6a9\ud55c\ub2e4. \uc774 DeviceExtension\uc5d0 \uc800\uc7a5\ub41c \ub0b4\uc6a9\uc740 Device Object\ub9c8\ub2e4 \n\uace0\uc720\ud558\uba70 <br \/><br \/>\ub2e4\ub978 Device Object\uc640 \uacf5\uc720\ub418\uc9c0 \uc54a\ub294\ub2e4. <br \/><br \/>\ud558\uc9c0\ub9cc RegistryPath\uc640 \uac19\uc740 \uc815\ubcf4\uc758 \uacbd\uc6b0 \ubaa8\ub4e0 \nDeviceObject\uac00 \uacf5\ud1b5\uc801\uc73c\ub85c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774\ub2e4. <br \/><br \/>\uc774\ub294 \uc11c\ub85c \uacf5\uc720\ub418\ub294 \uc815\ubcf4\uc774\uba70 \ub2e4\uc2dc \ub9d0\ud574 Driver \uc804\uc5ed\uc801\uc778 \uc815\ubcf4\uc774\ub2e4. \n<br \/><br \/>DriverExtension\uc740 \uc774\uc640\uac19\uc774 Driver \uc804\uc5ed \uc801\uc778 \uc815\ubcf4\ub97c \uc800\uc7a5\ud558\ub294 \uba54\ubaa8\ub9ac\uc774\ub2e4. <\/div>\n<div class=\"article_post\">&nbsp;<\/div>\ucd9c\ucc98 : <a class=\"con_link\" href=\"http:\/\/ssmhz.tistory.com\/\" target=\"_blank\" rel=\"noopener\">http:\/\/ssmhz.tistory.com<\/a> <br \/>\n","protected":false},"excerpt":{"rendered":"<p>\uc77c\ub2e8 DriverExtension\uc5d0 \ub300\ud574\uc11c \uc54c\uc544\ubcf4\uba74, typedef&nbsp;struct&nbsp;_DRIVER_EXTENSION &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp;PDRIVER_OBJECT DriverObject; &nbsp; &nbsp; &nbsp; &nbsp;LONG&nbsp;* AddDevice; &nbsp; &nbsp; &nbsp; &nbsp;ULONG&nbsp;Count; &nbsp; &nbsp; &nbsp; &nbsp;UNICODE_STRING ServiceKeyName; &nbsp; &nbsp; &nbsp; &nbsp;PIO_CLIENT_EXTENSION ClientDriverExtension; &nbsp; &nbsp; &nbsp; &nbsp;PFS_FILTER_CALLBACKS FsFilterCallbacks; &nbsp; } DRIVER_EXTENSION, *PDRIVER_EXTENSION; &nbsp; &lt;TEXTAREA class=&#8221;cpp&#8221; style=&#8221;DISPLAY: none&#8221; name=code rows=10 cols=60&gt;typedef struct _DRIVER_EXTENSION { PDRIVER_OBJECT DriverObject; LONG * [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[24],"tags":[],"class_list":["post-193","post","type-post","status-publish","format-standard","hentry","category-development_winddk"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=193"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/193\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}