| 1218 | } |
| 1219 | |
| 1220 | int cmdInstall(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[]) |
| 1221 | /*++ |
| 1222 | |
| 1223 | Routine Description: |
| 1224 | |
| 1225 | CREATE |
| 1226 | Creates a root enumerated devnode and installs drivers on it |
| 1227 | |
| 1228 | Arguments: |
| 1229 | |
| 1230 | BaseName - name of executable |
| 1231 | Machine - machine name, must be NULL |
| 1232 | argc/argv - remaining parameters |
| 1233 | |
| 1234 | Return Value: |
| 1235 | |
| 1236 | EXIT_xxxx |
| 1237 | |
| 1238 | --*/ |
| 1239 | { |
| 1240 | HDEVINFO DeviceInfoSet = INVALID_HANDLE_VALUE; |
| 1241 | SP_DEVINFO_DATA DeviceInfoData; |
| 1242 | GUID ClassGUID; |
| 1243 | TCHAR ClassName[MAX_CLASS_NAME_LEN]; |
| 1244 | TCHAR hwIdList[LINE_LEN+4]; |
| 1245 | TCHAR InfPath[MAX_PATH]; |
| 1246 | int failcode = EXIT_FAIL; |
| 1247 | LPCTSTR hwid = NULL; |
| 1248 | LPCTSTR inf = NULL; |
| 1249 | |
| 1250 | if(Machine) { |
| 1251 | // |
| 1252 | // must be local machine |
| 1253 | // |
| 1254 | return EXIT_USAGE; |
| 1255 | } |
| 1256 | if(argc<2) { |
| 1257 | // |
| 1258 | // at least HWID required |
| 1259 | // |
| 1260 | return EXIT_USAGE; |
| 1261 | } |
| 1262 | inf = argv[0]; |
| 1263 | if(!inf[0]) { |
| 1264 | return EXIT_USAGE; |
| 1265 | } |
| 1266 | |
| 1267 | hwid = argv[1]; |
| 1268 | if(!hwid[0]) { |
| 1269 | return EXIT_USAGE; |
| 1270 | } |
| 1271 | |
| 1272 | // |
| 1273 | // Inf must be a full pathname |
| 1274 | // |
| 1275 | if(GetFullPathName(inf,MAX_PATH,InfPath,NULL) >= MAX_PATH) { |
| 1276 | // |
| 1277 | // inf pathname too long |
nothing calls this directly
no test coverage detected