* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <config.h>
-#include "libserialport.h"
#include "libserialport_internal.h"
/* USB path is a string of at most 8 decimal numbers < 128 separated by dots. */
desc_req->SetupPacket.wValue = (USB_STRING_DESCRIPTOR_TYPE << 8)
| descriptor_index;
desc_req->SetupPacket.wIndex = 0;
- desc_req->SetupPacket.wLength = size - sizeof(*desc_req);
+ desc_req->SetupPacket.wLength = (USHORT) (size - sizeof(*desc_req));
if (!DeviceIoControl(hub_device,
IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION,
return;
strcpy(device_name, "\\\\.\\");
strcat(device_name, hub_name);
- hub_device = CreateFile(device_name, GENERIC_WRITE, FILE_SHARE_WRITE,
- NULL, OPEN_EXISTING, 0, NULL);
+ hub_device = CreateFileA(device_name, GENERIC_WRITE, FILE_SHARE_WRITE,
+ NULL, OPEN_EXISTING, 0, NULL);
free(device_name);
if (hub_device == INVALID_HANDLE_VALUE)
return;
if (!(escaped_port_name = malloc(strlen(port->name) + 5)))
RETURN_ERROR(SP_ERR_MEM, "Escaped port name malloc failed");
sprintf(escaped_port_name, "\\\\.\\%s", port->name);
- handle = CreateFile(escaped_port_name, GENERIC_READ, 0, 0,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, 0);
+ handle = CreateFileA(escaped_port_name, GENERIC_READ, 0, 0,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, 0);
free(escaped_port_name);
CloseHandle(handle);