| 8 | } |
| 9 | |
| 10 | mscorlib::_MethodInfoPtr DotNetInterop::GetStaticMethod(mscorlib::_TypePtr type, LPCWSTR methodName, int pcount) { |
| 11 | |
| 12 | LPSAFEARRAY methods = type->GetMethods_2(); |
| 13 | mscorlib::_MethodInfoPtr ret; |
| 14 | LONG methodCount = GetSafeArrayLen(methods); |
| 15 | |
| 16 | for (long i = 0; i < methodCount; ++i) |
| 17 | { |
| 18 | IUnknown* v = nullptr; |
| 19 | |
| 20 | if (SUCCEEDED(SafeArrayGetElement(methods, &i, &v))) |
| 21 | { |
| 22 | mscorlib::_MethodInfoPtr method = v; |
| 23 | bstr_t name = method->Getname(); |
| 24 | LPSAFEARRAY params = method->GetParameters(); |
| 25 | long paramCount = GetSafeArrayLen(params); |
| 26 | |
| 27 | if (method->IsStatic && wcscmp(name.GetBSTR(), methodName) == 0 && paramCount == pcount) |
| 28 | { |
| 29 | ret = method; |
| 30 | break; |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | SafeArrayDestroy(methods); |
| 36 | |
| 37 | return ret; |
| 38 | } |
| 39 | |
| 40 | mscorlib::_MethodInfoPtr DotNetInterop::GetStaticMethodLoad(mscorlib::_TypePtr type, LPCWSTR methodName, int pcount) { |
| 41 |
nothing calls this directly
no test coverage detected