?
Solved

createfile for mapped units?

Posted on 2003-03-03
3
Medium Priority
?
359 Views
Last Modified: 2012-05-04
Hello ,

I'm able to run suscessfully CreateFile windows function if I try to open a local drive

nv[]="\\\\.\\C:";

hVolume = CreateFile(
         volume_name,    
         GENERIC_READ | GENERIC_WRITE,
         FILE_SHARE_READ | FILE_SHARE_WRITE,
         NULL,    
         OPEN_EXISTING,
         0,    
         NULL);

but I can not do it (I get error) if I try to do the same with a mapped unit (net use z: \\xxxxxxxxxx and after CreateFile for Z:)


Any help ?

Thank you


0
Comment
Question by:aguiral
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 46

Accepted Solution

by:
Kent Olsen earned 80 total points
ID: 8056850

I've never been fan of "one size fits all" APIs and "CreateFile" certainly falls into this category.

Try the FileCreate() or "FileOpen() APIs.  IIRC, they use a different handle structure than does CreateFile() so you might also have to change the APIs that you're using to access the handle.

Kdo
0
 
LVL 20

Expert Comment

by:jmcg
ID: 10058647
Nothing has happened on this question in more than 10 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by Kdo [grade B] (partway on the road to a solution).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question