{"id":5191,"date":"2014-12-02T19:16:19","date_gmt":"2014-12-02T10:16:19","guid":{"rendered":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5191"},"modified":"2014-12-02T19:27:00","modified_gmt":"2014-12-02T10:27:00","slug":"uac-%e7%92%b0%e5%a2%83%e4%b8%8b%e3%81%a7%e7%ae%a1%e7%90%86%e8%80%85%e6%a8%a9%e9%99%90%e3%81%a7%e5%8b%95%e3%81%84%e3%81%a6%e3%81%84%e3%82%8b%e3%81%8b%e3%81%a9%e3%81%86%e3%81%8b%e3%81%ae%e3%83%81","status":"publish","type":"post","link":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5191","title":{"rendered":"UAC \u74b0\u5883\u4e0b\u3067\u7ba1\u7406\u8005\u6a29\u9650\u3067\u52d5\u3044\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306e\u30c1\u30a7\u30c3\u30af (Windows\/Win32API)"},"content":{"rendered":"<p>Windows Vista \u4ee5\u964d\u306b\u306f\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u5236\u5fa1 (UAC: User Account Control) \u3068\u3044\u3046\u6a5f\u80fd\u304c\u3042\u3063\u3066\u3001\u6709\u52b9\u3060\u3068 Administrators \u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3057\u3066\u3044\u3066\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u7ba1\u7406\u8005\u6a29\u9650\u306f\u4f7f\u3048\u305a\u3001\u660e\u793a\u7684\u306b\u6607\u683c\u3059\u308b\u3053\u3068\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u6709\u52b9\uff09<\/p>\n<p><!--more--><\/p>\n<p>\u3055\u3066\u3001\u7ba1\u7406\u8005\u6a29\u9650\u3067\u52d5\u3044\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3067\u3059\u304c\u3001\u4f8b\u3048\u3070\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3060\u3068\u30bf\u30a4\u30c8\u30eb\u30d0\u30fc\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/umezawa.dyndns.info\/wordpress\/wp-content\/uploads\/2014\/12\/uac_cmdexe.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/umezawa.dyndns.info\/wordpress\/wp-content\/uploads\/2014\/12\/uac_cmdexe.png\" alt=\"\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u7ba1\u7406\u8005\u6a29\u9650\u72b6\u614b\u8868\u793a\" width=\"320\" height=\"240\" class=\"alignnone size-full wp-image-5195\" \/><\/a><\/p>\n<p>\u3064\u307e\u308a\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>UAC \u304c\u5185\u90e8\u7684\u306b\u3069\u3046\u3044\u3046\u5b9f\u88c5\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u306f\u7f6e\u3044\u3068\u3044\u3066\u3001\u7ba1\u7406\u8005\u6a29\u9650\u3067\u52d5\u3044\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306f\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<blockquote>\n<pre>static const char *typestr[] = { \"undef\", \"default\", \"full\", \"limited\" };\r\n\r\nint main(int argc, char **argv)\r\n{\r\n    HANDLE hToken;\r\n    TOKEN_ELEVATION elevation;\r\n    TOKEN_ELEVATION_TYPE elevtype;\r\n    DWORD cb;\r\n\r\n    OpenProcessToken(GetCurrentProcess(), GENERIC_READ, &hToken);\r\n\r\n    GetTokenInformation(hToken, TokenElevation, &elevation, sizeof(elevation), &cb);\r\n    printf(\"Token is %s\\n\", elevation.TokenIsElevated ? \"elevated\" : \"not elevated\");\r\n\r\n    GetTokenInformation(hToken, TokenElevationType, &elevtype, sizeof(elevtype), &cb);\r\n    printf(\"Token elevation type is %s\\n\", typestr[elevtype]);\r\n\r\n    CloseHandle(hToken);\r\n\r\n    return 0;\r\n}<\/pre>\n<\/blockquote>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u203b\u6ce8: Windows 7 \u3067\u3057\u304b\u8a66\u3057\u3066\u3044\u307e\u305b\u3093\uff09<\/p>\n<table border=\"frame\" rules=\"all\">\n<tr>\n<td><\/td>\n<td><\/td>\n<td>UAC \u6709\u52b9<\/td>\n<td>UAC \u7121\u52b9<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">\u7ba1\u7406\u8005\u30e6\u30fc\u30b6<\/td>\n<td>\u672a\u6607\u683c<\/td>\n<td>not elevated<br \/>type limited<\/td>\n<td>&#8211;<\/td>\n<\/tr>\n<tr>\n<td>\u6607\u683c<\/td>\n<td>elevated<br \/>type full<\/td>\n<td>elevated<br \/>type default<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\u4e00\u822c\u30e6\u30fc\u30b6<\/td>\n<td colspan=\"2\">not elevated<br \/>type default<\/td>\n<\/tr>\n<\/table>\n<p>\u3064\u307e\u308a\u3001<\/p>\n<ul>\n<li>\u7ba1\u7406\u8005\u6a29\u9650\u3092\u4f7f\u3048\u308b\u72b6\u614b\u3067\u3042\u308c\u3070 TokenElevation \u3067 TokenIsElevated \u304c TRUE \u306b\u306a\u308b\u3002<\/li>\n<li>\u6607\u683c\u304c\u3067\u304d\u306a\u3044or\u4e0d\u8981\u3067\u3042\u308b\u72b6\u614b\u3067\u3042\u308c\u3070 TokenElevationType \u304c TokenElevationTypeDefault\u306b\u306a\u308b\u3002<\/li>\n<li>\u6607\u683c\u304c\u5fc5\u8981\u306a\u306e\u306b\u6607\u683c\u3057\u3066\u3044\u306a\u3044\u72b6\u614b\u3067\u3042\u308c\u3070 TokenElevationTypeLimited\u3001\u6607\u683c\u3057\u3066\u3044\u308b\u72b6\u614b\u3067\u3042\u308c\u3070 TokenElevationTypeFull\u306b\u306a\u308b\u3002<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows Vista \u4ee5\u964d\u306b\u306f\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u5236\u5fa1 (UAC: User Account Control) \u3068\u3044\u3046\u6a5f\u80fd\u304c\u3042\u3063\u3066\u3001\u6709\u52b9\u3060\u3068 Administrators \u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3057\u3066\u3044\u3066\u3082\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u7ba1\u7406\u8005\u6a29 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-5191","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5191"}],"version-history":[{"count":10,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5191\/revisions"}],"predecessor-version":[{"id":5202,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5191\/revisions\/5202"}],"wp:attachment":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5191"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}