source: trunk/src/kernel32/stubs.cpp@ 7555

Last change on this file since 7555 was 7555, checked in by sandervl, 24 years ago

partly implemented FindFirstFileExA/W

File size: 67.2 KB
Line 
1/* $Id: stubs.cpp,v 1.36 2001-12-06 10:14:45 sandervl Exp $
2 *
3 * Win32 KERNEL32 Subsystem for OS/2
4 *
5 * 1998/05/19 PH Patrick Haller (haller@zebra.fh-weingarten.de)
6 *
7 * @(#) Stubs.H 1.0.0 1998/05/19 PH start
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12
13/*****************************************************************************
14 * Includes *
15 *****************************************************************************/
16#include <os2win.h>
17#include <winnls.h>
18#include "unicode.h"
19#include "handlemanager.h"
20#include <string.h>
21
22#include "stubs.h"
23
24#define DBG_LOCALLOG DBG_stubs
25#include "dbglocal.h"
26
27
28/*****************************************************************************
29 * Defines *
30 *****************************************************************************/
31
32
33// For Backup functions
34
35//
36// Stream Ids
37//
38
39#define BACKUP_INVALID 0x00000000
40#define BACKUP_DATA 0x00000001
41#define BACKUP_EA_DATA 0x00000002
42#define BACKUP_SECURITY_DATA 0x00000003
43#define BACKUP_ALTERNATE_DATA 0x00000004
44#define BACKUP_LINK 0x00000005
45#define BACKUP_PROPERTY_DATA 0x00000006
46
47//
48// Stream Attributes
49//
50
51#define STREAM_NORMAL_ATTRIBUTE 0x00000000
52#define STREAM_MODIFIED_WHEN_READ 0x00000001
53#define STREAM_CONTAINS_SECURITY 0x00000002
54#define STREAM_CONTAINS_PROPERTIES 0x00000004
55
56
57// Locale
58#define LCID DWORD
59
60/*
61 * Locale Dependent Mapping Flags.
62 */
63
64#define LCMAP_LOWERCASE 0x00000100 /* lower case letters */
65#define LCMAP_UPPERCASE 0x00000200 /* upper case letters */
66#define LCMAP_SORTKEY 0x00000400 /* WC sort key (normalize) */
67#define LCMAP_BYTEREV 0x00000800 /* byte reversal */
68
69#define LCMAP_HIRAGANA 0x00100000 /* map katakana to hiragana */
70#define LCMAP_KATAKANA 0x00200000 /* map hiragana to katakana */
71#define LCMAP_HALFWIDTH 0x00400000 /* map double byte to single byte */
72#define LCMAP_FULLWIDTH 0x00800000 /* map single byte to double byte */
73
74#define LCMAP_LINGUISTIC_CASING 0x01000000 /* use linguistic rules for casing */
75
76#define LCMAP_SIMPLIFIED_CHINESE 0x02000000 /* map traditional chinese to simplified chinese */
77#define LCMAP_TRADITIONAL_CHINESE 0x04000000 /* map simplified chinese to traditional chinese */
78
79
80
81/*
82 * Locale Enumeration Flags.
83 */
84#define LCID_INSTALLED 0x00000001 /* installed locale ids */
85#define LCID_SUPPORTED 0x00000002 /* supported locale ids */
86
87
88
89
90/*****************************************************************************
91 * Structures *
92 *****************************************************************************/
93
94 // For Backup funtions
95
96typedef struct _WIN32_STREAM_ID {
97
98 DWORD dwStreamId;
99 DWORD dwStreamAttributes;
100 LARGE_INTEGER Size;
101 DWORD dwStreamNameSize;
102// WCHAR cStreamName[ ] ; /* @@@PH */
103 WCHAR cStreamName[1] ;
104} WIN32_STREAM_ID;
105
106
107//
108// File structures
109//
110
111//typedef struct _OVERLAPPED {
112// DWORD Internal;
113// DWORD InternalHigh;
114// DWORD Offset;
115// DWORD OffsetHigh;
116// HANDLE hEvent;
117//} OVERLAPPED, *LPOVERLAPPED;
118
119//typedef struct _SECURITY_ATTRIBUTES {
120// DWORD nLength;
121// LPVOID lpSecurityDescriptor;
122// BOOL bInheritHandle;
123//} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
124
125//typedef struct _PROCESS_INFORMATION {
126// HANDLE hProcess;
127// HANDLE hThread;
128// DWORD dwProcessId;
129// DWORD dwThreadId;
130//} PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
131
132// For Fiber functions
133
134typedef VOID (WINAPI *PFIBER_START_ROUTINE)(
135 LPVOID lpFiberParameter
136 );
137typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE;
138
139// For Enum CalendarInfo & EnumSystemCodePages see winnls.h
140
141/*
142 * Calendar type constant.
143 */
144typedef DWORD CALTYPE;
145
146/*
147 * Calendar ID.
148 */
149typedef DWORD CALID;
150
151
152/*****************************************************************************
153 * Prototypes *
154 *****************************************************************************/
155
156void WIN32API CommonUnimpStub()
157{
158 dprintf(("STUB: KERNEL32.17!!"));
159}
160
161/*****************************************************************************
162 * Name : BOOL WIN32API AreFileApisANSI (VOID)
163 * Purpose : The AreFileApisANSI function determines whether a set of Win32
164 * file functions is using the ANSI or OEM character set code page.
165 * This function is useful for 8-bit console input and output
166 * operations.
167 * Parameters: NONE
168 * Variables :
169 * Result : If the set of Win32 file functions is using the ANSI code page,
170 * the return value is nonzero.
171 * If the set of Win32 file functions is using the OEM code page,
172 * the return value is zero.
173 * Remark :
174 * Status : UNTESTED STUB
175 *
176 * Author : Markus Montkowski [Thu, 1998/02/19 11:46]
177 *****************************************************************************/
178
179BOOL WIN32API AreFileApisANSI (VOID)
180{
181
182 dprintf(("KERNEL32:AreFileApisANSI() not implemented - TRUE\n"
183 ));
184
185 return (TRUE);
186}
187
188/*****************************************************************************
189 * Name : BOOL WIN32API BackupRead(
190 * Purpose : The BackupRead function reads data associated with a specified
191 * file or directory into a buffer. You use this function to back
192 * up a file or directory.
193 * Parameters: HANDLE hFile handle to file or directory
194 * LPBYTE lpBuffer pointer to buffer to read to
195 * DWORD nNumberOfBytesToRead number of bytes to read
196 * LPDWORD lpNumberOfBytesRead pointer to variable to receive
197 * number of bytes read
198 * BOOL bAbort termination type
199 * BOOL bProcessSecurity process security flag
200 * LPVOID *lpContext pointer to pointer to internal
201 * context information
202 * Variables :
203 * Result : 0 on Error Nonzero if OK
204 * Remark : BackupRead processes all of the data pertaining to an opened
205 * object as a series of discrete byte streams. Each stream is
206 * preceded by a 32-bit aligned WIN32_STREAM_ID structure.
207 * Streams must be processed in the same order in which they were
208 * written to the tape. This ordering enables applications to
209 * compare the data backed up against the data on the source device.
210 * The data returned by BackupRead is to be used only as input to
211 * the BackupWrite function. This data is returned as one large data
212 * stream divided into substreams. The substreams are separated
213 * by WIN32_STREAM_ID headers.
214 *
215 * If an error occurs while BackupRead is reading, the calling
216 * process can skip the bad data by calling the BackupSeek function.
217 * Status : UNTESTED STUB
218 *
219 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
220 *****************************************************************************/
221
222BOOL WIN32API BackupRead(
223 HANDLE hFile, // handle to file or directory
224 LPBYTE lpBuffer, // pointer to buffer to read to
225 DWORD nNumberOfBytesToRead, // number of bytes to read
226 LPDWORD lpNumberOfBytesRead, // pointer to variable to receive number of bytes read
227 BOOL bAbort, // termination type
228 BOOL bProcessSecurity, // process security flag
229 LPVOID *lpContext // pointer to pointer to internal context information
230)
231{
232
233 dprintf(("KERNEL32:BackupRead(%08x,%08x,%08x,%08x,%08x,%08x,%08x) not implemented\n",
234 hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead,
235 bAbort, bProcessSecurity, lpContext
236 ));
237
238 return (FALSE);
239}
240/*****************************************************************************
241 * Name : BOOL WIN32API BackupSeek()
242 * Purpose : The BackupSeek function seeks forward in a data stream initially
243 * accessed by using the BackupRead or BackupWrite function.
244 * Parameters: HANDLE hFile handle to open file
245 * DWORD dwLowBytesToSeek low-order 32 bits of number of bytes
246 * DWORD dwHighBytesToSeek high-order 32 bits of number of bytes
247 * LPDWORD lpdwLowByteSeeked pointer to number of bytes function seeks
248 * LPDWORD lpdwHighByteSeeked pointer to number of bytes function seeks
249 * LPVOID *lpContext pointer to internal context information
250 *
251 * Variables :
252 * Result : If the function could seek the requested amount, the function
253 * returns nonzero.
254 * If the function could not seek the requested amount, the function
255 * returns zero.
256 * Remark : Applications use the BackUpSeek function to skip portions of a
257 * data stream that cause errors. This function does not seek across
258 * stream headers. If an application attempts to seek past the end
259 * of a substream, the function fails, the lpdwLowByteSeeked and
260 * lpdwHighByteSeeked parameters indicate the actual number of bytes
261 * the function seeks, and the file position is placed at the start
262 * of the next stream header.
263 * Status : UNTESTED STUB
264 *
265 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
266 *****************************************************************************/
267
268BOOL WIN32API BackupSeek( HANDLE hFile, DWORD dwLowBytesToSeek,
269 DWORD dwHighBytesToSeek,
270 LPDWORD lpdwLowByteSeeked,
271 LPDWORD lpdwHighByteSeeked,LPVOID *lpContext)
272{
273
274 dprintf(("KERNEL32:BackupSeek(%08x,%08x,%08x,%08x,%08x,08x) not implemented\n",
275 hFile, dwLowBytesToSeek,dwHighBytesToSeek,
276 lpdwLowByteSeeked, lpdwHighByteSeeked, lpContext));
277
278 return (FALSE);
279}
280
281/*****************************************************************************
282 * Name : BOOL WIN32API BackupWrite
283 * Purpose : The BackupWrite function writes a stream of data from a buffer to
284 * a specified file or directory. The data must be divided into
285 * substreams separated by WIN32_STREAM_ID structures. You use this
286 * function to restore a file or directory that has been backed up.
287 * Parameters: HANDLE hFile handle to file or directory
288 * LPBYTE lpBuffer pointer to buffer containing data
289 * to write
290 * DWORD nNumberOfBytesToWrite number of bytes to write
291 * LPDWORD lpNumberOfBytesWritten pointer to variable to receive
292 * number of bytes written
293 * BOOL bAbort termination type
294 * BOOL bProcessSecurity process security
295 * LPVOID *lpContext pointer to pointer to internal
296 * context information
297 *
298 * Variables :
299 * Result : If the function succeeds, the return value is nonzero.
300 * If the function fails, the return value is zero,
301 * indicating that an I/O error occurred.
302 * To get extended error information, call GetLastError.
303 * Remark :
304 * Status : UNTESTED STUB
305 *
306 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
307 *****************************************************************************/
308
309BOOL WIN32API BackupWrite( HANDLE hFile, LPBYTE lpBuffer,
310 DWORD nNumberOfBytesToWrite,
311 LPDWORD lpNumberOfBytesWritten,
312 BOOL bAbort, BOOL bProcessSecurity,
313 LPVOID *lpContext)
314{
315
316 dprintf(("KERNEL32:BackupWrite(%08x,%0x8,%08x,%08x,%08x,%08x,%08x) not implemented\n",
317 hFile, lpBuffer, nNumberOfBytesToWrite,
318 lpNumberOfBytesWritten, bAbort, bProcessSecurity, lpContext));
319
320 return (FALSE);
321}
322
323/*****************************************************************************
324 * Name : HANDLE WIN32API BeginUpdateResourceA
325 * Purpose : The BeginUpdateResource function returns a handle that can be
326 * used by the UpdateResource function to add, delete, or replace
327 * resources in an executable file.
328 * Parameters: LPCSTR pFileName pointer to file in which to
329 * update resources
330 * BOOL bDeleteExistingResources deletion option
331 *
332 * Variables :
333 * Result : If the function succeeds, the return value is a handle that can
334 * be used by the UpdateResource and EndUpdateResource functions.
335 * The return value is NULL if the specified file is not an
336 * executable file, the executable file is already loaded,
337 * the file does not exist, or the file cannot be opened for writing.
338 * To get extended error information, call GetLastError
339 * Remark :
340 * Status : UNTESTED STUB
341 *
342 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
343 *****************************************************************************/
344
345HANDLE WIN32API BeginUpdateResourceA( LPCSTR pFileName,
346 BOOL bDeleteExistingResources)
347{
348
349 dprintf(("KERNEL32: BeginUpdateResource(%08x,%08x) not implemented\n",
350 pFileName, bDeleteExistingResources
351 ));
352
353 return (NULL);
354}
355
356/*****************************************************************************
357 * Name : HANDLE WIN32API BeginUpdateResourceW
358 * Purpose : The BeginUpdateResource function returns a handle that can be
359 * used by the UpdateResource function to add, delete, or replace
360 * resources in an executable file.
361 * Parameters: LPCWSTR pFileName pointer to file in which to
362 * update resources
363 * BOOL bDeleteExistingResources deletion option
364 *
365 * Variables :
366 * Result : If the function succeeds, the return value is a handle that can
367 * be used by the UpdateResource and EndUpdateResource functions.
368 * The return value is NULL if the specified file is not an
369 * executable file, the executable file is already loaded,
370 * the file does not exist, or the file cannot be opened for writing.
371 * To get extended error information, call GetLastError
372 * Remark :
373 * Status : UNTESTED STUB
374 *
375 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
376 *****************************************************************************/
377
378HANDLE WIN32API BeginUpdateResourceW( LPCWSTR pFileName,
379 BOOL bDeleteExistingResources)
380{
381
382 dprintf(("KERNEL32: BeginUpdateResource(%08x,%08x) not implemented\n",
383 pFileName, bDeleteExistingResources
384 ));
385
386 return (NULL);
387}
388
389/*****************************************************************************
390 * Name : BOOL CancelWaitableTimer
391 * Purpose : The CancelWaitableTimer function sets the specified "waitable"
392 * timer to the inactive state.
393 * Parameters: HANDLE hTimer handle to a timer object
394 * Variables :
395 * Result : If the function succeeds, the return value is nonzero.
396 * If the function fails, the return value is zero.
397 * To get extended error information, call GetLastError.
398 * Remark : The CancelWaitableTimer function does not change the signaled
399 * state of the timer. It stops the timer before it can be set to
400 * the signaled state. Therefore, threads performing a wait
401 * operation on the timer remain waiting until they time out or
402 * the timer is reactivated and its state is set to signaled.
403 *
404 * To reactivate the timer, call the SetWaitableTimer function.
405 * Status : UNTESTED STUB
406 *
407 * Author : Markus Montkowski [Thu, 1998/05/19 11:46]
408 *****************************************************************************/
409
410BOOL WIN32API CancelWaitableTimer(HANDLE hTimer)
411{
412
413 dprintf(("KERNEL32:CancelWaitableTimer(%08x) not implemented\n",
414 hTimer
415 ));
416
417 return (FALSE);
418}
419
420
421/*****************************************************************************
422 * Name : LPVOID WIN32API CreateFiber
423 * Purpose : The CreateFiber function allocates a fiber object, assigns it a
424 * stack, and sets up execution to begin at the specified
425 * start address, typically the fiber function.
426 * This function does not schedule the fiber.
427 * Parameters: DWORD dwStackSize initial thread stack size, in bytes
428 * LPFIBER_START_ROUTINE lpStartAddress pointer to fiber function
429 * LPVOID lpParameter argument for new fiber
430 * Variables :
431 * Result : If the function succeeds, the return value is the address of
432 * the fiber.
433 * If the function fails, the return value is NULL.
434 * Remark : Before a thread can schedule a fiber using the SwitchToFiber
435 * function, it must call the ConvertThreadToFiber function so there
436 * is a fiber associated with the thread.
437 * The fiber function is of type FIBER_START_ROUTINE.
438 * It accepts a single value of type PVOID (fiber data) and does not
439 * return a value. The prototype for this function is as follows:
440 *
441 * VOID WINAPI FiberFunc( PVOID lpParameter );
442 *
443 * Status : UNTESTED STUB
444 *
445 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
446 *****************************************************************************/
447
448LPVOID WIN32API CreateFiber( DWORD dwStackSize,
449 LPFIBER_START_ROUTINE lpStartAddress,
450 LPVOID lpParameter)
451{
452
453 dprintf(("KERNEL32:CreateFiber(%08x,%08x,%08x) not implemented\n",
454 dwStackSize, lpStartAddress,lpParameter
455 ));
456
457 return (NULL);
458}
459
460
461/*****************************************************************************
462 * Name : HANDLE WIN32API CreateIoCompletionPort
463 * Purpose : The CreateIoCompletionPort function can associate an instance of
464 * an opened file with a newly created or an existing input/output
465 * completion port; or it can create an input/output completion port
466 * without associating it with a file.
467 * Associating an instance of an opened file with an input/output
468 * completion port lets an application receive notification of the
469 * completion of asynchronous input/output operations involving that
470 * file.
471 * Parameters: HANDLE FileHandle file handle to associate with I/O
472 * completion port. Must be created
473 * with flag FILE_FLAG_OVERLAPPED !
474 * HANDLE ExistingCompletionPort optional handle to existing
475 * I/O completion port
476 * DWORD CompletionKey per-file completion key for
477 * I/O completion packets
478 * DWORD NumberOfConcurrentThreads number of threads allowed to
479 * execute concurrently
480 * Variables :
481 * Result : If the function succeeds, the return value is the handle to the
482 * I/O completion port that is associated with the specified file.
483 * This return value is not NULL.
484 * If the function fails, the return value is NULL.
485 * Remark : The Win32 I/O system can be instructed to send I/O completion
486 * notification packets to input/output completion ports, where they
487 * are queued up. The CreateIoCompletionPort function provides a
488 * mechanism for this.
489 * When you perform an input/output operation with a file handle
490 * that has an associated input/output completion port, the
491 * I/O system sends a completion notification packet to the
492 * completion port when the I/O operation completes.
493 * The I/O completion port places the completion packet in a
494 * first-in-first-out queue.
495 * Use the GetQueuedCompletionStatus function to retrieve these
496 * queued I/O completion packets.
497 * Threads in the same process can use the PostQueuedCompletionStatus
498 * function to place I/O completion notification packets in a
499 * completion port's queue. This allows you to use the port to
500 * receive communications from other threads of the process,
501 * in addition to receiving I/O completion notification packets
502 * from the Win32 I/O system.
503 * Status : UNTESTED STUB
504 *
505 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
506 *****************************************************************************/
507
508HANDLE WIN32API CreateIoCompletionPort( HANDLE FileHandle,
509 HANDLE ExistingCompletionPort,
510 DWORD CompletionKey,
511 DWORD NumberOfConcurrentThreads)
512{
513
514 dprintf(("KERNEL32: CreateIoCompletionPort(%08x,%08x,%08x,%08x) not implemented\n",
515 FileHandle, ExistingCompletionPort, CompletionKey,
516 NumberOfConcurrentThreads
517 ));
518
519 return (NULL);
520}
521
522/*****************************************************************************
523 * Name : HANDLE WIN32API CreateRemoteThread
524 * Purpose : The CreateRemoteThread function creates a thread that runs in
525 * the address space of another process.
526 * Parameters: HANDLE hProcess handle to process to create thread in
527 * LPSECURITY_ATTRIBUTES lpThreadAttributes pointer to thread
528 * security attributes
529 * DWORD dwStackSize initial thread stack size, in bytes
530 * LPTHREAD_START_ROUTINE lpStartAddress pointer to thread function
531 * LPVOID lpParameter pointer to argument for new thread
532 * DWORD dwCreationFlags creation flags
533 * LPDWORD lpThreadId pointer to returned thread identifier
534 * Variables :
535 * Result : If the function succeeds, the return value is a handle to
536 * the new thread.
537 * If the function fails, the return value is NULL.
538 * Remark :
539 * Status : UNTESTED STUB
540 *
541 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
542 *****************************************************************************/
543
544HANDLE WIN32API CreateRemoteThread( HANDLE hProcess,
545 LPSECURITY_ATTRIBUTES lpThreadAttributes,
546 DWORD dwStackSize,
547 LPTHREAD_START_ROUTINE lpStartAddress,
548 LPVOID lpParameter,DWORD dwCreationFlags,
549 LPDWORD lpThreadId )
550{
551
552 dprintf(("KERNEL32: CreateRemoteThread(%08x,%08x,%08x,%08x,%08x,%08x,%08x) not implemented\n",
553 hProcess, lpThreadAttributes, dwStackSize, lpStartAddress,
554 lpParameter, dwCreationFlags, lpThreadId
555 ));
556
557 return (NULL);
558}
559/*****************************************************************************
560 * Name : DWORD WIN32API CreateTapePartition
561 * Purpose : The CreateTapePartition function reformats a tape.
562 * Parameters: HANDLE hDevice handle to open device
563 * DWORD dwPartitionMethode type of new partition
564 * DWORD dwCount number of new partitions to create
565 * DWORD dwSize size of new partition, in megabytes
566 * Variables :
567 * Result : If the function succeeds, the return value is NO_ERROR.
568 * If the function fails, it may return one of the following
569 * error codes:
570 * Error Description
571 * ERROR_BEGINNING_OF_MEDIA An attempt to access data before
572 * the beginning-of-medium marker failed.
573 * ERROR_BUS_RESET A reset condition was detected on the bus.
574 * ERROR_END_OF_MEDIA The end-of-tape marker was reached
575 * during an operation.
576 * ERROR_FILEMARK_DETECTED A filemark was reached during an operation.
577 * ERROR_SETMARK_DETECTED A setmark was reached during an operation.
578 * ERROR_NO_DATA_DETECTED The end-of-data marker was reached
579 * during an operation.
580 * ERROR_PARTITION_FAILURE The tape could not be partitioned.
581 * ERROR_INVALID_BLOCK_LENGTH The block size is incorrect on a
582 * new tape in a multivolume partition.
583 * ERROR_DEVICE_NOT_PARTITIONED The partition information could not
584 * be found when a tape was being loaded.
585 * ERROR_MEDIA_CHANGED The tape that was in the drive has
586 * been replaced or removed.
587 * ERROR_NO_MEDIA_IN_DRIVE There is no media in the drive.
588 * ERROR_NOT_SUPPORTED The tape driver does not support a
589 * requested function.
590 * ERROR_UNABLE_TO_LOCK_MEDIA An attempt to lock the ejection
591 * mechanism failed.
592 * ERROR_UNABLE_TO_UNLOAD_MEDIA An attempt to unload the tape failed.
593 * ERROR_WRITE_PROTECT The media is write protected.
594 * Remark : Creating partitions reformats the tape. All previous information
595 * recorded on the tape is destroyed.
596 * Errorcodes are defined in winerror.h
597 * Status : UNTESTED STUB
598 *
599 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
600 *****************************************************************************/
601
602DWORD WIN32API CreateTapePartition( HANDLE hDevice, DWORD dwPartitionMethod,
603 DWORD dwCount, DWORD dwSize)
604{
605
606 dprintf(("KERNEL32: CreateTapePartition(%08x,%08x,%08x,%08x) not implemented - ERROR_NOT_SUPPORTED\n",
607 hDevice, dwPartitionMethod, dwCount, dwSize
608 ));
609
610 return (ERROR_NOT_SUPPORTED);
611}
612/*****************************************************************************
613 * Name : HANDLE WIN23API CreateWaitableTimerA
614 * Purpose : The CreateWaitableTimerA function creates a "waitable" timer object.
615 * Parameters: LPSECURITY_ATTRIBUTES lpTimerAttributes pointer to security attributes
616 * BOOL bManualReset flag for manual reset state
617 * LPCTSTR lpTimerName pointer to timer object name
618 * Variables :
619 * Result : If the function succeeds, the return value is a handle to the
620 * timer object. If the named timer object exists before the
621 * function call, GetLastError returns ERROR_ALREADY_EXISTS.
622 * Otherwise, GetLastError returns zero.
623 * If the function fails, the return value is NULL
624 * Remark :
625 * Status : UNTESTED STUB
626 *
627 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
628 *****************************************************************************/
629
630HANDLE WIN32API CreateWaitableTimerA( LPSECURITY_ATTRIBUTES lpTimerAttributes,
631 BOOL bManualReset, LPCSTR lpTimerName)
632{
633
634 dprintf(("KERNEL32: CreateWaitableTimer(%08x,%08x,%08x) not implemented\n",
635 lpTimerAttributes, bManualReset, lpTimerName
636 ));
637
638 return (NULL);
639}
640
641/*****************************************************************************
642 * Name : HANDLE WIN23API CreateWaitableTimerW
643 * Purpose : The CreateWaitableTimerW function creates a "waitable" timer object.
644 * Parameters: LPSECURITY_ATTRIBUTES lpTimerAttributes pointer to security attributes
645 * BOOL bManualReset flag for manual reset state
646 * LPCTSTR lpTimerName pointer to timer object name
647 * Variables :
648 * Result : If the function succeeds, the return value is a handle to the
649 * timer object. If the named timer object exists before the
650 * function call, GetLastError returns ERROR_ALREADY_EXISTS.
651 * Otherwise, GetLastError returns zero.
652 * If the function fails, the return value is NULL
653 * Remark :
654 * Status : UNTESTED STUB
655 *
656 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
657 *****************************************************************************/
658
659HANDLE WIN32API CreateWaitableTimerW( LPSECURITY_ATTRIBUTES lpTimerAttributes,
660 BOOL bManualReset, LPCWSTR lpTimerName)
661{
662
663 dprintf(("KERNEL32: CreateWaitableTimer(%08x,%08x,%08x) not implemented\n",
664 lpTimerAttributes, bManualReset, lpTimerName
665 ));
666
667 return (NULL);
668}
669
670/*****************************************************************************
671 * Name : BOOL WIN32API DebugActiveProcess
672 * Purpose : The DebugActiveProcess function allows a debugger to attach to
673 * an active process and then debug it.
674 * Parameters: DWORD dwProcessId process to be debugged
675 * Variables :
676 * Result : If the function succeeds, the return value is nonzero.
677 * If the function fails, the return value is zero
678 * Remark :
679 * Status : UNTESTED STUB
680 *
681 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
682 *****************************************************************************/
683
684BOOL WIN32API DebugActiveProcess(DWORD dwProcessId)
685{
686
687 dprintf(("KERNEL32:DebugActiveProcess(%08x) not implemented\n",
688 dwProcessId
689 ));
690
691 return (FALSE);
692}
693
694
695/*****************************************************************************
696 * Name : VOID WIN32API DeleteFiber
697 * Purpose : The DeleteFiber function deletes an existing fiber
698 * Parameters: LPVOID lpFiber pointer to the fiber to delete
699 * Variables :
700 * Result : No returnvalue
701 * Remark : The DeleteFiber function deletes all data associated with the
702 * fiber. This data includes the stack, a subset of the registers,
703 * and the fiber data. If the currently running fiber calls
704 * DeleteFiber, the ExitThread function is called and the thread
705 * terminates. If the currently running fiber is deleted by another
706 * thread, the thread associated with the fiber is likely to
707 * terminate abnormally because the fiber stack has been freed.
708 * Status : UNTESTED STUB
709 *
710 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
711 *****************************************************************************/
712
713VOID WIN32API DeleteFiber(LPVOID lpFiber)
714{
715
716 dprintf(("KERNEL32: DeleteFiber(%08x) not implemented\n",
717 lpFiber
718 ));
719}
720/*****************************************************************************
721 * Name : BOOL WIN3API EndUpdateResourceA
722 * Purpose : The EndUpdateResourceA function ends a resource update
723 * in an executable file.
724 * Parameters: HANDLE hUpdate update-file handle
725 * BOOL fDiscard write flag
726 * Variables :
727 * Result : If the function succeeds and the accumulated resource
728 * modifications specified by calls to the UpdateResource function
729 * are written to the specified executable file,
730 * the return value is nonzero.
731 * If the function fails, the return value is zero
732 * Remark :
733 * Status : UNTESTED STUB
734 *
735 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
736 *****************************************************************************/
737
738BOOL WIN32API EndUpdateResourceA(HANDLE hUpdate,BOOL fDiscard)
739{
740
741 dprintf(("KERNEL32:EndUpdateResourceA(%08x,%08x)not implemented\n",
742 hUpdate, fDiscard
743 ));
744
745 return (FALSE);
746}
747
748/*****************************************************************************
749 * Name : BOOL WIN3API EndUpdateResourceW
750 * Purpose : The EndUpdateResourceW function ends a resource update
751 * in an executable file.
752 * Parameters: HANDLE hUpdate update-file handle
753 * BOOL fDiscard write flag
754 * Variables :
755 * Result : If the function succeeds and the accumulated resource
756 * modifications specified by calls to the UpdateResource function
757 * are written to the specified executable file,
758 * the return value is nonzero.
759 * If the function fails, the return value is zero
760 * Remark :
761 * Status : UNTESTED STUB
762 *
763 * Author : Markus Montkowski [Tha, 1998/05/21 17:46]
764 *****************************************************************************/
765
766BOOL WIN32API EndUpdateResourceW(HANDLE hUpdate,BOOL fDiscard)
767{
768
769 dprintf(("KERNEL32:EndUpdateResourceW(%08x,%08x) not implemented\n",
770 hUpdate, fDiscard
771 ));
772
773 return (FALSE);
774}
775
776
777/*****************************************************************************
778 * Name : DWORD WIN32API EraseTape
779 * Purpose : The EraseTape function erases all or part of a tape.
780 * Parameters: HANDLE hDevice handle to open device
781 * DWORD dwEraseType type of erasure to perform
782 * BOOL bImmediate return after erase operation begins
783 * Variables :
784 * Result : If the function succeeds, the return value is NO_ERROR.
785 * If the function fails, the return value is like in
786 * CreateTapePartition
787 * Remark : Some tape devices do not support certain tape operations. To de
788 * termine your tape device's capabilities, see your tape device
789 * documentation and use the GetTapeParameters function
790 * Status : UNTESTED STUB
791 *
792 * Author : Markus Montkowski [Tha, 1998/05/21 20:57]
793 *****************************************************************************/
794
795DWORD WIN32API EraseTape( HANDLE hDevice, DWORD dwEraseType, BOOL bImmediate)
796{
797
798 dprintf(("KERNEL32: EraseTape(%08x,%08x,%08x) not implemented - ERROR_NOT_SUPPORTED\n",
799 hDevice, dwEraseType, bImmediate
800 ));
801
802 return (ERROR_NOT_SUPPORTED);
803}
804
805/*****************************************************************************
806 * Name : int WIN32API FoldStringA
807 * Purpose : The FoldStringW function maps one string to another, performing
808 * a specified transformation option.
809 * Parameters: DWORD dwMapFlags, // mapping transformation options
810 * LPCSTR lpSrcStr, // pointer to source string
811 * int cchSrc, // size of source string, in bytes or characters
812 * LPSTR lpDestStr, // pointer to destination buffer
813 * int cchDest // size of destination buffer, in bytes or characters
814 * Variables :
815 * Result : If the function succeeds, the return value is the number of bytes
816 * (ANSI version) or characters (Unicode version) written to the
817 * destination buffer, or if the cchDest parameter is zero,
818 * the number of bytes or characters required to hold the mapped
819 * string.
820 * If the function fails, the return value is zero
821 * Remark :
822 * Status : UNTESTED STUB
823 *
824 * Author : Markus Montkowski [Tha, 1998/05/21 20:57]
825 *****************************************************************************/
826
827int WIN32API FoldStringA( DWORD dwMapFlags, LPCSTR lpSrcStr,
828 int cchSrc, LPSTR lpDestStr, int cchDest)
829{
830
831 dprintf(("KERNEL32: FoldStringA(%08x,%08x,%08x,%08x,%08x) not implemented\n",
832 dwMapFlags, lpSrcStr, cchSrc, lpDestStr, cchDest
833 ));
834
835 return (0);
836}
837
838/*****************************************************************************
839 * Name : int WIN32API FoldStringW
840 * Purpose : The FoldStringW function maps one string to another, performing
841 * a specified transformation option.
842 * Parameters: DWORD dwMapFlags, // mapping transformation options
843 * LPCSTR lpSrcStr, // pointer to source string
844 * int cchSrc, // size of source string, in bytes or characters
845 * LPSTR lpDestStr, // pointer to destination buffer
846 * int cchDest // size of destination buffer, in bytes or characters
847 * Variables :
848 * Result : If the function succeeds, the return value is the number of bytes
849 * (ANSI version) or characters (Unicode version) written to the
850 * destination buffer, or if the cchDest parameter is zero,
851 * the number of bytes or characters required to hold the mapped
852 * string.
853 * If the function fails, the return value is zero
854 * Remark :
855 * Status : UNTESTED STUB
856 *
857 * Author : Markus Montkowski [Tha, 1998/05/21 20:57]
858 *****************************************************************************/
859
860int WIN32API FoldStringW( DWORD dwMapFlags, LPCWSTR lpSrcStr,
861 int cchSrc, LPWSTR lpDestStr, int cchDest)
862{
863
864 dprintf(("KERNEL32: FoldStringA(%08x,%08x,%08x,%08x,%08x) not implemented\n",
865 dwMapFlags, lpSrcStr, cchSrc, lpDestStr, cchDest
866 ));
867
868 return (0);
869}
870
871
872/*****************************************************************************
873 * Name : DWORD GetHandleInformation
874 * Purpose : The GetHandleInformation function obtains information about certain
875 * properties of an object handle. The information is obtained as a set of bit flags.
876 * Parameters: HANDLE hObject
877 * LPDWORD lpdwFlags
878 * Variables :
879 * Result : TRUE / FALSE
880 * Remark :
881 * Status : UNTESTED STUB
882 *
883 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
884 *****************************************************************************/
885
886BOOL WIN32API GetHandleInformation(HANDLE hObject,
887 LPDWORD lpdwFlags)
888{
889 dprintf(("KERNEL32: GetHandleInformation (%08xh, %08xh) not implemented\n",
890 hObject,
891 lpdwFlags));
892
893 return (FALSE);
894}
895
896
897
898
899/*****************************************************************************
900 * Name : BOOL GetQueuedCompletionStatus
901 * Purpose : The GetQueuedCompletionStatus function attempts to dequeue an
902 * I/O completion packet from a specified input/output completion
903 * port. If there is no completion packet queued, the function waits
904 * for a pending input/output operation associated with the completion
905 * port to complete. The function returns when it can dequeue a
906 * completion packet, or optionally when the function times out. If
907 * the function returns because of an I/O operation completion, it
908 * sets several variables that provide information about the operation.
909 * Parameters: HANDLE CompletionPort the I/O completion port of interest
910 * LPDWORD lpNumberOfBytesTransferred to receive number of bytes transferred during I/O
911 * LPDWORD lpCompletionKey to receive file's completion key
912 * LPOVERLAPPED * lpOverlapped to receive pointer to OVERLAPPED structure
913 * DWORD dwMilliseconds optional timeout value
914 * Variables :
915 * Result : TRUE / FALSE
916 * Remark :
917 * Status : UNTESTED STUB
918 *
919 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
920 *****************************************************************************/
921
922BOOL WIN32API GetQueuedCompletionStatus(HANDLE CompletionPort,
923 LPDWORD lpNumberOfBytesTransferred,
924 LPDWORD lpCompletionKey,
925 LPOVERLAPPED *lpOverlapped,
926 DWORD dwMilliseconds)
927{
928 dprintf(("Kernel32: GetQueuedCompletionStatus(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.",
929 CompletionPort,
930 lpNumberOfBytesTransferred,
931 lpCompletionKey,
932 lpOverlapped,
933 dwMilliseconds));
934
935 return (FALSE);
936}
937
938
939
940/*****************************************************************************
941 * Name : BOOL GetSystemTimeAdjustment
942 * Purpose : The GetSystemTimeAdjustment function determines whether the system
943 * is applying periodic time adjustments to its time-of-day clock
944 * at each clock interrupt, along with the value and period of any
945 * such adjustments. Note that the period of such adjustments is
946 * equivalent to the time period between clock interrupts.
947 * Parameters: PDWORD lpTimeAdjustment
948 * size, in 100-nanosecond units, of a periodic time adjustment
949 * PDWORD lpTimeIncrement
950 * time, in 100-nanosecond units, between periodic time adjustments
951 * PBOOL lpTimeAdjustmentDisabled
952 * whether periodic time adjustment is disabled or enabled
953 * Variables :
954 * Result : TRUE / FALSE
955 * Remark :
956 * Status : UNTESTED STUB
957 *
958 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
959 *****************************************************************************/
960
961BOOL WIN32API GetSystemTimeAdjustment(PDWORD lpTimeAdjustment,
962 PDWORD lpTimeIncrement,
963 PBOOL lpTimeAdjustmentDisabled)
964{
965 dprintf(("KERNEL32: GetSystemTimeAdjustment(%08xh,%08xh,%08xh) not implemented.\n",
966 lpTimeAdjustment,
967 lpTimeIncrement,
968 lpTimeAdjustmentDisabled));
969
970 return (FALSE);
971}
972
973
974/*****************************************************************************
975 * Name : BOOL GetTapeParameters
976 * Purpose : The GetTapeParameters function retrieves information that
977 * describes the tape or the tape drive.
978 * Parameters: HANDLE hDevice handle of open device
979 * DWORD dwOperation type of information requested
980 * LPDWORD lpdwSize address of returned information
981 * LPVOID lpTapeInformation tape media or drive information
982 * Variables :
983 * Result : API returncode
984 * Remark :
985 * Status : UNTESTED STUB
986 *
987 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
988 *****************************************************************************/
989
990DWORD WIN32API GetTapeParameters(HANDLE hDevice,
991 DWORD dwOperation,
992 LPDWORD lpdwSize,
993 LPVOID lpTapeInformation)
994{
995 dprintf(("KERNEL32: GetTapeParameters(%08xh,%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
996 hDevice,
997 dwOperation,
998 lpdwSize,
999 lpTapeInformation));
1000
1001 return (ERROR_NOT_SUPPORTED);
1002}
1003
1004
1005/*****************************************************************************
1006 * Name : BOOL GetTapePosition
1007 * Purpose : The GetTapePosition function retrieves the current address of
1008 * the tape, in logical or absolute blocks.
1009 * Parameters: HANDLE hDevice handle of open device
1010 * DWORD dwPositionType type of address to obtain
1011 * LPDWORD lpdwPartition address of current tape partition
1012 * LPDWORD lpdwOffsetLow address of low-order 32 bits of tape position
1013 * LPDWORD lpdwOffsetHigh address of high-order 32 bits of tape position
1014 * Variables :
1015 * Result : TRUE / FALSE
1016 * Remark :
1017 * Status : UNTESTED STUB
1018 *
1019 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1020 *****************************************************************************/
1021
1022DWORD WIN32API GetTapePosition(HANDLE hDevice,
1023 DWORD dwPositionType,
1024 LPDWORD lpdwPartition,
1025 LPDWORD lpdwOffsetLow,
1026 LPDWORD lpdwOffsetHigh)
1027{
1028 dprintf(("KERNEL32: OS2GetTapePosition(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1029 hDevice,
1030 dwPositionType,
1031 lpdwPartition,
1032 lpdwOffsetLow,
1033 lpdwOffsetHigh));
1034
1035 return (ERROR_NOT_SUPPORTED);
1036}
1037
1038
1039/*****************************************************************************
1040 * Name : BOOL GetTapeStatus
1041 * Purpose : The GetTapeStatus function indicates whether the tape device is
1042 * ready to process tape commands.
1043 * Parameters: HANDLE hDevice handle of open device
1044 * Variables :
1045 * Result : API returncode
1046 * Remark :
1047 * Status : UNTESTED STUB
1048 *
1049 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1050 *****************************************************************************/
1051
1052DWORD WIN32API GetTapeStatus(HANDLE hDevice)
1053{
1054 dprintf(("KERNEL32: OS2GetTapeStatus(%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1055 hDevice));
1056
1057 return (ERROR_NOT_SUPPORTED);
1058}
1059
1060
1061/*****************************************************************************
1062 * Name : BOOL GetThreadSelectorEntry
1063 * Purpose : The GetThreadSelectorEntry function retrieves a descriptor table
1064 * entry for the specified selector and thread.
1065 * Parameters: HANDLE hThread handle of thread that contains selector
1066 * DWORD dwSelector number of selector value to look up
1067 * LPLDT_ENTRY lpSelectorEntry address of selector entry structure
1068 * Variables :
1069 * Result : TRUE / FALSE
1070 * Remark :
1071 * Status : UNTESTED STUB
1072 *
1073 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1074 *****************************************************************************/
1075
1076BOOL WIN32API GetThreadSelectorEntry(HANDLE hThread,
1077 DWORD dwSelector,
1078 LPLDT_ENTRY lpSelectorEntry)
1079{
1080 dprintf(("KERNEL32: GetThreadSelectorEntry(%08xh,%08xh,%08xh) not implemented.\n",
1081 hThread,
1082 dwSelector,
1083 lpSelectorEntry));
1084
1085 return (FALSE);
1086}
1087
1088
1089/*****************************************************************************
1090 * Name : BOOL GetThreadTimes
1091 * Purpose : The GetThreadTimes function obtains timing information about a specified thread.
1092 * Parameters: HANDLE hThread specifies the thread of interest
1093 * LPFILETIME lpCreationTime when the thread was created
1094 * LPFILETIME lpExitTime when the thread exited
1095 * LPFILETIME lpKernelTime time the thread has spent in kernel mode
1096 * LPFILETIME lpUserTime time the thread has spent in user mode
1097 * Variables :
1098 * Result : TRUE / FALSE
1099 * Remark :
1100 * Status : UNTESTED STUB
1101 *
1102 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1103 *****************************************************************************/
1104
1105BOOL WIN32API GetThreadTimes(HANDLE hThread,
1106 LPFILETIME lpCreationTime,
1107 LPFILETIME lpExitTime,
1108 LPFILETIME lpKernelTime,
1109 LPFILETIME lpUserTime)
1110{
1111 dprintf(("Kernel32: GetThreadTimes(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
1112 hThread,
1113 lpCreationTime,
1114 lpExitTime,
1115 lpKernelTime,
1116 lpUserTime));
1117
1118 return (FALSE);
1119}
1120
1121
1122
1123/*****************************************************************************
1124 * Name : BOOL PostQueuedCompletionStatus
1125 * Purpose : The PostQueuedCompletionStatus function lets you post an I/O
1126 * completion packet to an I/O completion port. The I/O completion
1127 * packet will satisfy an outstanding call to the GetQueuedCompletionStatus
1128 * function. The GetQueuedCompletionStatus function returns with the three
1129 * values passed as the second, third, and fourth parameters of the call
1130 * to PostQueuedCompletionStatus.
1131 * Parameters: HANDLE CompletionPort handle to an I/O completion port
1132 * DWORD dwNumberOfBytesTransferred
1133 * DWORD dwCompletionKey
1134 * LPOVERLAPPED lpOverlapped
1135 * Variables :
1136 * Result : TRUE / FALSE
1137 * Remark :
1138 * Status : UNTESTED STUB
1139 *
1140 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1141 *****************************************************************************/
1142
1143BOOL WIN32API PostQueuedCompletionStatus(HANDLE CompletionPort,
1144 DWORD dwNumberOfBytesTransferred,
1145 DWORD dwCompletionKey,
1146 LPOVERLAPPED lpOverlapped)
1147{
1148 dprintf(("Kernel32: PostQueuedCompletionStatus(%08xh,%08xh,%08xh,%08xh) not implemented.",
1149 CompletionPort,
1150 dwNumberOfBytesTransferred,
1151 dwCompletionKey,
1152 lpOverlapped));
1153
1154 return (FALSE);
1155}
1156
1157
1158/*****************************************************************************
1159 * Name : DWORD PrepareTape
1160 * Purpose : The PrepareTape function prepares the tape to be accessed or removed.
1161 * Parameters: HANDLE hDevice handle of open device
1162 * DWORD dwOperation preparation method
1163 * BOOL bImmediate return after operation begins
1164 * Variables :
1165 * Result : API returncode
1166 * Remark :
1167 * Status : UNTESTED STUB
1168 *
1169 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1170 *****************************************************************************/
1171
1172DWORD WIN32API PrepareTape(HANDLE hDevice,
1173 DWORD dwOperation,
1174 BOOL bImmediate)
1175{
1176 dprintf(("Kernel32: PrepareTape(%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1177 hDevice,
1178 dwOperation,
1179 bImmediate));
1180
1181 return (ERROR_NOT_SUPPORTED);
1182}
1183
1184
1185/*****************************************************************************
1186 * Name : DWORD ReadProcessMemory
1187 * Purpose : The ReadProcessMemory function reads memory in a specified process.
1188 * The entire area to be read must be accessible, or the operation fails.
1189 * Parameters: HANDLE hProcess handle of the process whose memory is read
1190 * LPCVOID lpBaseAddress address to start reading
1191 * LPVOID lpBuffer address of buffer to place read data
1192 * DWORD cbRead number of bytes to read
1193 * LPDWORD lpNumberOfBytesRead address of number of bytes read
1194 * Variables :
1195 * Result : TRUE / FALSE
1196 * Remark :
1197 * Status : UNTESTED STUB
1198 *
1199 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1200 *****************************************************************************/
1201
1202DWORD WIN32API ReadProcessMemory(HANDLE hProcess,
1203 LPCVOID lpBaseAddress,
1204 LPVOID lpBuffer,
1205 DWORD cbRead,
1206 LPDWORD lpNumberOfBytesRead)
1207{
1208 dprintf(("Kernel32: ReadProcessMemory(%08xh,%08xh,%08xh,%08xh,%08xh) not completely implemented",
1209 hProcess,
1210 lpBaseAddress,
1211 lpBuffer,
1212 cbRead,
1213 lpNumberOfBytesRead));
1214
1215 // do some (faked) access check
1216 if(hProcess != GetCurrentProcess())
1217 {
1218 dprintf(("WARNING: ReadProcessMemory: can't read memory from other processes!"));
1219 SetLastError(ERROR_ACCESS_DENIED);
1220 return FALSE;
1221 }
1222
1223 if(IsBadReadPtr(lpBaseAddress, cbRead)) {
1224 dprintf(("ERROR: ReadProcessMemory bad source pointer!"));
1225 if(lpNumberOfBytesRead)
1226 *lpNumberOfBytesRead = 0;
1227 SetLastError(ERROR_ACCESS_DENIED);
1228 return FALSE;
1229 }
1230 // FIXME: check this, if we ever run win32 binaries in different addressspaces
1231 // ... and add a sizecheck
1232 memcpy(lpBuffer,lpBaseAddress,cbRead);
1233 if(lpNumberOfBytesRead)
1234 *lpNumberOfBytesRead = cbRead;
1235
1236 SetLastError(ERROR_SUCCESS);
1237 return TRUE;
1238}
1239
1240/*****************************************************************************
1241 * Name : DWORD WriteProcessMemory
1242 * Purpose : The WriteProcessMemory function writes memory in a specified
1243 * process. The entire area to be written to must be accessible,
1244 * or the operation fails.
1245 * Parameters: HANDLE hProcess handle of process whose memory is written to
1246 * LPVOID lpBaseAddress address to start writing to
1247 * LPVOID lpBuffer address of buffer to write data to
1248 * DWORD cbWrite number of bytes to write
1249 * LPDWORD lpNumberOfBytesWritten actual number of bytes written
1250 * Variables :
1251 * Result : TRUE / FALSE
1252 * Remark :
1253 * Status : UNTESTED STUB
1254 *
1255 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1256 *****************************************************************************/
1257
1258BOOL WIN32API WriteProcessMemory(HANDLE hProcess,
1259 LPCVOID lpBaseAddress,
1260 LPVOID lpBuffer,
1261 DWORD cbWrite,
1262 LPDWORD lpNumberOfBytesWritten)
1263{
1264 // do some (faked) access check
1265 if(hProcess != GetCurrentProcess())
1266 {
1267 dprintf(("Kernel32: WriteProcessMemory(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented (different process!!)",
1268 hProcess, lpBaseAddress, lpBuffer, cbWrite, lpNumberOfBytesWritten));
1269 SetLastError(ERROR_ACCESS_DENIED);
1270 return FALSE;
1271 }
1272 dprintf(("Kernel32: WriteProcessMemory(%08xh,%08xh,%08xh,%08xh,%08xh))",
1273 hProcess,lpBaseAddress, lpBuffer, cbWrite, lpNumberOfBytesWritten));
1274
1275 if(IsBadWritePtr((LPVOID)lpBaseAddress, cbWrite))
1276 {
1277 dprintf(("ERROR: WriteProcessMemory bad destination pointer!"));
1278 if(lpNumberOfBytesWritten)
1279 *lpNumberOfBytesWritten = 0;
1280 SetLastError(ERROR_ACCESS_DENIED);
1281 return FALSE;
1282 }
1283
1284 // FIXME: check this, if we ever run win32 binaries in different addressspaces
1285 // ... and add a sizecheck
1286 memcpy((void*)lpBaseAddress,lpBuffer,cbWrite);
1287 if(lpNumberOfBytesWritten)
1288 *lpNumberOfBytesWritten = cbWrite;
1289
1290 SetLastError(ERROR_SUCCESS);
1291 return TRUE;
1292}
1293
1294
1295/*****************************************************************************
1296 * Name : BOOL SetComputerNameA
1297 * Purpose : The SetComputerNameA function sets the computer name to be used
1298 * the next time the system is restarted.
1299 * Parameters: LPCTSTR lpszName address of new computer name
1300 * Variables :
1301 * Result : TRUE / FALSE
1302 * Remark :
1303 * Status : UNTESTED STUB
1304 *
1305 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1306 *****************************************************************************/
1307
1308BOOL WIN32API SetComputerNameA(LPCTSTR lpszName)
1309{
1310 dprintf(("Kernel32: SetComputerNameA(%s) not implemented.\n",
1311 lpszName));
1312
1313 return (FALSE);
1314}
1315
1316
1317/*****************************************************************************
1318 * Name : BOOL SetComputerNameW
1319 * Purpose : The SetComputerNameW function sets the computer name to be used
1320 * the next time the system is restarted.
1321 * Parameters: LPCTSTR lpszName address of new computer name
1322 * Variables :
1323 * Result : TRUE / FALSE
1324 * Remark :
1325 * Status : UNTESTED STUB
1326 *
1327 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1328 *****************************************************************************/
1329
1330BOOL WIN32API SetComputerNameW(LPCWSTR lpszName)
1331{
1332 dprintf(("Kernel32: SetComputerNameW(%s) not implemented.\n",
1333 lpszName));
1334
1335 return (FALSE);
1336}
1337
1338
1339/*****************************************************************************
1340 * Name : VOID SetFileApisToOEM
1341 * Purpose : The SetFileApisToOEM function causes a set of Win32 file functions
1342 * to use the OEM character set code page. This function is useful
1343 * for 8-bit console input and output operations.
1344 * Parameters: VOID
1345 * Variables :
1346 * Result :
1347 * Remark :
1348 * Status : UNTESTED STUB
1349 *
1350 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1351 *****************************************************************************/
1352
1353VOID WIN32API SetFileApisToOEM(VOID)
1354{
1355 dprintf(("Kernel32: SetFileApisToOEM() not implemented.\n"));
1356}
1357
1358
1359/*****************************************************************************
1360 * Name : BOOL SetHandleInformation
1361 * Purpose : The SetHandleInformation function sets certain properties of an
1362 * object handle. The information is specified as a set of bit flags.
1363 * Parameters: HANDLE hObject handle to an object
1364 * DWORD dwMask specifies flags to change
1365 * DWORD dwFlags specifies new values for flags
1366 * Variables :
1367 * Result : TRUE / FALSE
1368 * Remark :
1369 * Status : UNTESTED STUB
1370 *
1371 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1372 *****************************************************************************/
1373
1374BOOL WIN32API SetHandleInformation(HANDLE hObject,
1375 DWORD dwMask,
1376 DWORD dwFlags)
1377{
1378 dprintf(("KERNEL32: SetHandleInformation(%08xh,%08xh,%08xh) not implemented.\n",
1379 hObject,
1380 dwMask,
1381 dwFlags));
1382
1383 return (FALSE);
1384}
1385
1386/*****************************************************************************
1387 * Name : BOOL SetSystemPowerState
1388 * Purpose : The SetSystemPowerState function suspends the system by shutting
1389 * power down. Depending on the ForceFlag parameter, the function
1390 * either suspends operation immediately or requests permission from
1391 * all applications and device drivers before doing so.
1392 * Parameters: BOOL fSuspend
1393 * BOOL fForce
1394 * Variables :
1395 * Result : TRUE / FALSE
1396 * Remark :
1397 * Status : UNTESTED STUB
1398 *
1399 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1400 *****************************************************************************/
1401
1402BOOL WIN32API SetSystemPowerState(BOOL fSuspend,
1403 BOOL fForce)
1404{
1405 dprintf(("KERNEL32: SetSystemPowerState(%08xh,%08xh) not implemented.\n",
1406 fSuspend,
1407 fForce));
1408
1409 return (FALSE);
1410}
1411
1412
1413/*****************************************************************************
1414 * Name : BOOL SetSystemTimeAdjustment
1415 * Purpose : The SetSystemTimeAdjustment function tells the system to enable
1416 * or disable periodic time adjustments to its time of day clock.
1417 * Such time adjustments are used to synchronize the time of day
1418 * with some other source of time information. When periodic time
1419 * adjustments are enabled, they are applied at each clock interrupt.
1420 * Parameters: DWORD dwTimeAdjustment
1421 * BOOL bTimeAdjustmentDisabled
1422 * Variables :
1423 * Result : TRUE / FALSE
1424 * Remark :
1425 * Status : UNTESTED STUB
1426 *
1427 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1428 *****************************************************************************/
1429
1430BOOL WIN32API SetSystemTimeAdjustment(DWORD dwTimeAdjustment,
1431 BOOL bTimeAdjustmentDisabled)
1432{
1433 dprintf(("KERNEL32: SetSystemTimeAdjustment(%08xh,%08xh) not implemented.\n",
1434 dwTimeAdjustment,
1435 bTimeAdjustmentDisabled));
1436
1437 return (FALSE);
1438}
1439
1440
1441/*****************************************************************************
1442 * Name : DWORD SetTapeParameters
1443 * Purpose : The SetTapeParameters function either specifies the block size
1444 * of a tape or configures the tape device.
1445 * Parameters: HANDLE hDevice handle of open device
1446 * DWORD dwOperation type of information to set
1447 * LPVOID lpTapeInformation address of buffer with information to set
1448 * Variables :
1449 * Result : API returncode
1450 * Remark :
1451 * Status : UNTESTED STUB
1452 *
1453 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1454 *****************************************************************************/
1455
1456BOOL WIN32API SetTapeParameters(HANDLE hDevice,
1457 DWORD dwOperation,
1458 LPVOID lpTapeInformation)
1459{
1460 dprintf(("KERNEL32: SetTapeParameters(%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1461 hDevice,
1462 dwOperation,
1463 lpTapeInformation));
1464
1465 return (ERROR_NOT_SUPPORTED);
1466}
1467
1468
1469/*****************************************************************************
1470 * Name : DWORD SetTapePosition
1471 * Purpose : The SetTapePosition sets the tape position on the specified device.
1472 * Parameters: HANDLE hDevice handle of open device
1473 * DWORD dwPositionMethod type of positioning to perform
1474 * DWORD dwPartition new tape partition
1475 * DWORD dwOffsetLow low-order 32 bits of tape position
1476 * DWORD dwOffsetHigh high-order 32 bits of tape position
1477 * BOOL bImmediate return after operation begins
1478 * Variables :
1479 * Result : API returncode
1480 * Remark :
1481 * Status : UNTESTED STUB
1482 *
1483 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1484 *****************************************************************************/
1485
1486BOOL WIN32API SetTapePosition(HANDLE hDevice,
1487 DWORD dwPositionMethod,
1488 DWORD dwPartition,
1489 DWORD dwOffsetLow,
1490 DWORD dwOffsetHigh,
1491 BOOL bImmediate)
1492{
1493 dprintf(("KERNEL32: SetTapePosition(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1494 hDevice,
1495 dwPositionMethod,
1496 dwPartition,
1497 dwOffsetLow,
1498 dwOffsetHigh,
1499 bImmediate));
1500
1501 return (ERROR_NOT_SUPPORTED);
1502}
1503
1504
1505
1506
1507/*****************************************************************************
1508 * Name : BOOL UpdateResourceA
1509 * Purpose : The UpdateResourceA function adds, deletes, or replaces a resource
1510 * in an executable file.
1511 * Parameters: HANDLE hUpdateFile update-file handle
1512 * LPCTSTR lpszType address of resource type to update
1513 * LPCTSTR lpszName address of resource name to update
1514 * WORD IDLanguage language identifier of resource
1515 * LPVOID lpvData address of resource data
1516 * DWORD cbData length of resource data, in bytes
1517 * Variables :
1518 * Result : TRUE / FALSE
1519 * Remark :
1520 * Status : UNTESTED STUB
1521 *
1522 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1523 *****************************************************************************/
1524
1525BOOL WIN32API UpdateResourceA(HANDLE hUpdateFile,
1526 LPCTSTR lpszType,
1527 LPCTSTR lpszName,
1528 WORD IDLanguage,
1529 LPVOID lpvData,
1530 DWORD cbData)
1531{
1532 dprintf(("KERNEL32: UpdateResourceA(%08xh,%s,%s,%08xh,%08xh,%08xh) not implemented.\n",
1533 hUpdateFile,
1534 lpszType,
1535 lpszName,
1536 IDLanguage,
1537 lpvData,
1538 cbData));
1539
1540 return (FALSE);
1541}
1542
1543
1544/*****************************************************************************
1545 * Name : BOOL UpdateResourceW
1546 * Purpose : The UpdateResourceW function adds, deletes, or replaces a resource
1547 * in an executable file.
1548 * Parameters: HANDLE hUpdateFile update-file handle
1549 * LPCTSTR lpszType address of resource type to update
1550 * LPCTSTR lpszName address of resource name to update
1551 * WORD IDLanguage language identifier of resource
1552 * LPVOID lpvData address of resource data
1553 * DWORD cbData length of resource data, in bytes
1554 * Variables :
1555 * Result : TRUE / FALSE
1556 * Remark :
1557 * Status : UNTESTED STUB
1558 *
1559 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1560 *****************************************************************************/
1561
1562BOOL WIN32API UpdateResourceW(HANDLE hUpdateFile,
1563 LPCWSTR lpszType,
1564 LPCWSTR lpszName,
1565 WORD IDLanguage,
1566 LPVOID lpvData,
1567 DWORD cbData)
1568{
1569 dprintf(("KERNEL32: UpdateResourceW(%08xh,%s,%s,%08xh,%08xh,%08xh) not implemented.\n",
1570 hUpdateFile,
1571 lpszType,
1572 lpszName,
1573 IDLanguage,
1574 lpvData,
1575 cbData));
1576
1577 return (FALSE);
1578}
1579
1580/*****************************************************************************
1581 * Name : BOOL WriteTapemark
1582 * Purpose : The WriteTapemark function writes a specified number of filemarks,
1583 * setmarks, short filemarks, or long filemarks to a tape device.
1584 * These tapemarks divide a tape partition into smaller areas.
1585 * Parameters: HANDLE hDevice handle of open device
1586 * DWORD dwTapemarkType type of tapemarks to write
1587 * DWORD dwTapemarkCount number of tapemarks to write
1588 * BOOL bImmediate return after write begins
1589 * Variables :
1590 * Result : API returncode
1591 * Remark :
1592 * Status : UNTESTED STUB
1593 *
1594 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
1595 *****************************************************************************/
1596
1597DWORD WIN32API WriteTapemark(HANDLE hDevice,
1598 DWORD dwTapemarkType,
1599 DWORD dwTapemarkCount,
1600 BOOL bImmediate)
1601{
1602 dprintf(("KERNEL32: WriteTapemark(%08xh,%08xh,%08xh,%08xh) not implemented - ERROR_NOT_SUPPORTED.\n",
1603 hDevice,
1604 dwTapemarkType,
1605 dwTapemarkCount,
1606 bImmediate));
1607
1608 return (ERROR_NOT_SUPPORTED);
1609}
1610
1611
1612/*****************************************************************************
1613 * Name : DWORD CmdBatNotification
1614 * Purpose : Unknown, used by /winnt/cmd.exe
1615 * Parameters: Unknown (wrong)
1616 * Variables :
1617 * Result : Unknown
1618 * Remark :
1619 * Status : UNTESTED STUB
1620 *
1621 * Author : Patrick Haller [Tue, 1999/06/08 21:44]
1622 *****************************************************************************/
1623
1624DWORD WIN32API CmdBatNotification(DWORD x1)
1625{
1626 dprintf(("KERNEL32: CmdBatNotification(%08xh) not implemented\n",
1627 x1));
1628
1629 return (0);
1630}
1631
1632
1633/*****************************************************************************
1634 * Name : DWORD GetVDMCurrentDirectories
1635 * Purpose : Unknown, used by /winnt/cmd.exe
1636 * Parameters: Unknown (wrong)
1637 * Variables :
1638 * Result : Unknown
1639 * Remark :
1640 * Status : UNTESTED STUB
1641 *
1642 * Author : Patrick Haller [Tue, 1999/06/08 21:44]
1643 *****************************************************************************/
1644
1645DWORD WIN32API GetVDMCurrentDirectories(DWORD x1)
1646{
1647 dprintf(("KERNEL32: GetVDMCurrentDirectories(%08xh) not implemented\n",
1648 x1));
1649
1650 return (0);
1651}
1652
1653
1654/*****************************************************************************
1655 * Name : DWORD SetThreadPriorityBoost
1656 * Purpose : Unknown
1657 * Parameters: Unknown (wrong)
1658 * Variables :
1659 * Result : Unknown
1660 * Remark :
1661 * Status : UNTESTED STUB
1662 *
1663 * Author : Patrick Haller [Tue, 1999/06/08 21:44]
1664 *****************************************************************************/
1665
1666DWORD WIN32API SetThreadPriorityBoost(DWORD x1,
1667 DWORD x2)
1668{
1669 dprintf(("KERNEL32: SetThreadPriorityBoost(%08xh, %08xh) not implemented\n",
1670 x1,
1671 x2));
1672
1673 return (0);
1674}
Note: See TracBrowser for help on using the repository browser.