FFFTPのソースコードです。
Revision | f8dc74e64bfd32eb561e76bc4f9435a82a012fbc (tree) |
---|---|
Time | 2014-06-21 20:45:30 |
Author | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Fix the commit.
@@ -0,0 +1,28 @@ | ||
1 | +// apiemulator.c | |
2 | +// Copyright (C) 2014 Suguru Kawamoto | |
3 | +// APIエミュレータ | |
4 | + | |
5 | +#include <windows.h> | |
6 | + | |
7 | +#define DO_NOT_REPLACE | |
8 | +#include "apiemulator.h" | |
9 | + | |
10 | +BOOL IsUserAnAdminAlternative() | |
11 | +{ | |
12 | + BOOL bResult; | |
13 | + SID_IDENTIFIER_AUTHORITY sia = SECURITY_NT_AUTHORITY; | |
14 | + PSID pSID; | |
15 | + BOOL b; | |
16 | + bResult = FALSE; | |
17 | + if(AllocateAndInitializeSid(&sia, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pSID)) | |
18 | + { | |
19 | + if(CheckTokenMembership(NULL, pSID, &b)) | |
20 | + { | |
21 | + if(b) | |
22 | + bResult = TRUE; | |
23 | + } | |
24 | + FreeSid(pSID); | |
25 | + } | |
26 | + return bResult; | |
27 | +} | |
28 | + |
@@ -0,0 +1,19 @@ | ||
1 | +// apiemulator.h | |
2 | +// Copyright (C) 2014 Suguru Kawamoto | |
3 | +// APIエミュレータ | |
4 | + | |
5 | +#ifndef __APIEMULATOR_H__ | |
6 | +#define __APIEMULATOR_H__ | |
7 | + | |
8 | +#include <windows.h> | |
9 | + | |
10 | +#ifndef DO_NOT_REPLACE | |
11 | + | |
12 | +#define IsUserAnAdmin IsUserAnAdminAlternative | |
13 | + | |
14 | +#endif | |
15 | + | |
16 | +BOOL IsUserAnAdminAlternative(); | |
17 | + | |
18 | +#endif | |
19 | + |