{"id":314,"date":"2012-07-09T16:54:15","date_gmt":"2012-07-09T07:54:15","guid":{"rendered":"http:\/\/soundengine.jp\/wordpress\/tips\/?p=314"},"modified":"2014-02-06T23:42:37","modified_gmt":"2014-02-06T14:42:37","slug":"vc-se_inc_base_priority_name%e7%89%b9%e6%a8%a9%e3%81%ae%e5%8f%96%e5%be%97","status":"publish","type":"post","link":"https:\/\/soundengine.jp\/wordpress\/tips\/try\/314\/","title":{"rendered":"VC++ SE_INC_BASE_PRIORITY_NAME\u7279\u6a29\u306e\u53d6\u5f97"},"content":{"rendered":"<h2 id=\"content_1_0\">OpenProcessToken  <a class=\"anchor_super\" id=\"t08ec25d\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-20#t08ec25d\" title=\"t08ec25d\"> <\/a><\/h2>\n<p>\u3053\u306e\u95a2\u6570\u306f\u3001<a href=\"http:\/\/msdn.microsoft.com\/library\/ja\/default.asp?url=\/library\/ja\/jpsecupf\/html\/_win32_OpenProcessToken.asp\" rel=\"nofollow\">MSDN<\/a>\u306b\u3088\u308b\u3068<\/p>\n<blockquote>\n<p class=\"quotation\">\u30d7\u30ed\u30bb\u30b9\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u3066\u3044\u308b\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092\u958b\u304d\u307e\u3059\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3042\u308b\u3002\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3068\u3044\u3046\u306e\u304c\u4f55\u304b\u306f\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u304c\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306b\u95a2\u3059\u308b\u60c5\u5831\u3067\u3042\u308b\u3053\u3068\u306f\u78ba\u304b\u3067\u3042\u308b\u3002\u3053\u3053\u3067\u306f\u3001TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES\u3068\u3044\u3046\u7279\u6a29\u3092\u53d6\u5f97\u3057\u3066\u307f\u305f\u3002<!--more-->\u3053\u308c\u3089\u306f\u3001<a href=\"http:\/\/www.g-ninja.net\/tips\/shutdown.html\" rel=\"nofollow\">\u3053\u3053\u306e\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u306b\u95a2\u3059\u308b\u8aac\u660e<\/a>\u3092\u5143\u306b\u3059\u308b\u3068<\/p>\n<blockquote>\n<p class=\"quotation\">\u3053\u306e\u6642\u306b\u7279\u6a29\u3092\u5909\u66f4\u3067\u304d\u308b\u30a2\u30af\u30bb\u30b9(TOKEN_ADJUST_PRIVILEGES)\u3068\u3001\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u30a2\u30af\u30bb\u30b9(TOKEN_QUERY)\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3042\u308b\u3002TOKEN_QUERY\u3092\u306f\u305a\u3059\u3068\u5f8c\u306eAdjustTokenPrivileges\u3067\u5f15\u3063\u304b\u304b\u308b(FALSE)\u304c\u5e30\u3063\u3066\u304d\u305f\u308a\u3059\u308b\u3002\u3061\u306a\u307f\u306b\u30013\u756a\u76ee\u306e\u5f15\u6570\u306f\u95a2\u6570\u304c\u6210\u529f\u3057\u305f\u5834\u5408\u30c8\u30fc\u30af\u30f3\u306e\u30cf\u30f3\u30c9\u30eb\u304c\u8fd4\u3063\u3066\u304f\u308b\u304c\u5fc5\u8981\u306a\u304f\u306a\u3063\u305f\u6642\u306b\u5f53\u7136CloseHandle\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_1\">LookupPrivilegeValue  <a class=\"anchor_super\" id=\"o9c7d4f8\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-20#o9c7d4f8\" title=\"o9c7d4f8\"> <\/a><\/h2>\n<p>\u3053\u306e\u95a2\u6570\u306f\u3001<a href=\"http:\/\/msdn.microsoft.com\/library\/ja\/default.asp?url=\/library\/ja\/jpsecupf\/html\/_win32_LookupPrivilegeValue.asp\" rel=\"nofollow\">MSDN<\/a>\u306b\u3088\u308b\u3068<\/p>\n<blockquote>\n<p class=\"quotation\">\u6307\u5b9a\u3055\u308c\u305f\u30b7\u30b9\u30c6\u30e0\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u30ed\u30fc\u30ab\u30eb\u4e00\u610f\u8b58\u5225\u5b50\uff08LUID\uff09\u3092\u53d6\u5f97\u3057\u3001\u6307\u5b9a\u3055\u308c\u305f\u7279\u6a29\u540d\u3092\u30ed\u30fc\u30ab\u30eb\u3067\u8868\u73fe\u3057\u307e\u3059\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3042\u308b\u3002\u4eca\u56de\u306f\u3001SE_INC_BASE_PRIORITY_NAME\u306eLUID\u3092\u53d6\u5f97\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3053\u308c\u3092\u4f7f\u3063\u3066\u3044\u308b\u3002\u5b9f\u969b\u95a2\u6570\u3092\u4f7f\u3063\u3066\u307f\u308b\u3068<\/p>\n<blockquote>\n<p class=\"quotation\">Luid\t{LowPart=14 HighPart=0 }\t_LUID<\/p>\n<\/blockquote>\n<p>\u3053\u306e\u3088\u3046\u306a\u5024\u304c\u8fd4\u3063\u3066\u304d\u305f\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_2\">AdjustTokenPrivileges  <a class=\"anchor_super\" id=\"a2ab21c3\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-20#a2ab21c3\" title=\"a2ab21c3\"> <\/a><\/h2>\n<p>\u6700\u5f8c\u306b\u4f7f\u3046\u3053\u306e\u95a2\u6570\u306f\u3001<a href=\"http:\/\/msdn.microsoft.com\/library\/ja\/default.asp?url=\/library\/ja\/jpsecupf\/html\/_win32_adjusttokenprivileges.asp\" rel=\"nofollow\">MSDN<\/a>\u306b\u3088\u308b\u3068<\/p>\n<blockquote>\n<p class=\"quotation\">\u6307\u5b9a\u3057\u305f\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u5185\u306e\u7279\u6a29\u3092\u6709\u52b9\u307e\u305f\u306f\u7121\u52b9\u306b\u3057\u307e\u3059\u3002TOKEN_ADJUST_PRIVILEGES \u30a2\u30af\u30bb\u30b9\u6a29\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3042\u308b\u3002TOKEN_ADJUST_PRIVILEGES\u306f\u3001\u5148\u306b\u6307\u5b9a\u3057\u3066\u3044\u308b\u306e\u3067\u554f\u984c\u306a\u3044\u3060\u308d\u3046\u3002\u4eca\u56de\u306e\u5834\u5408\u7279\u6a29\u3092\u5f97\u308b\u305f\u3081\u3001 BOOL DisableAllPrivileges\u306fFALSE\u306b\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b\u3002NewState\u3067\u65b0\u3057\u3044\u7279\u6a29\u3092\u8a2d\u5b9a\u3057PreviousState\u3067\u5143\u306e\u72b6\u614b\u3092\u53d7\u3051\u53d6\u308b\u3002\u5143\u306e\u72b6\u614b\u304c\u7279\u306b\u3044\u3089\u306a\u3044\u5834\u5408\u306f\u7279\u306b\u8a2d\u5b9a\u3057\u306a\u304f\u3066\u3082\u3088\u3044\u3068\u306e\u3053\u3068\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_3\">\u30b3\u30fc\u30c9  <a class=\"anchor_super\" id=\"ja93c637\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-20#ja93c637\" title=\"ja93c637\"> <\/a><\/h2>\n<p>\u6700\u7d42\u7684\u306b\u306f\u3053\u306e\u3088\u3046\u306a\u6d41\u308c\u306b\u306a\u308b\u3002\u30c1\u30a7\u30c3\u30af\u306f\u5404\u81ea\u4f5c\u3063\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u3002<\/p>\n<pre>OpenProcessToken( hp, TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, &amp;ht );\r\n\r\nLUID l;\r\nLookupPrivilegeValue( NULL, SE_INC_BASE_PRIORITY_NAME, &amp;l );\r\n\r\nTOKEN_PRIVILEGES n;\r\nn.PrivilegeCount = 1;\r\nn.Privileges[ 0 ].Luid = l;\r\nn.Privileges[ 0 ].Attributes = SE_PRIVILEGE_ENABLED;\r\n\r\nDWORD r;\r\nAdjustTokenPrivileges( ht, FALSE, &amp;n, 0, NULL, NULL );<\/pre>\n<p>\u4e00\u9023\u306e\u6d41\u308c\u306f\u3001ExitWindowsEx( EWX_SHUTDOWN, 0 );\u3092\u4f7f\u3046\u5834\u5408\u306b\u3082\u5fdc\u7528\u3067\u304d\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenProcessToken \u3053\u306e\u95a2\u6570\u306f\u3001MSDN\u306b\u3088\u308b\u3068 \u30d7\u30ed\u30bb\u30b9\u306b\u95a2\u9023\u4ed8 &hellip; <a href=\"https:\/\/soundengine.jp\/wordpress\/tips\/try\/314\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-314","post","type-post","status-publish","format-standard","hentry","category-try"],"_links":{"self":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/comments?post=314"}],"version-history":[{"count":6,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/314\/revisions"}],"predecessor-version":[{"id":3324,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/314\/revisions\/3324"}],"wp:attachment":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/media?parent=314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/categories?post=314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/tags?post=314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}