{"id":108080,"date":"2026-09-20T22:56:47","date_gmt":"2026-09-20T14:56:47","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/108080.html"},"modified":"2026-09-20T22:56:47","modified_gmt":"2026-09-20T14:56:47","slug":"windows-%e9%a9%b1%e5%8a%a8%e5%ae%9e%e4%be%8b%e5%88%86%e6%9e%90%e7%b3%bb%e5%88%97-hidhide-%e9%a9%b1%e5%8a%a8%e5%88%86%e6%9e%90-drivers-%e7%af%87%ef%bc%88%e4%b8%89%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/108080.html","title":{"rendered":"windows \u9a71\u52a8\u5b9e\u4f8b\u5206\u6790\u7cfb\u5217: HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7\uff08\u4e09\uff09"},"content":{"rendered":"<h2>HidHide \u9a71\u52a8\u5206\u6790 &#8211; drivers \u7bc7&#xff08;\u4e09&#xff09;&#xff1a;\u5185\u5b58\u7ba1\u7406\u4e0e\u6027\u80fd\u4f18\u5316<\/h2>\n<h3>\u4e00\u3001\u5185\u5b58\u6c60\u9009\u62e9\u4e0e\u5206\u914d\u7b56\u7565<\/h3>\n<h4>1.1 \u975e\u5206\u9875\u6c60&#xff08;NonPagedPool&#xff09;<\/h4>\n<p>HidHide \u4e2d\u6240\u6709\u52a8\u6001\u5206\u914d\u7684\u5185\u5b58\u90fd\u4f7f\u7528 NonPagedPool \u7c7b\u578b&#xff1a;<\/p>\n<p>temp <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">ExAllocatePoolZero<\/span><span class=\"token punctuation\">(<\/span>NonPagedPool<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">sizeof<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>temp<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> CONFIG_TAG<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u9009\u62e9\u7406\u7531&#xff1a;<\/p>\n<ul>\n<li>BST \u8282\u70b9\u53ef\u80fd\u5728\u4efb\u4f55 IRQL \u88ab\u8bbf\u95ee&#xff08;\u5305\u62ec DISPATCH_LEVEL&#xff09;&#xff0c;\u5fc5\u987b\u9a7b\u7559\u5728\u975e\u5206\u9875\u5185\u5b58\u4e2d\u3002<\/li>\n<li>\u9a71\u52a8\u4ee3\u7801\u5728\u4efb\u610f\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u6267\u884c&#xff0c;\u4e0d\u80fd\u89e6\u53d1\u9875\u9762\u9519\u8bef\u3002<\/li>\n<\/ul>\n<p>NX \u4f18\u5316&#xff1a;<\/p>\n<p><span class=\"token function\">ExInitializeDriverRuntime<\/span><span class=\"token punctuation\">(<\/span>DrvRtPoolNxOptIn<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5728 DriverEntry \u4e2d\u542f\u7528 NX&#xff08;No-Execute&#xff09;\u6c60\u4f18\u5316&#xff0c;\u5141\u8bb8\u5c06\u90e8\u5206\u5185\u5b58\u6807\u8bb0\u4e3a\u4e0d\u53ef\u6267\u884c&#xff0c;\u589e\u5f3a\u5b89\u5168\u6027\u3002<\/p>\n<h4>1.2 \u5185\u5b58\u6c60\u6807\u7b7e<\/h4>\n<p>\u6bcf\u4e2a\u5206\u914d\u90fd\u9644\u5e26 4 \u5b57\u7b26\u6807\u7b7e\u7528\u4e8e\u8c03\u8bd5&#xff1a;<\/p>\n<table>\n<tr>\u6807\u7b7e\u5341\u516d\u8fdb\u5236\u503c\u7528\u9014<\/tr>\n<tbody>\n<tr>\n<td>CONFIG_TAG<\/td>\n<td>&#039;1gaT&#039;<\/td>\n<td>BST \u8282\u70b9&#xff08;Config.c&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>LOGIC_TAG<\/td>\n<td>&#039;2gaT&#039;<\/td>\n<td>\u4e34\u65f6\u7f13\u51b2\u533a&#xff08;Logic.c&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4f7f\u7528 ExAllocatePoolZero \u800c\u975e ExAllocatePool \u4f1a\u81ea\u52a8\u6e05\u96f6\u5206\u914d\u7684\u5185\u5b58&#xff0c;\u907f\u514d\u4e86\u672a\u521d\u59cb\u5316\u6570\u636e\u7684\u98ce\u9669\u3002<\/p>\n<h3>\u4e8c\u3001BST \u7684\u5185\u5b58\u6548\u7387<\/h3>\n<h4>2.1 \u8282\u70b9\u7ed3\u6784\u7684\u5185\u5b58\u5e03\u5c40<\/h4>\n<p><span class=\"token keyword\">typedef<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">_PROCESSIDTREE<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    ULONG                  pid<span class=\"token punctuation\">;<\/span>                              <span class=\"token comment\">\/\/ 4 bytes<\/span><br \/>\n    WCHAR                  fullImageName<span class=\"token punctuation\">[<\/span>NTSTRSAFE_UNICODE_STRING_MAX_CCH<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ 1024 bytes<\/span><br \/>\n    UNICODE_STRING         fullImageNameUnicodeString<span class=\"token punctuation\">;<\/span>      <span class=\"token comment\">\/\/ 8 bytes<\/span><br \/>\n    EvaluationCache        evaluationCache<span class=\"token punctuation\">;<\/span>                 <span class=\"token comment\">\/\/ 4 bytes<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">_PROCESSIDTREE<\/span><span class=\"token operator\">*<\/span> left<span class=\"token punctuation\">;<\/span>                            <span class=\"token comment\">\/\/ 8 bytes<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">_PROCESSIDTREE<\/span><span class=\"token operator\">*<\/span> right<span class=\"token punctuation\">;<\/span>                           <span class=\"token comment\">\/\/ 8 bytes<\/span><br \/>\n<span class=\"token punctuation\">}<\/span> PROCESSIDTREE<span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u7ea6 1056 bytes<\/span><\/p>\n<p>\u6bcf\u4e2a\u8282\u70b9\u7ea6 1KB&#xff0c;\u652f\u6301\u6700\u5927\u8def\u5f84\u957f\u5ea6&#xff08;UNICODE_STRING_MAX_CCH&#xff09;\u3002\u5728\u5178\u578b\u7cfb\u7edf\u4e2d&#xff0c;\u540c\u65f6\u76d1\u63a7\u7684\u8fdb\u7a0b\u6570\u4e0d\u8d85\u8fc7 1000&#xff0c;\u603b\u5185\u5b58\u5360\u7528\u7ea6 1MB&#xff0c;\u53ef\u63a5\u53d7\u3002<\/p>\n<h4>2.2 \u5b57\u7b26\u4e32\u5171\u4eab\u8bbe\u8ba1<\/h4>\n<p><span class=\"token comment\">\/\/ \u8282\u70b9\u5b58\u50a8 UNICODE_STRING \u7ed3\u6784&#xff0c;\u6307\u5411\u540c\u4e00\u7f13\u51b2\u533a<\/span><br \/>\nntstatus <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">RtlStringCchCopyUnicodeStringEx<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>temp<span class=\"token operator\">-&gt;<\/span>fullImageName<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\nntstatus <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">RtlUnicodeStringInit<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>temp<span class=\"token operator\">-&gt;<\/span>fullImageNameUnicodeString<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>temp<span class=\"token operator\">-&gt;<\/span>fullImageName<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>fullImageNameUnicodeString \u4e0d\u590d\u5236\u5b57\u7b26\u4e32&#xff0c;\u800c\u662f\u6307\u5411 fullImageName \u6570\u7ec4\u3002\u8fd9\u907f\u514d\u4e86\u53cc\u91cd\u5185\u5b58\u5206\u914d&#xff0c;\u4e14 RtlCompareUnicodeString \u53ef\u76f4\u63a5\u4f7f\u7528\u6b64\u7ed3\u6784\u3002<\/p>\n<h3>\u4e09\u3001\u96c6\u5408\u5bf9\u8c61&#xff08;WDFCOLLECTION&#xff09;<\/h3>\n<h4>3.1 \u96c6\u5408\u7684\u4f7f\u7528\u573a\u666f<\/h4>\n<p>WDFCOLLECTION \u662f WDF \u63d0\u4f9b\u7684\u5bf9\u8c61\u5bb9\u5668&#xff0c;\u4e13\u95e8\u7528\u4e8e\u5b58\u50a8 WDF \u5bf9\u8c61&#xff08;\u5982 WDFSTRING&#xff09;&#xff1a;<\/p>\n<p><span class=\"token function\">WdfCollectionCreate<\/span><span class=\"token punctuation\">(<\/span><span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>pControlDeviceContext<span class=\"token operator\">-&gt;<\/span>whitelistedFullImageNames<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\">\/\/ \u6dfb\u52a0\u6761\u76ee<\/span><br \/>\n<span class=\"token function\">WdfStringGetUnicodeString<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">WdfCollectionGetItem<\/span><span class=\"token punctuation\">(<\/span>wdfCollection<span class=\"token punctuation\">,<\/span> index<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>fullImageName<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u6bcf\u4e2a\u767d\u540d\u5355\/\u9ed1\u540d\u5355\u6761\u76ee\u90fd\u662f\u4e00\u4e2a WDFSTRING \u5bf9\u8c61&#xff0c;\u7531\u96c6\u5408\u7236\u5bf9\u8c61\u81ea\u52a8\u7ba1\u7406\u751f\u547d\u5468\u671f\u3002<\/p>\n<h4>3.2 \u904d\u5386\u6548\u7387<\/h4>\n<p><span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span>ULONG index <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> size <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">WdfCollectionGetCount<\/span><span class=\"token punctuation\">(<\/span>wdfCollection<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">(<\/span>index <span class=\"token operator\">&lt;<\/span> size<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> index<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token function\">WdfStringGetUnicodeString<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">WdfCollectionGetItem<\/span><span class=\"token punctuation\">(<\/span>wdfCollection<span class=\"token punctuation\">,<\/span> index<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>fullImageName<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token function\">RtlCompareUnicodeString<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>fullImageName<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>node<span class=\"token operator\">-&gt;<\/span>fullImageNameUnicodeString<span class=\"token punctuation\">,<\/span> TRUE<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u5339\u914d<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u6bcf\u6b21\u67e5\u627e\u9700 O(n) \u904d\u5386\u96c6\u5408\u3002\u7531\u4e8e\u767d\u540d\u5355\u6761\u76ee\u6570\u901a\u5e38\u5f88\u5c0f&#xff08;&lt; 10&#xff09;&#xff0c;\u6548\u7387\u5f71\u54cd\u53ef\u5ffd\u7565\u3002<\/p>\n<h3>\u56db\u3001\u7f13\u5b58\u4e0e\u6027\u80fd\u4f18\u5316<\/h3>\n<h4>4.1 \u8fdb\u7a0b\u8def\u5f84\u67e5\u8be2\u7f13\u5b58<\/h4>\n<p>EvaluationCache \u662f\u5173\u952e\u7684\u4f18\u5316\u624b\u6bb5&#xff1a;<\/p>\n<p><span class=\"token keyword\">typedef<\/span> <span class=\"token keyword\">enum<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    EvaluationCacheEmpty <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    EvaluationCacheFound<span class=\"token punctuation\">,<\/span><br \/>\n    EvaluationCacheNotFound<br \/>\n<span class=\"token punctuation\">}<\/span> EvaluationCache<span class=\"token punctuation\">;<\/span><\/p>\n<ul>\n<li>\u9996\u6b21\u67e5\u8be2&#xff1a;\u904d\u5386\u767d\u540d\u5355\u96c6\u5408&#xff0c;\u4e0e\u8fdb\u7a0b\u8def\u5f84\u9010\u9879\u6bd4\u8f83\u3002\u7ed3\u679c\u7f13\u5b58\u5230\u8282\u70b9\u4e2d\u3002<\/li>\n<li>\u540e\u7eed\u67e5\u8be2&#xff1a;\u76f4\u63a5\u8fd4\u56de\u7f13\u5b58\u7ed3\u679c&#xff0c;\u65e0\u9700\u904d\u5386\u96c6\u5408\u3002<\/li>\n<\/ul>\n<p>\u547d\u4e2d\u7387\u5206\u6790&#xff1a;\u540c\u4e00\u8fdb\u7a0b\u5728\u751f\u547d\u5468\u671f\u5185\u53ef\u80fd\u591a\u6b21\u6253\u5f00 HID \u8bbe\u5907&#xff08;\u5982\u6e38\u620f\u53cd\u590d\u68c0\u67e5\u8bbe\u5907\u72b6\u6001&#xff09;&#xff0c;\u7f13\u5b58\u663e\u8457\u51cf\u5c11\u4e86\u5b57\u7b26\u4e32\u6bd4\u8f83\u5f00\u9500\u3002<\/p>\n<h4>4.2 \u7f13\u5b58\u5931\u6548\u7b56\u7565<\/h4>\n<p>\u5f53\u767d\u540d\u5355\u53d8\u66f4\u65f6&#xff0c;\u9a71\u52a8\u8c03\u7528 HidHideProcessIdsFlushWhitelistEvaluationCache \u6e05\u7a7a\u6240\u6709\u8282\u70b9\u7684\u7f13\u5b58\u72b6\u6001&#xff1a;<\/p>\n<p>VOID <span class=\"token function\">BstFlushEvaluationCache<\/span><span class=\"token punctuation\">(<\/span>PPROCESSIDTREE tree<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token constant\">NULL<\/span> <span class=\"token operator\">!&#061;<\/span> tree<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">BstFlushEvaluationCache<\/span><span class=\"token punctuation\">(<\/span>tree<span class=\"token operator\">-&gt;<\/span>left<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token function\">BstFlushEvaluationCache<\/span><span class=\"token punctuation\">(<\/span>tree<span class=\"token operator\">-&gt;<\/span>right<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        tree<span class=\"token operator\">-&gt;<\/span>evaluationCache <span class=\"token operator\">&#061;<\/span> EvaluationCacheEmpty<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8fd9\u6bd4\u9010\u4e2a\u5220\u9664\u8282\u70b9\u66f4\u9ad8\u6548&#xff0c;\u4ec5\u91cd\u7f6e\u72b6\u6001\u4f4d&#xff0c;\u800c\u4fdd\u7559\u8def\u5f84\u5b57\u7b26\u4e32\u3002<\/p>\n<h3>\u4e94\u3001\u5bf9\u8c61\u751f\u547d\u5468\u671f\u7ba1\u7406<\/h3>\n<h4>5.1 \u7236\u5bf9\u8c61\u81ea\u52a8\u6e05\u7406<\/h4>\n<p>WDF \u5bf9\u8c61\u5177\u6709\u7236\u5b50\u5173\u7cfb&#xff0c;\u7236\u5bf9\u8c61\u9500\u6bc1\u65f6\u81ea\u52a8\u9500\u6bc1\u6240\u6709\u5b50\u5bf9\u8c61&#xff1a;<\/p>\n<p>wdfObjectAttributes<span class=\"token punctuation\">.<\/span>ParentObject <span class=\"token operator\">&#061;<\/span> s_wdfControlDevice<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">WdfWaitLockCreate<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>wdfObjectAttributes<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>s_criticalSectionLock<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>WdfWaitLock \u4f5c\u4e3a\u5b50\u5bf9\u8c61&#xff0c;\u5728\u63a7\u5236\u8bbe\u5907\u9500\u6bc1\u65f6\u81ea\u52a8\u9500\u6bc1&#xff0c;\u65e0\u9700\u624b\u52a8\u8c03\u7528 WdfWaitLockDelete\u3002<\/p>\n<h4>5.2 \u4e0a\u4e0b\u6587\u6e05\u7406\u56de\u8c03<\/h4>\n<p>\u5bf9\u4e8e\u9700\u8981\u663e\u5f0f\u91ca\u653e\u8d44\u6e90\u7684\u5bf9\u8c61&#xff0c;\u4f7f\u7528 EvtCleanupCallback&#xff1a;<\/p>\n<p>pDeviceContext <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">DeviceGetContext<\/span><span class=\"token punctuation\">(<\/span>wdfDeviceObject<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">WdfObjectDelete<\/span><span class=\"token punctuation\">(<\/span>pDeviceContext<span class=\"token operator\">-&gt;<\/span>deviceInstancePath<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">UpdateDataForControlDeviceDeletionAndDeleteControlDeviceWhenNeeded<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5f53\u8fc7\u6ee4\u8bbe\u5907\u5bf9\u8c61\u9500\u6bc1\u65f6&#xff0c;\u81ea\u52a8\u91ca\u653e deviceInstancePath \u5b57\u7b26\u4e32\u5e76\u51cf\u5c11\u5f15\u7528\u8ba1\u6570\u3002<\/p>\n<h4>5.3 \u907f\u514d\u53cc\u91cd\u91ca\u653e<\/h4>\n<p><span class=\"token function\">WdfObjectDelete<\/span><span class=\"token punctuation\">(<\/span>pControlDeviceContext<span class=\"token operator\">-&gt;<\/span>whitelistedFullImageNames<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\npControlDeviceContext<span class=\"token operator\">-&gt;<\/span>whitelistedFullImageNames <span class=\"token operator\">&#061;<\/span> newCollection<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5728\u66ff\u6362\u96c6\u5408\u65f6&#xff0c;\u5148\u8c03\u7528 WdfObjectDelete \u91ca\u653e\u65e7\u96c6\u5408&#xff0c;\u518d\u8d4b\u503c\u65b0\u96c6\u5408\u3002\u7531\u4e8e\u96c6\u5408\u5bf9\u8c61\u6ca1\u6709\u7236\u5bf9\u8c61&#xff0c;\u5fc5\u987b\u624b\u52a8\u7ba1\u7406\u751f\u547d\u5468\u671f\u3002<\/p>\n<h3>\u516d\u3001\u6ce8\u518c\u8868\u8bfb\u5199\u7684\u7f13\u51b2\u7b56\u7565<\/h3>\n<h4>6.1 \u8bfb\u53d6\u6ce8\u518c\u8868\u7684\u591a\u5b57\u7b26\u4e32<\/h4>\n<p><span class=\"token function\">WdfRegistryQueryMultiString<\/span><span class=\"token punctuation\">(<\/span>wdfKey<span class=\"token punctuation\">,<\/span> valueName<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>wdfObjectAttributes<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">*<\/span>value<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>WDF \u81ea\u52a8\u5904\u7406 REG_MULTI_SZ \u683c\u5f0f\u7684\u89e3\u6790&#xff0c;\u5e76\u521b\u5efa\u5bf9\u5e94\u7684 WDFSTRING \u5b50\u5bf9\u8c61\u3002\u8fd9\u907f\u514d\u4e86\u624b\u52a8\u89e3\u6790\u591a\u5b57\u7b26\u4e32\u7684\u590d\u6742\u6027\u548c\u7f13\u51b2\u533a\u6ea2\u51fa\u98ce\u9669\u3002<\/p>\n<h4>6.2 \u5199\u5165\u6ce8\u518c\u8868<\/h4>\n<p><span class=\"token function\">WdfRegistryAssignValue<\/span><span class=\"token punctuation\">(<\/span>wdfKey<span class=\"token punctuation\">,<\/span> valueName<span class=\"token punctuation\">,<\/span> REG_MULTI_SZ<span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span>ULONG<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span>valueInCharacters <span class=\"token operator\">*<\/span> <span class=\"token keyword\">sizeof<\/span><span class=\"token punctuation\">(<\/span>WCHAR<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> value<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5199\u5165\u65f6\u76f4\u63a5\u4f20\u5165 Unicode \u5b57\u7b26\u4e32\u548c\u957f\u5ea6&#xff0c;WDF \u81ea\u52a8\u5904\u7406\u683c\u5f0f\u8f6c\u6362\u548c\u5199\u5165\u64cd\u4f5c\u3002<\/p>\n<h3>\u4e03\u3001\u6027\u80fd\u5f71\u54cd\u8bc4\u4f30<\/h3>\n<table>\n<tr>\u64cd\u4f5c\u9891\u7387\u5f00\u9500\u4f18\u5316\u63aa\u65bd<\/tr>\n<tbody>\n<tr>\n<td>IRP \u62e6\u622a<\/td>\n<td>\u6781\u9ad8&#xff08;\u6bcf\u6b21\u8bbe\u5907\u6253\u5f00&#xff09;<\/td>\n<td>\u5fae\u79d2\u7ea7<\/td>\n<td>\u65e0\u9501\u8bfb\u53d6\u3001\u77ed\u8def\u4f18\u5316<\/td>\n<\/tr>\n<tr>\n<td>BST \u67e5\u627e<\/td>\n<td>\u4e2d&#xff08;\u8fdb\u7a0b\u521b\u5efa\/\u52a0\u8f7d&#xff09;<\/td>\n<td>O(log n)<\/td>\n<td>\u4e8c\u53c9\u641c\u7d22\u6811<\/td>\n<\/tr>\n<tr>\n<td>\u767d\u540d\u5355\u5339\u914d<\/td>\n<td>\u4f4e&#xff08;\u4ec5\u9996\u6b21\u8bbf\u95ee&#xff09;<\/td>\n<td>O(n) &#043; \u5b57\u7b26\u4e32\u6bd4\u8f83<\/td>\n<td>\u7f13\u5b58\u7ed3\u679c<\/td>\n<\/tr>\n<tr>\n<td>\u914d\u7f6e\u66f4\u65b0<\/td>\n<td>\u6781\u4f4e&#xff08;\u7528\u6237\u64cd\u4f5c&#xff09;<\/td>\n<td>\u6beb\u79d2\u7ea7<\/td>\n<td>\u53cc\u7f13\u51b2\u539f\u5b50\u4ea4\u6362<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u603b\u4f53\u6027\u80fd\u635f\u8017 &lt; 0.5%&#xff0c;\u6ee1\u8db3\u6e38\u620f\u5916\u8bbe\u573a\u666f\u7684\u5b9e\u65f6\u6027\u8981\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HidHide \u9a71\u52a8\u5206\u6790 &#8211; drivers \u7bc7&#xff08;\u4e09&#xff09;&#xff1a;\u5185\u5b58\u7ba1\u7406\u4e0e\u6027\u80fd\u4f18\u5316<br \/>\n\u4e00\u3001\u5185\u5b58\u6c60\u9009\u62e9\u4e0e\u5206\u914d\u7b56\u7565<br \/>\n1.1 \u975e\u5206\u9875\u6c60&#xff08;NonPagedPool&#xff09;<br \/>\nHidHide \u4e2d\u6240\u6709\u52a8\u6001\u5206\u914d\u7684\u5185\u5b58\u90fd\u4f7f\u7528 NonPagedPool \u7c7b\u578b&#xff1a;<br \/>\ntemp  ExAllocatePoolZero(NonPagedPool, sizeof(*temp), CONFIG_TAG);\u9009\u62e9\u7406\u7531&#xff1a;<br \/>\nBST \u8282\u70b9<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[149,1363],"topic":[],"class_list":["post-108080","post","type-post","status-publish","format-standard","hentry","category-server","tag-windows","tag-1363"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>windows \u9a71\u52a8\u5b9e\u4f8b\u5206\u6790\u7cfb\u5217: HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7\uff08\u4e09\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/108080.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"windows \u9a71\u52a8\u5b9e\u4f8b\u5206\u6790\u7cfb\u5217: HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7\uff08\u4e09\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7&#xff08;\u4e09&#xff09;&#xff1a;\u5185\u5b58\u7ba1\u7406\u4e0e\u6027\u80fd\u4f18\u5316 \u4e00\u3001\u5185\u5b58\u6c60\u9009\u62e9\u4e0e\u5206\u914d\u7b56\u7565 1.1 \u975e\u5206\u9875\u6c60&#xff08;NonPagedPool&#xff09; HidHide \u4e2d\u6240\u6709\u52a8\u6001\u5206\u914d\u7684\u5185\u5b58\u90fd\u4f7f\u7528 NonPagedPool \u7c7b\u578b&#xff1a; temp ExAllocatePoolZero(NonPagedPool, sizeof(*temp), CONFIG_TAG);\u9009\u62e9\u7406\u7531&#xff1a; BST \u8282\u70b9\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/108080.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-20T14:56:47+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/108080.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/108080.html\",\"name\":\"windows \u9a71\u52a8\u5b9e\u4f8b\u5206\u6790\u7cfb\u5217: HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7\uff08\u4e09\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-20T14:56:47+00:00\",\"dateModified\":\"2026-09-20T14:56:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/108080.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/108080.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/108080.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"windows \u9a71\u52a8\u5b9e\u4f8b\u5206\u6790\u7cfb\u5217: HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7\uff08\u4e09\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"windows \u9a71\u52a8\u5b9e\u4f8b\u5206\u6790\u7cfb\u5217: HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7\uff08\u4e09\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/108080.html","og_locale":"zh_CN","og_type":"article","og_title":"windows \u9a71\u52a8\u5b9e\u4f8b\u5206\u6790\u7cfb\u5217: HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7\uff08\u4e09\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7&#xff08;\u4e09&#xff09;&#xff1a;\u5185\u5b58\u7ba1\u7406\u4e0e\u6027\u80fd\u4f18\u5316 \u4e00\u3001\u5185\u5b58\u6c60\u9009\u62e9\u4e0e\u5206\u914d\u7b56\u7565 1.1 \u975e\u5206\u9875\u6c60&#xff08;NonPagedPool&#xff09; HidHide \u4e2d\u6240\u6709\u52a8\u6001\u5206\u914d\u7684\u5185\u5b58\u90fd\u4f7f\u7528 NonPagedPool \u7c7b\u578b&#xff1a; temp ExAllocatePoolZero(NonPagedPool, sizeof(*temp), CONFIG_TAG);\u9009\u62e9\u7406\u7531&#xff1a; BST \u8282\u70b9","og_url":"https:\/\/www.wsisp.com\/helps\/108080.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-20T14:56:47+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/108080.html","url":"https:\/\/www.wsisp.com\/helps\/108080.html","name":"windows \u9a71\u52a8\u5b9e\u4f8b\u5206\u6790\u7cfb\u5217: HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7\uff08\u4e09\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-20T14:56:47+00:00","dateModified":"2026-09-20T14:56:47+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/108080.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/108080.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/108080.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"windows \u9a71\u52a8\u5b9e\u4f8b\u5206\u6790\u7cfb\u5217: HidHide \u9a71\u52a8\u5206\u6790 - drivers \u7bc7\uff08\u4e09\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/108080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=108080"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/108080\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=108080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=108080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=108080"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=108080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}