Skip to content

Commit

Permalink
强制结束并关闭窗口
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed May 10, 2016
1 parent 591fa69 commit 6980225
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions 23_day/bootpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ struct SHEET {
unsigned char *buf;
int bxsize, bysize, vx0, vy0, col_inv, height, flags;
struct SHTCTL *ctl;
struct TASK *task;
};
struct SHTCTL {
unsigned char *vram, *map;
Expand Down
11 changes: 11 additions & 0 deletions 23_day/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
char name[18], *p, *q;
struct TASK *task = task_now();
int i, segsiz, datsiz, esp, dathrb;
struct SHTCTL *shtctl;
struct SHEET *sht;

/*根据命令行生成文件名*/
for (i = 0; i < 13; i++) {
Expand Down Expand Up @@ -298,6 +300,14 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
q[esp + i] = p[dathrb + i];
}
start_app(0x1b, 1003 * 8, esp, 1004 * 8, &(task->tss.esp0));
shtctl = (struct SHTCTL *) *((int *) 0x0fe4);
for (i = 0; i < MAX_SHEETS; i++) {
sht = &(shtctl->sheets0[i]);
if (sht->flags != 0 && sht->task == task) {
/*找到被应用程序遗留的窗口*/
sheet_free(sht); /*关闭*/
}
}
memman_free_4k(memman, (int) q, segsiz);
} else {
cons_putstr0(cons, ".hrb file format error.\n");
Expand Down Expand Up @@ -333,6 +343,7 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
return &(task->tss.esp0);
} else if (edx == 5) {
sht = sheet_alloc(shtctl);
sht->task = task;
sheet_setbuf(sht, (char *) ebx + ds_base, esi, edi, eax);
make_window8((char *) ebx + ds_base, esi, edi, (char *) ecx + ds_base, 0);
sheet_slide(sht, 100, 50);
Expand Down
1 change: 1 addition & 0 deletions 23_day/sheet.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct SHEET *sheet_alloc(struct SHTCTL *ctl)
sht = &ctl->sheets0[i];
sht->flags = SHEET_USE; /* 标记为正在使用*/
sht->height = -1; /* 隐藏 */
sht->task = 0; /*不使用自动关闭功能*/
return sht;
}
}
Expand Down

0 comments on commit 6980225

Please sign in to comment.