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

Last change on this file since 22019 was 22019, checked in by abwillis, 13 years ago

Stub ConvertThreadToFiber more ticket #25 work.

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