From: wangxj@i-net.com.cn Sent: Thursday, July 12, 2001 4:58 AM To: NT Developers Interest List Subject: [ntdev] Re: a viatual com port driver Yea,I have done, my code is the bellow: UNICODE_STRING DevName; RtlZeroMemory(&DevName, sizeof(UNICODE_STRING)); DevName.MaximumLength = 128 * sizeof(WCHAR); DevName.Buffer = (unsigned short*)ExAllocatePool(PagedPool, DevName.MaximumLength+sizeof(WCHAR)); if (DevName.Buffer == NULL) { return STATUS_INSUFFICIENT_RESOURCES; } RtlZeroMemory(DevName.Buffer, DevName.MaximumLength + sizeof(WCHAR)); RtlAppendUnicodeToString(&DevName, L"\\Device\\VirCom"); status = IoCreateDevice (DriverObject, sizeof(VIRCOM_DEVICE_EXTENSION), &DevName, FILE_DEVICE_SERIAL_PORT, FILE_DEVICE_SECURE_OPEN, TRUE, &fdo); if( !NT_SUCCESS(status)) return status; // Remember fdo in our device extension PWDM1_DEVICE_EXTENSION dx = (PWDM1_DEVICE_EXTENSION)fdo->DeviceExtension; dx->fdo = fdo; DebugPrint("FDO is %x",fdo); dx->ifSymLinkName.MaximumLength = DevName.Length + sizeof(WCHAR); dx->ifSymLinkName.Buffer = (unsigned short *) ExAllocatePool(PagedPool, DevName.MaximumLength + sizeof(WCHAR)); if(!dx->ifSymLinkName.Buffer) { DebugPrint("Error: Couldn't allocate memory for dx->ifSymLinkName!"); status = STATUS_INSUFFICIENT_RESOURCES; return status; } RtlZeroMemory(dx->ifSymLinkName.Buffer,dx->ifSymLinkName.MaximumLength); RtlAppendUnicodeToString(&dx->ifSymLinkName, L"\\DosDevices\\Com"); status = IoCreateSymbolicLink (&dx->ifSymLinkName, &DevName); if (!NT_SUCCESS(status)) { DebugPrint("Error: IoCreateSymbolicLink Failed, ErrCode = %x",status); IoDeleteDevice(fdo); return status; } But it still not work, What wrong with me? Thanks in advance! Best regards misshome --- You are currently subscribed to ntdev as: GlennEverhart@FirstUSA.com To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com