------------------------------------------------------------------------------------ Returns parameter type and name for a specified parameter of a function in a api file ------------------------------------------------------------------------------------
| 1938 | // Returns parameter type and name for a specified parameter of a function in a api file |
| 1939 | // ------------------------------------------------------------------------------------ |
| 1940 | bool GetFunctionParam(LPSTR lpszApiModule, string lpszApiFunction, duint dwParamNo, LPSTR lpszApiFunctionParameter) |
| 1941 | { |
| 1942 | const string argument[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24" }; |
| 1943 | |
| 1944 | if (lpszApiModule == NULL || lpszApiFunction.length() == 0 || dwParamNo > 24) |
| 1945 | { |
| 1946 | *lpszApiFunctionParameter = 0; |
| 1947 | return false; |
| 1948 | } |
| 1949 | |
| 1950 | if (apiDefPointer != apiFiles.end()) |
| 1951 | { |
| 1952 | string apiParameter = apiDefPointer->second->GetValue(lpszApiFunction, argument[dwParamNo - 1]); |
| 1953 | // check if key is found |
| 1954 | if (!apiParameter.empty()) |
| 1955 | { |
| 1956 | strcpy_s(lpszApiFunctionParameter, MAX_COMMENT_SIZE, apiParameter.c_str()); // save the API parameter |
| 1957 | return true; |
| 1958 | } |
| 1959 | } |
| 1960 | |
| 1961 | *lpszApiFunctionParameter = 0; |
| 1962 | return false; |
| 1963 | } |
| 1964 | |
| 1965 | // ------------------------------------------------------------------------------------ |
| 1966 | // Returns true if the specified string is a valid hex value |