Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

createfile for mapped units?

Posted on 2003-03-03
3
Medium Priority
?
368 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
2 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

Independent Software Vendors: 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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
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…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

578 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