mirror of
https://github.com/reactos/reactos.git
synced 2024-09-06 02:37:06 +00:00
[WIN32CSR]
Add a new API GetTempFile() that returns an identifier to be used for creating temporary files. This API should be in basesrv.dll svn path=/trunk/; revision=50835
This commit is contained in:
parent
f59aa17010
commit
43a5ab1712
|
@ -511,7 +511,12 @@ typedef struct
|
||||||
DWORD NumberOfHistoryBuffers;
|
DWORD NumberOfHistoryBuffers;
|
||||||
DWORD dwFlags;
|
DWORD dwFlags;
|
||||||
} CSRSS_GET_HISTORY_INFO, *PCSRSS_GET_HISTORY_INFO,
|
} CSRSS_GET_HISTORY_INFO, *PCSRSS_GET_HISTORY_INFO,
|
||||||
CSRSS_SET_HISTORY_INFO, *PCSRSS_SET_HISTORY_INFO;
|
CSRSS_SET_HISTORY_INFO, *PCSRSS_SET_HISTORY_INFO;;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
UINT UniqueID;
|
||||||
|
} CSRSS_GET_TEMP_FILE, *PCSRSS_GET_TEMP_FILE;
|
||||||
|
|
||||||
#define CSR_API_MESSAGE_HEADER_SIZE(Type) (FIELD_OFFSET(CSR_API_MESSAGE, Data) + sizeof(Type))
|
#define CSR_API_MESSAGE_HEADER_SIZE(Type) (FIELD_OFFSET(CSR_API_MESSAGE, Data) + sizeof(Type))
|
||||||
#define CSRSS_MAX_WRITE_CONSOLE (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE))
|
#define CSRSS_MAX_WRITE_CONSOLE (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE))
|
||||||
|
@ -592,6 +597,7 @@ typedef struct
|
||||||
#define SET_HISTORY_NUMBER_COMMANDS (0x45)
|
#define SET_HISTORY_NUMBER_COMMANDS (0x45)
|
||||||
#define GET_HISTORY_INFO (0x46)
|
#define GET_HISTORY_INFO (0x46)
|
||||||
#define SET_HISTORY_INFO (0x47)
|
#define SET_HISTORY_INFO (0x47)
|
||||||
|
#define GET_TEMP_FILE (0x48)
|
||||||
|
|
||||||
/* Keep in sync with definition below. */
|
/* Keep in sync with definition below. */
|
||||||
#define CSRSS_HEADER_SIZE (sizeof(PORT_MESSAGE) + sizeof(ULONG) + sizeof(NTSTATUS))
|
#define CSRSS_HEADER_SIZE (sizeof(PORT_MESSAGE) + sizeof(ULONG) + sizeof(NTSTATUS))
|
||||||
|
@ -673,6 +679,7 @@ typedef struct _CSR_API_MESSAGE
|
||||||
CSRSS_SET_HISTORY_NUMBER_COMMANDS SetHistoryNumberCommands;
|
CSRSS_SET_HISTORY_NUMBER_COMMANDS SetHistoryNumberCommands;
|
||||||
CSRSS_GET_HISTORY_INFO GetHistoryInfo;
|
CSRSS_GET_HISTORY_INFO GetHistoryInfo;
|
||||||
CSRSS_SET_HISTORY_INFO SetHistoryInfo;
|
CSRSS_SET_HISTORY_INFO SetHistoryInfo;
|
||||||
|
CSRSS_GET_TEMP_FILE GetTempFile;
|
||||||
} Data;
|
} Data;
|
||||||
} CSR_API_MESSAGE, *PCSR_API_MESSAGE;
|
} CSR_API_MESSAGE, *PCSR_API_MESSAGE;
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ static CSRSS_API_DEFINITION Win32CsrApiDefinitions[] =
|
||||||
CSRSS_DEFINE_API(SET_HISTORY_NUMBER_COMMANDS, CsrSetHistoryNumberCommands),
|
CSRSS_DEFINE_API(SET_HISTORY_NUMBER_COMMANDS, CsrSetHistoryNumberCommands),
|
||||||
CSRSS_DEFINE_API(GET_HISTORY_INFO, CsrGetHistoryInfo),
|
CSRSS_DEFINE_API(GET_HISTORY_INFO, CsrGetHistoryInfo),
|
||||||
CSRSS_DEFINE_API(SET_HISTORY_INFO, CsrSetHistoryInfo),
|
CSRSS_DEFINE_API(SET_HISTORY_INFO, CsrSetHistoryInfo),
|
||||||
|
CSRSS_DEFINE_API(GET_TEMP_FILE, CsrGetTempFile),
|
||||||
{ 0, 0, NULL }
|
{ 0, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
33
reactos/subsystems/win32/csrss/win32csr/file.c
Normal file
33
reactos/subsystems/win32/csrss/win32csr/file.c
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PROJECT: ReactOS system libraries
|
||||||
|
* FILE: subsys/csrss/win32csr/file.c
|
||||||
|
* PURPOSE: File handling
|
||||||
|
* PROGRAMMERS: Pierre Schweitzer (pierre.schweitzer@reactos.org)
|
||||||
|
* NOTE: Belongs to basesrv.dll
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
|
#include <w32csr.h>
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
UINT CsrGetTempFileUnique;
|
||||||
|
|
||||||
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
CSR_API(CsrGetTempFile)
|
||||||
|
{
|
||||||
|
DPRINT1("CsrGetTempFile entered\n");
|
||||||
|
|
||||||
|
/* Return 16-bits ID */
|
||||||
|
Request->Data.GetTempFile.UniqueID = (++CsrGetTempFileUnique & 0xFFFF);
|
||||||
|
|
||||||
|
DPRINT1("Returning: %u\n", Request->Data.GetTempFile.UniqueID);
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
17
reactos/subsystems/win32/csrss/win32csr/file.h
Normal file
17
reactos/subsystems/win32/csrss/win32csr/file.h
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PROJECT: ReactOS system libraries
|
||||||
|
* FILE: subsystem/win32/csrss/win32csr/file.h
|
||||||
|
* PURPOSE: File handling
|
||||||
|
* PROGRAMMERS: Pierre Schweitzer (pierre.schweitzer@reactos.org)
|
||||||
|
* NOTE: Belongs to basesrv.dll
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "api.h"
|
||||||
|
|
||||||
|
/* Api functions */
|
||||||
|
CSR_API(CsrGetTempFile);
|
||||||
|
|
||||||
|
/* EOF */
|
|
@ -18,6 +18,7 @@
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#include <csrplugin.h>
|
#include <csrplugin.h>
|
||||||
#include <desktopbg.h>
|
#include <desktopbg.h>
|
||||||
|
#include "file.h"
|
||||||
#include "guiconsole.h"
|
#include "guiconsole.h"
|
||||||
#include "tuiconsole.h"
|
#include "tuiconsole.h"
|
||||||
#include <win32csr.h>
|
#include <win32csr.h>
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
<file>desktopbg.c</file>
|
<file>desktopbg.c</file>
|
||||||
<file>dllmain.c</file>
|
<file>dllmain.c</file>
|
||||||
<file>exitros.c</file>
|
<file>exitros.c</file>
|
||||||
|
<file>file.c</file>
|
||||||
<file>guiconsole.c</file>
|
<file>guiconsole.c</file>
|
||||||
<file>handle.c</file>
|
<file>handle.c</file>
|
||||||
<file>harderror.c</file>
|
<file>harderror.c</file>
|
||||||
|
|
Loading…
Reference in a new issue