Guest_imported
New member
- Jan 1, 1970
- 0
Hi,
Can anyone tell me how to use Win32Api in cobol, I am using Fujitsu Cobol.
What I am trying to do is use CreateDirectory Function. Can anyone tell me how to use that.
Following is what Win32Api help file says
BOOL CreateDirectory(
LPCTSTR lpPathName, // pointer to a directory path string
LPSECURITY_ATTRIBUTES lpSecurityAttributes // pointer to a security descriptor
);
Parameters
lpPathName
Points to a null-terminated string that specifies the path of the directory to be created.
There is a default string size limit for paths of MAX_PATH characters. This limit is related to how the CreateDirectory function parses paths.
Windows NT: An application can transcend this limit and send in paths longer than MAX_PATH characters by calling the wide (W) version of CreateDirectory and prepending "\\?\" to the path. The "\\?\" tells the function to turn off path parsing; it lets paths longer than MAX_PATH be used with CreateDirectoryW. This also works with UNC names. The "\\?\" is ignored as part of the path. For example, "\\?\C:\myworld\private" is seen as "C:\myworld\private", and "
\\?\UNC\bill_g_1\hotstuff\coolapps" is seen as "\\bill_g_1\hotstuff\coolapps".
lpSecurityAttributes
Pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If lpSecurityAttributes is NULL, the handle cannot be inherited.
Windows NT: The lpSecurityDescriptor member of the structure specifies a security descriptor for the new directory. If lpSecurityAttributes is NULL, the directory gets a default security descriptor. The target file system must support security on files and directories for this parameter to have an effect.
Windows 95: The lpSecurityDescriptor member of the structure is ignored.
===========================================================
My problem is I don't know how to point to SECURITY_ATTRIBUTES Structure Can anyone help. The Security Attribute structre is declared as follows.
typedef struct _SECURITY_ATTRIBUTES { // sa
DWORD nLength;
LPVOID lpSecurityDescriptor;
BOOL bInheritHandle;
} SECURITY_ATTRIBUTES;
I couldn't find any information anywhere. Please help.
Thanks .
Can anyone tell me how to use Win32Api in cobol, I am using Fujitsu Cobol.
What I am trying to do is use CreateDirectory Function. Can anyone tell me how to use that.
Following is what Win32Api help file says
BOOL CreateDirectory(
LPCTSTR lpPathName, // pointer to a directory path string
LPSECURITY_ATTRIBUTES lpSecurityAttributes // pointer to a security descriptor
);
Parameters
lpPathName
Points to a null-terminated string that specifies the path of the directory to be created.
There is a default string size limit for paths of MAX_PATH characters. This limit is related to how the CreateDirectory function parses paths.
Windows NT: An application can transcend this limit and send in paths longer than MAX_PATH characters by calling the wide (W) version of CreateDirectory and prepending "\\?\" to the path. The "\\?\" tells the function to turn off path parsing; it lets paths longer than MAX_PATH be used with CreateDirectoryW. This also works with UNC names. The "\\?\" is ignored as part of the path. For example, "\\?\C:\myworld\private" is seen as "C:\myworld\private", and "
\\?\UNC\bill_g_1\hotstuff\coolapps" is seen as "\\bill_g_1\hotstuff\coolapps".
lpSecurityAttributes
Pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If lpSecurityAttributes is NULL, the handle cannot be inherited.
Windows NT: The lpSecurityDescriptor member of the structure specifies a security descriptor for the new directory. If lpSecurityAttributes is NULL, the directory gets a default security descriptor. The target file system must support security on files and directories for this parameter to have an effect.
Windows 95: The lpSecurityDescriptor member of the structure is ignored.
===========================================================
My problem is I don't know how to point to SECURITY_ATTRIBUTES Structure Can anyone help. The Security Attribute structre is declared as follows.
typedef struct _SECURITY_ATTRIBUTES { // sa
DWORD nLength;
LPVOID lpSecurityDescriptor;
BOOL bInheritHandle;
} SECURITY_ATTRIBUTES;
I couldn't find any information anywhere. Please help.
Thanks .