Weird game controller index

Hello there.

When i plug a DirectInput controller, i open it with index 0. If i plug another controller, it’s gonna open with index 1. Well, if it happens to be a XInput controller, it will have 0 for index as well. As a result, 2 controllers will share the same index. Is this normal? I arrange every gamepad based on it’s index, so any help would be nice.